Initial compile time type check builtins

This commit is contained in:
dcodeIO
2018-03-17 12:54:37 +01:00
parent faac3c31eb
commit 2ed9fac171
15 changed files with 1158 additions and 657 deletions

10
std/assembly.d.ts vendored
View File

@ -194,6 +194,16 @@ declare function changetype<T>(value: any): T;
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 expression is of an integer type and not a reference. Compiles to a constant. */
declare function isInteger(value: any): bool;
/** Tests if the specified expression is of a float type. Compiles to a constant. */
declare function isFloat(value: any): bool;
/** Tests if the specified expression is of a reference type. Compiles to a constant. */
declare function isReference(value: any): bool;
/** Tests if the specified expression can be used ass a string. Compiles to a constant. */
declare function isString(value: any): bool;
/** Tests if the specified expression can be used as an array. Compiles to a constant. */
declare function isArray(value: any): bool;
/** Traps if the specified value is not true-ish, otherwise returns the (non-nullable) value. */
declare function assert<T>(isTrueish: T, message?: string): T & object; // any better way to model `: T != null`?
/** Parses an integer string to a 64-bit float. */