import { AnyDecorator, AnyDescriptorReturn, ConstructorOrObject, DecoratorType, IndexOrTypedPropertyDescriptor, nameOfDecorator } from './util'; export declare type Constructor = new (...args: any[]) => T; export type Reference = { type: Constructor; property?: string | Function; } export type Since = { since?: string; } export type DeprecatedOptions = Since & { willBeRemovedInVersion?: string; alternative?: Reference[]; comment?: string; } export function Deprecated(options?: DeprecatedOptions): AnyDecorator { return function deprecated(target: ConstructorOrObject, propertyKey?: PropertyKey, descriptorOrIndex?: IndexOrTypedPropertyDescriptor): AnyDescriptorReturn | void { const result = nameOfDecorator(target, propertyKey, descriptorOrIndex); switch (result.decoratorType) { case DecoratorType.classDecorator: break; case DecoratorType.methodDecorator: break; case DecoratorType.parameterDecorator: break; case DecoratorType.propertyDecorator: break; } return result.returnVal; } } export type BetaOptions = Since & { targetRelease?: string; comment?: string; } export function Beta(options?: BetaOptions): AnyDecorator { return function beta(target: ConstructorOrObject, propertyKey?: PropertyKey, descriptorOrIndex?: IndexOrTypedPropertyDescriptor): AnyDescriptorReturn | void { const result = nameOfDecorator(target, propertyKey, descriptorOrIndex); switch (result.decoratorType) { case DecoratorType.classDecorator: break; case DecoratorType.methodDecorator: break; case DecoratorType.parameterDecorator: break; case DecoratorType.propertyDecorator: break; } return result.returnVal; } } export class System { static readonly Browser = 'browser'; static readonly Node = 'node.js'; } export class Os { static readonly Linux = 'linux'; static readonly Windows = 'windows'; static readonly Mac = 'mac'; } export type Restriction = { name?: string; version?: string; } export type RestrictedToOptions = { system?: Restriction | Restriction[]; os?: Restriction | Restriction[]; comment?: string; } export function RestrictTo(options: RestrictedToOptions): AnyDecorator { return function restrictTo(target: ConstructorOrObject, propertyKey?: PropertyKey, descriptorOrIndex?: IndexOrTypedPropertyDescriptor): AnyDescriptorReturn | void { const result = nameOfDecorator(target, propertyKey, descriptorOrIndex); switch (result.decoratorType) { case DecoratorType.classDecorator: break; case DecoratorType.methodDecorator: break; case DecoratorType.parameterDecorator: break; case DecoratorType.propertyDecorator: break; } return result.returnVal; } }