fjlMutable

Methods

static createTypedDescriptor(Type, target, propName) → {Descriptor}

Creates a descriptor for a property which is settable but throws errors when the `Type` is disobeyed.
Parameters:
Name Type Description
Type TypeRef {String|Function}
target *
propName String
Returns:
Descriptor - - Property descriptor with just getter and setter.

static defineEnumProp(Type, target, propName, defaultValueopt) → {TargetDescriptorTuple}

Allows you to define a "typed", enumerated property on `target`.
Parameters:
Name Type Attributes Description
Type TypeRef {String|Function}
target TargetDescriptorTuple Target or array of target and descriptor ([target, descriptor]).
propName String
defaultValue * <optional>

static defineEnumProps(argsTuple, targetopt) → {Array.<TargetDescriptorTuple>}

Allows you to define multiple enum props at once on target.
Parameters:
Name Type Attributes Description
argsTuple Array.<DefinePropArgsTuple> Array of argArrays for `defineEnumProp`.
target Target <optional>
Target to use in internal calls if one is not provided but encountered 'argArray'.
Returns:
Array.<TargetDescriptorTuple> - - Results of each call to `defineEnumProp`.

static defineProp(Type, target, propName, defaultValueopt) → {TargetDescriptorTuple}

Allows you to define a "typed" property on given `target`.
Parameters:
Name Type Attributes Description
Type TypeRef {String|Function}
target TargetDescriptorTuple Target or array of target and descriptor ([target, descriptor]).
propName String
defaultValue * <optional>

static defineProps(argsTuple, targetopt) → {Array.<TargetDescriptorTuple>}

Allows you to define multiple props at once on target.
Parameters:
Name Type Attributes Description
argsTuple Array.<DefinePropArgsTuple> Array of argArrays for `defineProp`.
target Target <optional>
Target to use in internal calls if one is not provided but encountered 'argArray'.
Returns:
Array.<TargetDescriptorTuple> - - Results of each call to `defineProp`.

static toEnumerableDescriptor() → {TargetDescriptorTuple}

Returns a target-descriptor tuple whose 'descriptor' will be set to enumerable (`enumerable: true`).
Parameters:
Type Description
TargetDescriptorTuple [target, descriptor] tuple.
Returns:
TargetDescriptorTuple - - Array of target and descriptor.

static toTargetDescriptorTuple(targetOrTargetDescriptorTuple) → {Array.<*>|Array.<*, *>}

Returns an target and descriptor tuple from given.
Parameters:
Name Type Description
targetOrTargetDescriptorTuple * | Array.<*, *> Target object or tuple of target and descriptor.
Returns:
Array.<*> | Array.<*, *>