Bool
Extends:
Boolean input.
const input = Input.create('myInput: bool');
input.setValue(false);
// vector version
const input = Input.create('myInput: bool[]');
input.setValue([false, true, false]);
This input can also be created using the alias: boolean
Property Summary
Property Name | Description | Defined by Default | Default Value |
---|---|---|---|
primitive | ensures the value is a primitive | ![]() |
![]() |
All properties including the inherited ones can be listed via registeredPropertyNames
Static Method Summary
Static Protected Methods | ||
protected static |
_decodeScalar(value: string): bool Decodes the input value from the string representation (_encodeScalar) to the data type of the input. |
|
protected static |
_decodeVector(value: string): * Decodes a vector value from the string representation (Input._encodeVector) to the data type of the input. |
|
protected static |
_encodeScalar(value: *): string Encodes the input value to a string representation that can be later decoded through _decodeScalar. |
|
protected static |
_encodeVector(values: Array<string>): string Encodes a vector value to a string representation that can be later decoded through Input._decodeVector. |
Method Summary
Protected Methods | ||
protected |
_validation(at: null | number): Promise<*> Implements input's validations |
Inherited Summary
From class Input | ||
public static |
Creates an input instance. |
|
public static |
Registers a new input type to the available inputs |
|
public static |
registerProperty(inputClassOrRegisteredName: string | Input, name: string, initialValue: *) Registers a property for the input type (also available as |
|
public static |
registeredInput(name: string): Input Returns the input type based on the registration name |
|
public static |
Returns a list containing the names of the registered input types |
|
public static |
registeredPropertyNames(inputClassOrRegisteredName: string | Input): Array<string> Returns a list about all registered property names including the inherited ones for the input type |
|
protected static |
_decodeScalar(value: string): * Decodes the input value from the string representation (Input._encodeScalar) to the data type of the input. |
|
protected static |
_decodeVector(value: string): * Decodes a vector value from the string representation ({Input._encodeScalar & Input._encodeVector) to the data type of the input. |
|
protected static |
_encodeScalar(value: *): string Encodes the input value to a string representation that can be later decoded through Input._decode. |
|
protected static |
_encodeVector(values: Array<string>): string Encodes a vector value to a string representation that can be later decoded through Input._decodeVector. |
|
public |
assignProperty(name: string, value: *, loose: boolean) Sets a property to the input. |
|
public |
Returns the cache used by the input |
|
public |
Forces to flush the internal input cache |
|
public |
hasProperty(name: string): boolean Returns a boolean telling if the input property name is assigned to the input |
|
public |
Returns if the value of the input is empty. |
|
public |
isPropertyLocked(name: string): boolean Returns a boolean telling if the property is locked (Input.lockProperty) |
|
public |
Returns if the value of the input is required. |
|
public |
Returns if the input is serializable |
|
public |
Returns if the value of the input is a vector. |
|
public |
lockProperty(name: string, lock: boolean) Prevents a property value to be modified by Input.assignProperty |
|
public |
Returns the name of the input which is defined at construction time (inputs cannot be renamed) |
|
public |
parseValue(value: string, assignValue: boolean): * Decodes a value represented as string to the type that is compatible with the input. |
|
public |
Returns the property value for the input property name |
|
public |
propertyNames(): Array<string> Returns a list containing the property names assigned to the input |
|
public |
Returns a boolean telling if the input is in read-only mode. |
|
public |
async serializeValue(): Promise<string> This method should return a string representation about the current value in a way that can be recovered later through parseValue. |
|
public |
setReadOnly(enable: boolean) Changes the read-only state of the input. |
|
public |
setValue(value: *) Sets the value of the input |
|
public |
Sets the input value by avoiding the overhead that may occur when the same value is used across actions that have the input type, therefore this method avoids the re-computation by copying the caches and value associated with the source input to the current input. |
|
public |
Executes the input validations (_validation), in case of a failed validation then an exception of type ValidationFail is raised |
|
public |
value(): * Returns the value of the input |
|
public |
This method enforces the context of the value being queried. |
|
protected |
_getFromCache(name: string, at: null | number): * Auxiliary method used internally by the input implementations to get a value from the cache |
|
protected |
Auxiliary method used internally by input implementations to check if the key is under the cache |
|
protected |
_setToCache(name: string, value: *, at: null | number) Auxiliary method used internally by input implementations to set a value to the cache |
|
protected |
async _validation(at: null | number): Promise<*> Use this method to implement generic validations for your input implementation. |
Static Protected Methods
protected static _decodeScalar(value: string): bool source
Decodes the input value from the string representation (_encodeScalar) to the data type of the input. This method is called internally during parseValue
Override:
Input#_decodeScalarParams:
Name | Type | Attribute | Description |
value | string | string containing the encoded value |
Return:
bool |
protected static _decodeVector(value: string): * source
Decodes a vector value from the string representation (Input._encodeVector) to the data type of the input. This method is called internally during Input.parseValue
Override:
Input#_decodeVectorParams:
Name | Type | Attribute | Description |
value | string | encoded value |
Return:
* |
protected static _encodeScalar(value: *): string source
Encodes the input value to a string representation that can be later decoded through _decodeScalar. This method is called internally during the serializeValue
Override:
Input#_encodeScalarParams:
Name | Type | Attribute | Description |
value | * | value that should be encoded to a string |
protected static _encodeVector(values: Array<string>): string source
Encodes a vector value to a string representation that can be later decoded through Input._decodeVector. This method is called internally during the serializeValue
Override:
Input#_encodeVectorProtected Methods
protected _validation(at: null | number): Promise<*> source
Implements input's validations