2018-07-19 02:10:04 +02:00
|
|
|
/* tslint:disable */
|
|
|
|
|
|
|
|
@builtin @inline export const NaN: f64 = 0 / 0;
|
|
|
|
@builtin @inline export const Infinity: f64 = 1 / 0;
|
|
|
|
|
|
|
|
@builtin export declare function isInteger<T>(value?: T): bool;
|
|
|
|
@builtin export declare function isFloat<T>(value?: T): bool;
|
|
|
|
@builtin export declare function isSigned<T>(value?: T): bool;
|
|
|
|
@builtin export declare function isReference<T>(value?: T): bool;
|
|
|
|
@builtin export declare function isString<T>(value?: T): bool;
|
|
|
|
@builtin export declare function isArray<T>(value?: T): bool;
|
|
|
|
@builtin export declare function isDefined(expression: void): bool;
|
|
|
|
@builtin export declare function isConstant(expression: void): bool;
|
2018-08-02 18:23:02 +02:00
|
|
|
@builtin export declare function isManaged<T>(value?: T): bool;
|
2018-07-19 04:12:40 +02:00
|
|
|
@inline export function isNaN<T>(value: T): bool { return value != value; }
|
|
|
|
@inline export function isFinite<T>(value: T): bool { return value - value == 0; }
|
2018-02-09 02:31:48 +01:00
|
|
|
|
2018-07-19 02:10:04 +02:00
|
|
|
@builtin export declare function clz<T>(value: T): T;
|
|
|
|
@builtin export declare function ctz<T>(value: T): T;
|
|
|
|
@builtin export declare function popcnt<T>(value: T): T;
|
|
|
|
@builtin export declare function rotl<T>(value: T, shift: T): T;
|
|
|
|
@builtin export declare function rotr<T>(value: T, shift: T): T;
|
|
|
|
@builtin export declare function abs<T>(value: T): T;
|
|
|
|
@builtin export declare function max<T>(left: T, right: T): T;
|
|
|
|
@builtin export declare function min<T>(left: T, right: T): T;
|
|
|
|
@builtin export declare function ceil<T>(value: T): T;
|
|
|
|
@builtin export declare function floor<T>(value: T): T;
|
|
|
|
@builtin export declare function copysign<T>(left: T, right: T): T;
|
|
|
|
@builtin export declare function nearest<T>(value: T): T;
|
|
|
|
@builtin export declare function reinterpret<T>(value: void): T;
|
|
|
|
@builtin export declare function sqrt<T>(value: T): T;
|
|
|
|
@builtin export declare function trunc<T>(value: T): T;
|
|
|
|
@builtin export declare function load<T>(offset: usize, constantOffset?: usize): T;
|
|
|
|
@builtin export declare function store<T>(offset: usize, value: void, constantOffset?: usize): void;
|
|
|
|
@builtin export declare function sizeof<T>(): usize; // | u32 / u64
|
|
|
|
@builtin export declare function alignof<T>(): usize; // | u32 / u64
|
|
|
|
@builtin export declare function offsetof<T>(fieldName?: string): usize; // | u32 / u64
|
|
|
|
@builtin export declare function select<T>(ifTrue: T, ifFalse: T, condition: bool): T;
|
|
|
|
@builtin export declare function unreachable(): void;
|
|
|
|
@builtin export declare function changetype<T>(value: void): T;
|
|
|
|
@builtin export declare function assert<T>(isTrueish: T, message?: string): T;
|
|
|
|
@builtin export declare function unchecked<T>(expr: T): T;
|
|
|
|
@builtin export declare function call_indirect<T>(target: void, ...args: void[]): T;
|
|
|
|
|
|
|
|
@builtin export declare function i8(value: void): i8;
|
2018-03-21 16:29:08 +01:00
|
|
|
export namespace i8 {
|
2018-02-09 02:31:48 +01:00
|
|
|
export const MIN_VALUE: i8 = -128;
|
2018-03-30 17:25:54 +02:00
|
|
|
export const MAX_VALUE: i8 = 127;
|
2018-11-12 08:42:28 +02:00
|
|
|
@inline export function parseInt(value: string, radix: i32 = 0): i8 { return <i8>parseI32(value, radix) }
|
|
|
|
@inline export function parseFloat(value: string): i8 { return <i8>parseFloat(value) }
|
2018-02-09 02:31:48 +01:00
|
|
|
}
|
|
|
|
|
2018-07-19 02:10:04 +02:00
|
|
|
@builtin export declare function i16(value: void): i16;
|
2018-03-21 16:29:08 +01:00
|
|
|
export namespace i16 {
|
2018-02-09 02:31:48 +01:00
|
|
|
export const MIN_VALUE: i16 = -32768;
|
2018-03-30 17:25:54 +02:00
|
|
|
export const MAX_VALUE: i16 = 32767;
|
2018-11-12 08:42:28 +02:00
|
|
|
@inline export function parseInt(value: string, radix: i32 = 0): i16 { return <i16>parseI32(value, radix) }
|
|
|
|
@inline export function parseFloat(value: string): i16 { return <i16>parseFloat(value) }
|
2018-02-09 02:31:48 +01:00
|
|
|
}
|
|
|
|
|
2018-07-19 02:10:04 +02:00
|
|
|
@builtin export declare function i32(value: void): i32;
|
2018-03-21 16:29:08 +01:00
|
|
|
export namespace i32 {
|
2018-02-09 02:31:48 +01:00
|
|
|
export const MIN_VALUE: i32 = -2147483648;
|
2018-03-30 17:25:54 +02:00
|
|
|
export const MAX_VALUE: i32 = 2147483647;
|
2018-07-19 02:10:04 +02:00
|
|
|
@builtin export declare function clz(value: i32): i32;
|
|
|
|
@builtin export declare function ctz(value: i32): i32;
|
|
|
|
@builtin export declare function popcnt(value: i32): i32;
|
|
|
|
@builtin export declare function rotl(value: i32, shift: i32): i32;
|
|
|
|
@builtin export declare function rotr(value: i32, shift: i32): i32;
|
|
|
|
@builtin export declare function reinterpret_f32(value: f32): i32;
|
|
|
|
@builtin export declare function load8_s(offset: usize, constantOffset?: usize): i32;
|
|
|
|
@builtin export declare function load8_u(offset: usize, constantOffset?: usize): i32;
|
|
|
|
@builtin export declare function load16_s(offset: usize, constantOffset?: usize): i32;
|
|
|
|
@builtin export declare function load16_u(offset: usize, constantOffset?: usize): i32;
|
|
|
|
@builtin export declare function load(offset: usize, constantOffset?: usize): i32;
|
|
|
|
@builtin export declare function store8(offset: usize, value: i32, constantOffset?: usize): void;
|
|
|
|
@builtin export declare function store16(offset: usize, value: i32, constantOffset?: usize): void;
|
|
|
|
@builtin export declare function store(offset: usize, value: i32, constantOffset?: usize): void;
|
2018-11-12 08:42:28 +02:00
|
|
|
@inline export function parseInt(value: string, radix: i32 = 0): i32 { return <i32>parseI32(value, radix) }
|
|
|
|
@inline export function parseFloat(value: string): i32 { return <i32>parseFloat(value) }
|
2018-02-09 02:31:48 +01:00
|
|
|
}
|
|
|
|
|
2018-07-19 02:10:04 +02:00
|
|
|
@builtin export declare function i64(value: void): i64;
|
2018-03-21 16:29:08 +01:00
|
|
|
export namespace i64 {
|
2018-02-09 02:31:48 +01:00
|
|
|
export const MIN_VALUE: i64 = -9223372036854775808;
|
2018-03-30 17:25:54 +02:00
|
|
|
export const MAX_VALUE: i64 = 9223372036854775807;
|
2018-07-19 02:10:04 +02:00
|
|
|
@builtin export declare function clz(value: i64): i64;
|
|
|
|
@builtin export declare function ctz(value: i64): i64;
|
|
|
|
@builtin export declare function load8_s(offset: usize, constantOffset?: usize): i64;
|
|
|
|
@builtin export declare function load8_u(offset: usize, constantOffset?: usize): u64;
|
|
|
|
@builtin export declare function load16_s(offset: usize, constantOffset?: usize): i64;
|
|
|
|
@builtin export declare function load16_u(offset: usize, constantOffset?: usize): u64;
|
|
|
|
@builtin export declare function load32_s(offset: usize, constantOffset?: usize): i64;
|
|
|
|
@builtin export declare function load32_u(offset: usize, constantOffset?: usize): u64;
|
|
|
|
@builtin export declare function load(offset: usize, constantOffset?: usize): i64;
|
|
|
|
@builtin export declare function popcnt(value: i64): i64;
|
|
|
|
@builtin export declare function rotl(value: i64, shift: i64): i64;
|
|
|
|
@builtin export declare function rotr(value: i64, shift: i64): i64;
|
|
|
|
@builtin export declare function reinterpret_f64(value: f64): i64;
|
|
|
|
@builtin export declare function store8(offset: usize, value: i64, constantOffset?: usize): void;
|
|
|
|
@builtin export declare function store16(offset: usize, value: i64, constantOffset?: usize): void;
|
|
|
|
@builtin export declare function store32(offset: usize, value: i64, constantOffset?: usize): void;
|
|
|
|
@builtin export declare function store(offset: usize, value: i64, constantOffset?: usize): void;
|
2018-11-12 08:42:28 +02:00
|
|
|
@inline export function parseInt(value: string, radix: i32 = 0): i64 { return <i64>parseI64(value, radix) }
|
|
|
|
@inline export function parseFloat(value: string): i64 { return <i64>parseFloat(value) }
|
2018-02-09 02:31:48 +01:00
|
|
|
}
|
|
|
|
|
2018-07-19 02:10:04 +02:00
|
|
|
@builtin export declare function isize(value: void): isize;
|
2018-03-21 16:29:08 +01:00
|
|
|
export namespace isize {
|
2018-02-25 23:21:32 +01:00
|
|
|
export const MIN_VALUE: isize = sizeof<i32>() == sizeof<isize>()
|
|
|
|
? -2147483648
|
2018-02-28 01:48:01 +01:00
|
|
|
: <isize>-9223372036854775808;
|
2018-02-25 23:21:32 +01:00
|
|
|
export const MAX_VALUE: isize = sizeof<i32>() == sizeof<isize>()
|
|
|
|
? 2147483647
|
2018-02-28 01:48:01 +01:00
|
|
|
: <isize>9223372036854775807;
|
2018-11-12 08:42:28 +02:00
|
|
|
@inline export function parseInt(value: string, radix: i32 = 0): isize { return <isize>parseI64(value, radix) }
|
|
|
|
@inline export function parseFloat(value: string): isize { return <isize>parseFloat(value) }
|
2018-02-09 02:31:48 +01:00
|
|
|
}
|
|
|
|
|
2018-07-19 02:10:04 +02:00
|
|
|
@builtin export declare function u8(value: void): u8;
|
2018-03-21 16:29:08 +01:00
|
|
|
export namespace u8 {
|
2018-02-09 02:31:48 +01:00
|
|
|
export const MIN_VALUE: u8 = 0;
|
|
|
|
export const MAX_VALUE: u8 = 255;
|
2018-11-12 08:42:28 +02:00
|
|
|
@inline export function parseInt(value: string, radix: i32 = 0): u8 { return <u8>parseI32(value, radix) }
|
|
|
|
@inline export function parseFloat(value: string): u8 { return <u8>parseFloat(value) }
|
2018-02-09 02:31:48 +01:00
|
|
|
}
|
|
|
|
|
2018-07-19 02:10:04 +02:00
|
|
|
@builtin export declare function u16(value: void): u16;
|
2018-03-21 16:29:08 +01:00
|
|
|
export namespace u16 {
|
2018-02-09 02:31:48 +01:00
|
|
|
export const MIN_VALUE: u16 = 0;
|
|
|
|
export const MAX_VALUE: u16 = 65535;
|
2018-11-12 08:42:28 +02:00
|
|
|
@inline export function parseInt(value: string, radix: i32 = 0): u16 { return <u16>parseI32(value, radix) }
|
|
|
|
@inline export function parseFloat(value: string): u16 { return <u16>parseFloat(value) }
|
2018-02-09 02:31:48 +01:00
|
|
|
}
|
|
|
|
|
2018-07-19 02:10:04 +02:00
|
|
|
@builtin export declare function u32(value: void): u32;
|
2018-03-21 16:29:08 +01:00
|
|
|
export namespace u32 {
|
2018-02-09 02:31:48 +01:00
|
|
|
export const MIN_VALUE: u32 = 0;
|
|
|
|
export const MAX_VALUE: u32 = 4294967295;
|
2018-11-12 08:42:28 +02:00
|
|
|
@inline export function parseInt(value: string, radix: i32 = 0): u32 { return <u32>parseI32(value, radix) }
|
|
|
|
@inline export function parseFloat(value: string): u32 { return <u32>parseFloat(value) }
|
2018-02-09 02:31:48 +01:00
|
|
|
}
|
|
|
|
|
2018-07-19 02:10:04 +02:00
|
|
|
@builtin export declare function u64(value: void): u64;
|
2018-03-21 16:29:08 +01:00
|
|
|
export namespace u64 {
|
2018-02-09 02:31:48 +01:00
|
|
|
export const MIN_VALUE: u64 = 0;
|
|
|
|
export const MAX_VALUE: u64 = 18446744073709551615;
|
2018-11-12 08:42:28 +02:00
|
|
|
@inline export function parseInt(value: string, radix: i32 = 0): u64 { return <u64>parseI64(value, radix) }
|
|
|
|
@inline export function parseFloat(value: string): u64 { return <u64>parseFloat(value) }
|
2018-02-09 02:31:48 +01:00
|
|
|
}
|
|
|
|
|
2018-07-19 02:10:04 +02:00
|
|
|
@builtin export declare function usize(value: void): usize;
|
2018-03-21 16:29:08 +01:00
|
|
|
export namespace usize {
|
2018-02-09 02:31:48 +01:00
|
|
|
export const MIN_VALUE: usize = 0;
|
2018-02-25 23:21:32 +01:00
|
|
|
export const MAX_VALUE: usize = sizeof<u32>() == sizeof<usize>()
|
|
|
|
? 4294967295
|
|
|
|
: <usize>18446744073709551615;
|
2018-11-12 08:42:28 +02:00
|
|
|
@inline export function parseInt(value: string, radix: i32 = 0): usize { return <usize>parseI64(value, radix) }
|
|
|
|
@inline export function parseFloat(value: string): usize { return <usize>parseFloat(value) }
|
2018-02-09 02:31:48 +01:00
|
|
|
}
|
|
|
|
|
2018-07-19 02:10:04 +02:00
|
|
|
@builtin export declare function bool(value: void): bool;
|
2018-03-21 16:29:08 +01:00
|
|
|
export namespace bool {
|
2018-03-01 19:42:07 +01:00
|
|
|
export const MIN_VALUE: bool = false;
|
|
|
|
export const MAX_VALUE: bool = true;
|
2018-02-09 02:31:48 +01:00
|
|
|
}
|
|
|
|
|
2018-07-19 02:10:04 +02:00
|
|
|
@builtin export declare function f32(value: void): f32;
|
2018-03-21 16:29:08 +01:00
|
|
|
export namespace f32 {
|
2018-10-01 23:54:00 +03:00
|
|
|
export const EPSILON = reinterpret<f32>(0x34000000); // 0x1p-23f
|
|
|
|
export const MIN_VALUE = reinterpret<f32>(0x00000001); // 0x0.000001p+0f
|
|
|
|
export const MAX_VALUE = reinterpret<f32>(0x7F7FFFFF); // 0x1.fffffep+127f
|
|
|
|
export const MIN_NORMAL_VALUE = reinterpret<f32>(0x00800000); // 0x1p-126f
|
2018-02-09 02:31:48 +01:00
|
|
|
export const MIN_SAFE_INTEGER: f32 = -16777215;
|
2018-03-30 17:25:54 +02:00
|
|
|
export const MAX_SAFE_INTEGER: f32 = 16777215;
|
2018-10-01 23:54:00 +03:00
|
|
|
export const POSITIVE_INFINITY: f32 = Infinity;
|
|
|
|
export const NEGATIVE_INFINITY: f32 = -Infinity;
|
|
|
|
export const NaN: f32 = NaN;
|
2018-07-19 02:10:04 +02:00
|
|
|
@builtin export declare function abs(value: f32): f32;
|
|
|
|
@builtin export declare function ceil(value: f32): f32;
|
|
|
|
@builtin export declare function copysign(x: f32, y: f32): f32;
|
|
|
|
@builtin export declare function floor(value: f32): f32;
|
|
|
|
@builtin export declare function load(offset: usize, constantOffset?: usize): f32;
|
|
|
|
@builtin export declare function max(left: f32, right: f32): f32;
|
|
|
|
@builtin export declare function min(left: f32, right: f32): f32;
|
|
|
|
@builtin export declare function nearest(value: f32): f32;
|
|
|
|
@builtin export declare function reinterpret_i32(value: i32): f32;
|
|
|
|
@builtin export declare function sqrt(value: f32): f32;
|
|
|
|
@builtin export declare function store(offset: usize, value: f32, constantOffset?: usize): void;
|
|
|
|
@builtin export declare function trunc(value: f32): f32;
|
2018-11-12 08:42:28 +02:00
|
|
|
@inline export function isNaN(value: f32): bool { return isNaN<f32>(value) }
|
|
|
|
@inline export function isFinite(value: f32): bool { return isFinite<f32>(value) }
|
|
|
|
@inline export function isSafeInteger(value: f32): bool { return abs<f32>(value) <= f32.MAX_SAFE_INTEGER && trunc<f32>(value) == value }
|
|
|
|
@inline export function isInteger(value: f32): bool { return isFinite<f32>(value) && trunc<f32>(value) == value }
|
|
|
|
@inline export function parseInt(value: string, radix: i32 = 0): f32 { return <f32>parseI64(value, radix) }
|
|
|
|
@inline export function parseFloat(value: string): f32 { return <f32>parseFloat(value) }
|
2018-02-09 02:31:48 +01:00
|
|
|
}
|
|
|
|
|
2018-07-19 02:10:04 +02:00
|
|
|
@builtin export declare function f64(value: void): f64;
|
2018-03-21 16:29:08 +01:00
|
|
|
export namespace f64 {
|
2018-10-01 23:54:00 +03:00
|
|
|
export const EPSILON = reinterpret<f64>(0x3CB0000000000000); // 0x1p-52
|
|
|
|
export const MIN_VALUE = reinterpret<f64>(0x0000000000000001); // 0x0.0000000000001p+0
|
|
|
|
export const MAX_VALUE = reinterpret<f64>(0x7FEFFFFFFFFFFFFF); // 0x1.fffffffffffffp+1023
|
|
|
|
export const MIN_NORMAL_VALUE = reinterpret<f64>(0x0010000000000000); // 0x1p-1022
|
2018-02-09 02:31:48 +01:00
|
|
|
export const MIN_SAFE_INTEGER: f64 = -9007199254740991;
|
2018-03-30 17:25:54 +02:00
|
|
|
export const MAX_SAFE_INTEGER: f64 = 9007199254740991;
|
2018-10-01 23:54:00 +03:00
|
|
|
export const POSITIVE_INFINITY: f64 = Infinity;
|
|
|
|
export const NEGATIVE_INFINITY: f64 = -Infinity;
|
|
|
|
export const NaN: f64 = NaN;
|
2018-07-19 02:10:04 +02:00
|
|
|
@builtin export declare function abs(value: f64): f64;
|
|
|
|
@builtin export declare function ceil(value: f64): f64;
|
|
|
|
@builtin export declare function copysign(x: f64, y: f64): f64;
|
|
|
|
@builtin export declare function floor(value: f64): f64;
|
|
|
|
@builtin export declare function load(offset: usize, constantOffset?: usize): f64;
|
|
|
|
@builtin export declare function max(left: f64, right: f64): f64;
|
|
|
|
@builtin export declare function min(left: f64, right: f64): f64;
|
|
|
|
@builtin export declare function nearest(value: f64): f64;
|
|
|
|
@builtin export declare function reinterpret_i64(value: i64): f64;
|
|
|
|
@builtin export declare function sqrt(value: f64): f64;
|
|
|
|
@builtin export declare function store(offset: usize, value: f64, constantOffset?: usize): void;
|
|
|
|
@builtin export declare function trunc(value: f64): f64;
|
2018-11-12 08:42:28 +02:00
|
|
|
@inline export function isNaN(value: f64): bool { return isNaN<f64>(value) }
|
|
|
|
@inline export function isFinite(value: f64): bool { return isFinite<f64>(value) }
|
|
|
|
@inline export function isSafeInteger(value: f64): bool { return abs<f64>(value) <= f64.MAX_SAFE_INTEGER && trunc<f64>(value) == value }
|
|
|
|
@inline export function isInteger(value: f64): bool { return isFinite<f64>(value) && trunc<f64>(value) == value }
|
|
|
|
@inline export function parseInt(value: string, radix: i32 = 0): f64 { return <f64>parseI64(value, radix) }
|
|
|
|
@inline export function parseFloat(value: string): f64 { return parseFloat(value) }
|
2018-02-09 02:31:48 +01:00
|
|
|
}
|
|
|
|
|
2018-07-19 02:10:04 +02:00
|
|
|
@builtin export declare function start(): void;
|