UNPKG

@ne1410s/codl

Version:

Indulge your apps with codl: a component model library

29 lines (28 loc) 1.11 kB
import 'reflect-metadata'; import { TypedPropertyDecorator, Ctor } from '../types'; /** Decorators for metadata purposes. */ export declare abstract class Metadata { /** * Associates a display name with the member to which it is applied. * @param val The name. */ static readonly displayName: (val: string) => { (target: Function): void; (target: Object, propertyKey: string | symbol): void; }; /** * Associates a description with the member to which it is applied. * @param val The description. */ static readonly description: (val: string) => { (target: Function): void; (target: Object, propertyKey: string | symbol): void; }; /** * Associates a format function with the member to which it is applied. * @param fn The format function. */ static readonly format: <T>(fn: (val: T) => string) => TypedPropertyDecorator<T>; /** Associates a child's prototype data on the parent in which it appears. */ static readonly model: <T extends Object>(ctor: Ctor<T>) => TypedPropertyDecorator<T | T[]>; }