Fun fact: Can even implement parseInt/I32/I64 using generics, see #19

This commit is contained in:
dcodeIO
2018-01-30 06:05:35 +01:00
parent ab5a938ea0
commit 3924aa96ae
12 changed files with 95 additions and 248 deletions

2
std/assembly.d.ts vendored
View File

@ -193,6 +193,8 @@ declare function isFinite<T = f32 | f64>(value: T): bool;
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. */
declare function parseInt(str: string, radix?: i32): f64;
/** Parses an integer string to a 32-bit integer. */
declare function parseI32(str: string, radix?: i32): i32;
/** Parses an integer string to a 64-bit integer. */
declare function parseI64(str: string, radix?: i32): i64;
/** Parses a string to a 64-bit float. */