import {
  Type,
  PropertyKeyType,
} from '@loafer/core';

import {
  Annotation,
} from '@loafer/core/reflect';

export interface Decorator<Attribute = {}> {
  classDecorator?: <TFunction extends Function>(target: TFunction) => TFunction | void;
  propertyDecorator?: (target: Object, propertyKey: PropertyKeyType) => void;
  methodDecorator?: <T>(target: Object, propertyKey: PropertyKeyType,
                          descriptor: TypedPropertyDescriptor<T>) => TypedPropertyDescriptor<T> | void;
  parameterDecorator?: (target: Object, propertyKey: PropertyKeyType, parameterIndex: number) => void;
}

export abstract class Decorator<Attribute = {}> extends Annotation<Attribute> {
  public constructor(attribute?: Attribute) {
    super(attribute);
  }
}
