@@ -310,6 +310,8 @@ declare namespace i32 {
310310 export const MIN_VALUE : i32 ;
311311 /** Largest representable value. */
312312 export const MAX_VALUE : i32 ;
313+ /** Converts a string to an i32 of this type. */
314+ export function parse ( value : string , radix ?: i32 ) : i32 ;
313315 /** Loads an 8-bit signed integer value from memory and returns it as a 32-bit integer. */
314316 export function load8_s ( ptr : usize , immOffset ?: usize , immAlign ?: usize ) : i32 ;
315317 /** Loads an 8-bit unsigned integer value from memory and returns it as a 32-bit integer. */
@@ -433,6 +435,8 @@ declare namespace i64 {
433435 export const MIN_VALUE : i64 ;
434436 /** Largest representable value. */
435437 export const MAX_VALUE : i64 ;
438+ /** Converts a string to an i64 of this type. */
439+ export function parse ( value : string , radix ?: i32 ) : i64 ;
436440 /** Loads an 8-bit signed integer value from memory and returns it as a 64-bit integer. */
437441 export function load8_s ( ptr : usize , immOffset ?: usize , immAlign ?: usize ) : i64 ;
438442 /** Loads an 8-bit unsigned integer value from memory and returns it as a 64-bit integer. */
@@ -585,6 +589,8 @@ declare namespace u8 {
585589 export const MIN_VALUE : u8 ;
586590 /** Largest representable value. */
587591 export const MAX_VALUE : u8 ;
592+ /** Converts a string to an u8 of this type. */
593+ export function parse ( value : string , radix ?: i32 ) : u8 ;
588594}
589595/** Converts any other numeric value to a 16-bit unsigned integer. */
590596declare function u16 ( value : any ) : u16 ;
@@ -593,6 +599,8 @@ declare namespace u16 {
593599 export const MIN_VALUE : u16 ;
594600 /** Largest representable value. */
595601 export const MAX_VALUE : u16 ;
602+ /** Converts a string to an u16 of this type. */
603+ export function parse ( value : string , radix ?: i32 ) : u16 ;
596604}
597605/** Converts any other numeric value to a 32-bit unsigned integer. */
598606declare function u32 ( value : any ) : u32 ;
@@ -601,6 +609,8 @@ declare namespace u32 {
601609 export const MIN_VALUE : u32 ;
602610 /** Largest representable value. */
603611 export const MAX_VALUE : u32 ;
612+ /** Converts a string to an u32 of this type. */
613+ export function parse ( value : string , radix ?: i32 ) : u32 ;
604614}
605615/** Converts any other numeric value to a 64-bit unsigned integer. */
606616declare function u64 ( value : any ) : u64 ;
@@ -609,6 +619,8 @@ declare namespace u64 {
609619 export const MIN_VALUE : u64 ;
610620 /** Largest representable value. */
611621 export const MAX_VALUE : u64 ;
622+ /** Converts a string to an u64 of this type. */
623+ export function parse ( value : string , radix ?: i32 ) : u64 ;
612624}
613625/** Converts any other numeric value to a 32-bit (in WASM32) respectivel 64-bit (in WASM64) unsigned integer. */
614626declare var usize : typeof u32 | typeof u64 ;
@@ -619,6 +631,8 @@ declare namespace bool {
619631 export const MIN_VALUE : bool ;
620632 /** Largest representable value. */
621633 export const MAX_VALUE : bool ;
634+ /** Converts a string to an bool of this type. */
635+ export function parse ( value : string ) : bool ;
622636}
623637/** Converts any other numeric value to a 32-bit float. */
624638declare function f32 ( value : any ) : f32 ;
@@ -641,6 +655,8 @@ declare namespace f32 {
641655 export const NaN : f32 ;
642656 /** Difference between 1 and the smallest representable value greater than 1. */
643657 export const EPSILON : f32 ;
658+ /** Converts a string to an f32 of this type. */
659+ export function parse ( value : string , radix ?: i32 ) : f32 ;
644660 /** Loads a 32-bit float from memory. */
645661 export function load ( ptr : usize , immOffset ?: usize , immAlign ?: usize ) : f32 ;
646662 /** Stores a 32-bit float to memory. */
@@ -699,6 +715,8 @@ declare namespace f64 {
699715 export const NaN : f64 ;
700716 /** Difference between 1 and the smallest representable value greater than 1. */
701717 export const EPSILON : f64 ;
718+ /** Converts a string to an f64 of this type. */
719+ export function parse ( value : string , radix ?: i32 ) : f64 ;
702720 /** Loads a 64-bit float from memory. */
703721 export function load ( ptr : usize , immOffset ?: usize , immAlign ?: usize ) : f64 ;
704722 /** Stores a 64-bit float to memory. */
@@ -1390,7 +1408,7 @@ declare class _Integer {
13901408 static readonly MIN_VALUE : number ;
13911409 /** Largest representable value. */
13921410 static readonly MAX_VALUE : number ;
1393- /** Converts a string to an integer of this type. */
1411+ /** @deprecated Converts a string to an integer of this type. Please use "i32.parse" method . */
13941412 static parseInt ( value : string , radix ?: number ) : number ;
13951413 /** Converts this integer to a string. */
13961414 toString ( radix ?: number ) : string ;
@@ -1423,9 +1441,9 @@ declare class _Float {
14231441 static isSafeInteger ( value : f32 | f64 ) : bool ;
14241442 /** Returns true if the value passed is an integer, false otherwise. */
14251443 static isInteger ( value : f32 | f64 ) : bool ;
1426- /** Converts a string to an integer. */
1444+ /** @deprecated Converts a string to an integer. Please use "i32.parse" / "i64.parse" methods . */
14271445 static parseInt ( value : string , radix ?: i32 ) : f32 | f64 ;
1428- /** Converts a string to a floating-point number. */
1446+ /** @deprecated Converts a string to a floating-point number. Please use "f32.parse" / "f64.parse" methods . */
14291447 static parseFloat ( value : string ) : f32 | f64 ;
14301448 /** Converts this floating-point number to a string. */
14311449 toString ( radix ?: number ) : string ;
0 commit comments