@@ -156,6 +156,10 @@ declare namespace i8 {
156156 export const MIN_VALUE : i8 ;
157157 /** Largest representable value. */
158158 export const MAX_VALUE : i8 ;
159+ /** Converts a string to a floating-point number and cast to target integer after. */
160+ export function parseFloat ( string : string ) : i8 ;
161+ /** Converts A string to an integer. */
162+ export function parseInt ( string : string , radix ?: i32 ) : i8 ;
159163}
160164/** Converts any other numeric value to a 16-bit signed integer. */
161165declare function i16 ( value : i8 | i16 | i32 | i64 | isize | u8 | u16 | u32 | u64 | usize | bool | f32 | f64 ) : i8 ;
@@ -164,6 +168,10 @@ declare namespace i16 {
164168 export const MIN_VALUE : i16 ;
165169 /** Largest representable value. */
166170 export const MAX_VALUE : i16 ;
171+ /** Converts a string to a floating-point number and cast to target integer after. */
172+ export function parseFloat ( string : string ) : i16 ;
173+ /** Converts A string to an integer. */
174+ export function parseInt ( string : string , radix ?: i32 ) : i16 ;
167175}
168176/** Converts any other numeric value to a 32-bit signed integer. */
169177declare function i32 ( value : i8 | i16 | i32 | i64 | isize | u8 | u16 | u32 | u64 | usize | bool | f32 | f64 ) : i32 ;
@@ -188,6 +196,10 @@ declare namespace i32 {
188196 export function store16 ( offset : usize , value : i32 , constantOffset ?: usize ) : void ;
189197 /** Stores a 32-bit integer to memory. */
190198 export function store ( offset : usize , value : i32 , constantOffset ?: usize ) : void ;
199+ /** Converts a string to a floating-point number and cast to target integer after. */
200+ export function parseFloat ( string : string ) : i32 ;
201+ /** Converts A string to an integer. */
202+ export function parseInt ( string : string , radix ?: i32 ) : i32 ;
191203}
192204/** Converts any other numeric value to a 64-bit signed integer. */
193205declare function i64 ( value : i8 | i16 | i32 | i64 | isize | u8 | u16 | u32 | u64 | usize | bool | f32 | f64 ) : i64 ;
@@ -218,6 +230,10 @@ declare namespace i64 {
218230 export function store32 ( offset : usize , value : i64 , constantOffset ?: usize ) : void ;
219231 /** Stores a 64-bit integer to memory. */
220232 export function store ( offset : usize , value : i64 , constantOffset ?: usize ) : void ;
233+ /** Converts a string to a floating-point number and cast to target integer after. */
234+ export function parseFloat ( string : string ) : i64 ;
235+ /** Converts A string to an integer. */
236+ export function parseInt ( string : string , radix ?: i32 ) : i64 ;
221237}
222238/** Converts any other numeric value to a 32-bit (in WASM32) respectivel 64-bit (in WASM64) signed integer. */
223239declare var isize : i32 | i64 ;
@@ -228,6 +244,10 @@ declare namespace u8 {
228244 export const MIN_VALUE : u8 ;
229245 /** Largest representable value. */
230246 export const MAX_VALUE : u8 ;
247+ /** Converts a string to a floating-point number and cast to target integer after. */
248+ export function parseFloat ( string : string ) : u8 ;
249+ /** Converts A string to an integer. */
250+ export function parseInt ( string : string , radix ?: i32 ) : u8 ;
231251}
232252/** Converts any other numeric value to a 16-bit unsigned integer. */
233253declare function u16 ( value : i8 | i16 | i32 | i64 | isize | u8 | u16 | u32 | u64 | usize | bool | f32 | f64 ) : i8 ;
@@ -236,6 +256,10 @@ declare namespace u16 {
236256 export const MIN_VALUE : u16 ;
237257 /** Largest representable value. */
238258 export const MAX_VALUE : u16 ;
259+ /** Converts a string to a floating-point number and cast to target integer after. */
260+ export function parseFloat ( string : string ) : u16 ;
261+ /** Converts A string to an integer. */
262+ export function parseInt ( string : string , radix ?: i32 ) : u16 ;
239263}
240264/** Converts any other numeric value to a 32-bit unsigned integer. */
241265declare function u32 ( value : i8 | i16 | i32 | i64 | isize | u8 | u16 | u32 | u64 | usize | bool | f32 | f64 ) : i32 ;
@@ -244,6 +268,10 @@ declare namespace u32 {
244268 export const MIN_VALUE : u32 ;
245269 /** Largest representable value. */
246270 export const MAX_VALUE : u32 ;
271+ /** Converts a string to a floating-point number and cast to target integer after. */
272+ export function parseFloat ( string : string ) : u64 ;
273+ /** Converts A string to an integer. */
274+ export function parseInt ( string : string , radix ?: i32 ) : u64 ;
247275}
248276/** Converts any other numeric value to a 64-bit unsigned integer. */
249277declare function u64 ( value : i8 | i16 | i32 | i64 | isize | u8 | u16 | u32 | u64 | usize | bool | f32 | f64 ) : i64 ;
@@ -252,6 +280,10 @@ declare namespace u64 {
252280 export const MIN_VALUE : u64 ;
253281 /** Largest representable value. */
254282 export const MAX_VALUE : u64 ;
283+ /** Converts a string to a floating-point number. */
284+ export function parseFloat ( string : string ) : u64 ;
285+ /** Converts A string to an integer. */
286+ export function parseInt ( string : string , radix ?: i32 ) : u64 ;
255287}
256288/** Converts any other numeric value to a 32-bit (in WASM32) respectivel 64-bit (in WASM64) unsigned integer. */
257289declare var usize : u32 | u64 ;
@@ -286,6 +318,18 @@ declare namespace f32 {
286318 export function load ( offset : usize , constantOffset ?: usize ) : f32 ;
287319 /** Stores a 32-bit float to memory. */
288320 export function store ( offset : usize , value : f32 , constantOffset ?: usize ) : void ;
321+ /** Returns a boolean value that indicates whether a value is the reserved value NaN (not a number). */
322+ export function isNaN ( value : f32 ) : bool ;
323+ /** Returns true if passed value is finite. */
324+ export function isFinite ( value : f32 ) : bool ;
325+ /** Returns true if the value passed is a safe integer. */
326+ export function isSafeInteger ( value : f32 ) : bool ;
327+ /** Returns true if the value passed is an integer, false otherwise. */
328+ export function isInteger ( value : f32 ) : bool ;
329+ /** Converts a string to a floating-point number. */
330+ export function parseFloat ( string : string ) : f32 ;
331+ /** Converts A string to an integer. */
332+ export function parseInt ( string : string , radix ?: i32 ) : f32 ;
289333}
290334/** Converts any other numeric value to a 64-bit float. */
291335declare function f64 ( value : i8 | i16 | i32 | i64 | isize | u8 | u16 | u32 | u64 | usize | bool | f32 | f64 ) : f64 ;
@@ -306,6 +350,18 @@ declare namespace f64 {
306350 export function load ( offset : usize , constantOffset ?: usize ) : f64 ;
307351 /** Stores a 64-bit float to memory. */
308352 export function store ( offset : usize , value : f64 , constantOffset ?: usize ) : void ;
353+ /** Returns a boolean value that indicates whether a value is the reserved value NaN (not a number). */
354+ export function isNaN ( value : f32 ) : bool ;
355+ /** Returns true if passed value is finite. */
356+ export function isFinite ( value : f32 ) : bool ;
357+ /** Returns true if the value passed is a safe integer. */
358+ export function isSafeInteger ( value : f64 ) : bool ;
359+ /** Returns true if the value passed is an integer, false otherwise. */
360+ export function isInteger ( value : f64 ) : bool ;
361+ /** Converts a string to a floating-point number. */
362+ export function parseFloat ( string : string ) : f64 ;
363+ /** Converts A string to an integer. */
364+ export function parseInt ( string : string , radix ?: i32 ) : f64 ;
309365}
310366
311367// User-defined diagnostic macros
0 commit comments