Type module
Sources
Items from Type can be imported/included and used via following ways.
/** * -------------------------------------------------------- * Import via main package: core.ts * Access items like: am4core.type.myVariable * am4core.type.myFunction() * -------------------------------------------------------- */ import * as am4core from "@amcharts/amcharts4"; /** * -------------------------------------------------------- * Import via: Type.ts * Access items like: $type.myVariable * $type.myFunction() * -------------------------------------------------------- */ import * as $type from "@amcharts/amcharts4/Type";
/** * -------------------------------------------------------- * Include via "core.js" * Access items like: am4core.type.myVariable * am4core.type.myFunction() * -------------------------------------------------------- */
Variables
Type does not have any variables.
Functions
|
castNumber( value: ) |
Returns Casts string or a number into a number. @throws {Error} |
|---|---|
|
castString( value: ) |
Returns Casts string or a number into string. @deprecated Not used anywhere |
|
checkArray( value: ) |
Returns Checks if the passed in value is an array. @throws {Error} |
|
checkBoolean( value: ) |
Returns Checks if the passed in value is a boolean. @throws {Error} |
|
checkDate( value: ) |
Returns Checks if the passed in value is a Date object. @throws {Error} |
|
checkNumber( value: ) |
Returns Checks if the passed in value is a number. @throws {Error} |
|
checkObject( value: ) |
Returns Checks if the passed in value is an object. @throws {Error} |
|
checkString( value: ) |
Returns Checks if the passed in value is a string. @throws {Error} |
|
getDefault( value: ) |
Returns Returns a default value if the passed in value is empty. @deprecated Not used anywhere |
|
getType( value: ) |
Returns Returns a type of the value. |
|
getValue( a: ) |
Returns Returns a value or throws an {Error} exception if the variable has not value. |
|
getValueDefault( a: ) |
Returns Returns a value, or returns the default value if it doesn't have a value. |
|
hasValue( a: ) |
Returns Checks if a variable has a value. |
|
isArray( value: ) |
Returns Checks if parameter is |
|
isDate( value: ) |
Returns Checks if parameter is |
|
isNaN( value: ) |
Returns Returns @deprecated Is not used anywhere. JS built-in isNaN is used everywhere. Maybe we don't need this, or if we do, then we should use it everywhere |
|
isNumber( value: ) |
Returns Checks if parameter is |
|
isObject( value: ) |
Returns Checks if parameter is |
|
isString( value: ) |
Returns Checks if parameter is |
|
toBoolean( value: ) |
Returns Converts any value into |
|
toNumber( value: ) |
Returns Converts any value into a |
|
toNumberOrPercent( value: ) |
Returns Converts any value to a number or If the parameter is a string and contains "%", it will convert it into a Otherwise, it will convert into a number. |
|
toText( value: ) |
Returns Converts any value into a string (text). |