UNPKG

@typescript-package/descriptor

Version:

A lightweight TypeScript library for property descriptor.

47 lines (46 loc) 1.66 kB
import { CommonPropertyDescriptor } from "@typedly/descriptor"; /** * @description The common properties for descriptors. * @export * @abstract * @class CommonDescriptor * @template {boolean} [C=boolean] The type of configurable property. * @template {boolean} [E=boolean] The type of enumerable property. * @implements {Pick<PropertyDescriptor, 'configurable' | 'enumerable'>} */ export declare abstract class CommonDescriptor<C extends boolean = boolean, E extends boolean = boolean> implements Pick<PropertyDescriptor, 'configurable' | 'enumerable'> { /** * @description The default value for configurable. * @public * @static * @type {?boolean} */ static configurable?: boolean; /** * @description The default value for enumerable. * @public * @static * @type {?boolean} */ static enumerable?: boolean; /** * @description The configurable property. * @public * @type {?C} */ configurable?: C; /** * @description The enumerable property. * @public * @type {?E} */ enumerable?: E; /** * Creates an instance of `CommonDescriptor` child class. * @constructor * @param {CommonPropertyDescriptor<C, E>} [param0={}] Object containing configurable and enumerable properties. * @param {CommonPropertyDescriptor<C, E>} param0.configurable The configurable property. Defaults to static configurable value. * @param {CommonPropertyDescriptor<C, E>} param0.enumerable The enumerable property. Defaults to static enumerable value. */ constructor({ configurable, enumerable }?: CommonPropertyDescriptor<C, E>); }