mirror of
https://github.com/fluencelabs/assemblyscript
synced 2025-07-02 16:11:49 +00:00
Initial compile time type check builtins
This commit is contained in:
14
std/portable.d.ts
vendored
14
std/portable.d.ts
vendored
@ -136,6 +136,20 @@ declare function bswap16<T = i16 | u16 | i32 | u32>(value: T): T;
|
||||
|
||||
/** Changes the type of any value of `usize` kind to another one of `usize` kind. Useful for casting class instances to their pointer values and vice-versa. Beware that this is unsafe.*/
|
||||
declare function changetype<T>(value: any): T;
|
||||
/** Tests if a 32-bit or 64-bit float is `NaN`. */
|
||||
declare function isNaN<T = f32 | f64>(value: T): bool;
|
||||
/** Tests if a 32-bit or 64-bit float is finite, that is not `NaN` or +/-`Infinity`. */
|
||||
declare function isFinite<T = f32 | f64>(value: T): bool;
|
||||
/** Tests if the specified value is a valid integer. Can't distinguish an integer from an integral float. */
|
||||
declare function isInteger(value: any): bool;
|
||||
/** Tests if the specified value is a valid float. Can't distinguish a float from an integer. */
|
||||
declare function isFloat(value: any): bool;
|
||||
/** Tests if the specified value is of a reference type. */
|
||||
declare function isReference(value: any): bool;
|
||||
/** Tests if the specified value can be used as a string. */
|
||||
declare function isString(value: any): bool;
|
||||
/** Tests if the specified value can be used as an array. */
|
||||
declare function isArray(value: any): bool;
|
||||
/** Traps if the specified value is not true-ish, otherwise returns the value. */
|
||||
declare function assert<T>(isTrueish: T | null, message?: string): T;
|
||||
/** Parses an integer string to a 64-bit float. */
|
||||
|
Reference in New Issue
Block a user