Static methods

Public

Variable.define()

The static method defines the Variable of a specified name with an optional value.

attribute.class.ts
public static define<Name extends string, Value extends string>(
  name: Name,
  value?: Value
): Variable<Name, Value> {
  return new this(name, value);
}
Generic type variables

Name extends string

​A generic type variable constrained by a stringarrow-up-right by default of the value captured from the provided name parameter indicates the name type of Variable via return type.

Value extends string

​A generic type variable constrained by a stringarrow-up-right by default of the value captured from the provided value parameter indicates the value type of Variable via return type.

Parameters

Name: type
Description

name: Name

The variable name of a generic type variable Name to define.

value?: Value

Optional variable value of a generic type variable Value.

Returns

The return value is a new instance of Variable with the given name and an optional value.

Example usage

Variable.isVariable()

The static method checks whether the value of any type is an instance of a Variable.

Generic type variables

Name extends string

​A generic type variable constrained by a stringarrow-up-right by default of the value captured from the provided name parameter indicates the name type of Attribute via return type.

Value extends string

​A generic type variable constrained by a stringarrow-up-right by default of the value captured from the provided value parameter indicates the value type of Attribute via return type.

Parameters

Name: type
Description

value: any

The value of any type to check against the Attribute instance.

name?: Name

Optional name of a generic type variable Name, as the variable name of a given value.

variableValue?: Value

The optional variable value of a generic type variable Value to check if the given value contains.

Returns

Return type

value is Variable<Name, Value>

The return type is a boolean confirming the value parameter is an instance of Variable.

The return value is a booleanarrow-up-right indicating whether the value is the Attribute instance of any or given name and value.

Example usage

Last updated