import { Directive, EventEmitter, HostBinding, Input } from '@angular/core';

@Directive()
export abstract class UiFormControlDirective<T> {
  @Input()
  @HostBinding('attr.name')
  name: string = (Date.now() + Math.random()).toString(32);

  @Input()
  @HostBinding('attr.id')
  id: string = (Date.now() + Math.random()).toString(32);

  focused = new EventEmitter<boolean>();

  abstract type: string;

  abstract get valueEmpty(): boolean;

  abstract clear(): void;

  abstract focus(): void;
}
