@esfx/decorators Package
Provides a number of frequently used decorators.
Installation
npm i @esfx/decorators
Usage
TBD
Variables
autobind
Declaration
autobind: {
(target: Function): void;
(target: object, key: PropertyKey, descriptor?: PropertyDescriptor | undefined): void;
}
autoproperty
Converts a field declaration into an accessor with a backing property.
Declaration
autoproperty: ((readonly?: boolean | undefined) => (target: object, key: PropertyKey, descriptor?: PropertyDescriptor | undefined) => void) & ((target: object, key: PropertyKey, descriptor?: PropertyDescriptor | undefined) => void)
configurable
Makes a method or accessor configurable.
Declaration
configurable: (() => (target: object, key: PropertyKey, descriptor?: PropertyDescriptor | undefined) => void) & ((target: object, key: PropertyKey, descriptor?: PropertyDescriptor | undefined) => void)
enumerable
Makes a method or accessor enumerable.
Declaration
enumerable: (() => (target: object, key: PropertyKey, descriptor?: PropertyDescriptor | undefined) => void) & ((target: object, key: PropertyKey, descriptor?: PropertyDescriptor | undefined) => void)
lazyinit
Declaration
lazyinit: (initializer: () => unknown, attributes?: {
enumerable?: boolean | undefined;
configurable?: boolean | undefined;
writable?: boolean | undefined;
} | undefined) => (target: object, key: PropertyKey, descriptor?: PropertyDescriptor | undefined) => void
mixin
Declaration
mixin: (...args: object[]) => <T extends Function>(target: T) => T
nonconfigurable
Makes a method or accessor non-configurable.
Declaration
nonconfigurable: (() => (target: object, key: PropertyKey, descriptor?: PropertyDescriptor | undefined) => void) & ((target: object, key: PropertyKey, descriptor?: PropertyDescriptor | undefined) => void)
nonenumerable
Makes a method or accessor non-enumerable.
Declaration
nonenumerable: (() => (target: object, key: PropertyKey, descriptor?: PropertyDescriptor | undefined) => void) & ((target: object, key: PropertyKey, descriptor?: PropertyDescriptor | undefined) => void)
obsolete
Makes a member obsolete.
Declaration
obsolete: ((message?: string | undefined, error?: boolean | undefined) => {
<T extends Function>(target: T): void | T;
(target: object, key: PropertyKey, descriptor?: PropertyDescriptor | undefined): void;
}) & {
<T extends Function>(target: T): void | T;
(target: object, key: PropertyKey, descriptor?: PropertyDescriptor | undefined): void;
}
readonly
Makes a method non-writable.
Declaration
readonly: (() => (target: object, key: PropertyKey, descriptor?: PropertyDescriptor | undefined) => void) & ((target: object, key: PropertyKey, descriptor?: PropertyDescriptor | undefined) => void)
writable
Makes a method writable.
Declaration
writable: (() => (target: object, key: PropertyKey, descriptor?: PropertyDescriptor | undefined) => void) & ((target: object, key: PropertyKey, descriptor?: PropertyDescriptor | undefined) => void)