@@ -310,6 +310,8 @@ declare namespace i32 {
310
310
export const MIN_VALUE : i32 ;
311
311
/** Largest representable value. */
312
312
export const MAX_VALUE : i32 ;
313
+ /** Converts a string to an i32 of this type. */
314
+ export function parse ( value : string , radix ?: i32 ) : i32 ;
313
315
/** Loads an 8-bit signed integer value from memory and returns it as a 32-bit integer. */
314
316
export function load8_s ( ptr : usize , immOffset ?: usize , immAlign ?: usize ) : i32 ;
315
317
/** Loads an 8-bit unsigned integer value from memory and returns it as a 32-bit integer. */
@@ -433,6 +435,8 @@ declare namespace i64 {
433
435
export const MIN_VALUE : i64 ;
434
436
/** Largest representable value. */
435
437
export const MAX_VALUE : i64 ;
438
+ /** Converts a string to an i64 of this type. */
439
+ export function parse ( value : string , radix ?: i32 ) : i64 ;
436
440
/** Loads an 8-bit signed integer value from memory and returns it as a 64-bit integer. */
437
441
export function load8_s ( ptr : usize , immOffset ?: usize , immAlign ?: usize ) : i64 ;
438
442
/** Loads an 8-bit unsigned integer value from memory and returns it as a 64-bit integer. */
@@ -585,6 +589,8 @@ declare namespace u8 {
585
589
export const MIN_VALUE : u8 ;
586
590
/** Largest representable value. */
587
591
export const MAX_VALUE : u8 ;
592
+ /** Converts a string to an u8 of this type. */
593
+ export function parse ( value : string , radix ?: i32 ) : u8 ;
588
594
}
589
595
/** Converts any other numeric value to a 16-bit unsigned integer. */
590
596
declare function u16 ( value : any ) : u16 ;
@@ -593,6 +599,8 @@ declare namespace u16 {
593
599
export const MIN_VALUE : u16 ;
594
600
/** Largest representable value. */
595
601
export const MAX_VALUE : u16 ;
602
+ /** Converts a string to an u16 of this type. */
603
+ export function parse ( value : string , radix ?: i32 ) : u16 ;
596
604
}
597
605
/** Converts any other numeric value to a 32-bit unsigned integer. */
598
606
declare function u32 ( value : any ) : u32 ;
@@ -601,6 +609,8 @@ declare namespace u32 {
601
609
export const MIN_VALUE : u32 ;
602
610
/** Largest representable value. */
603
611
export const MAX_VALUE : u32 ;
612
+ /** Converts a string to an u32 of this type. */
613
+ export function parse ( value : string , radix ?: i32 ) : u32 ;
604
614
}
605
615
/** Converts any other numeric value to a 64-bit unsigned integer. */
606
616
declare function u64 ( value : any ) : u64 ;
@@ -609,6 +619,8 @@ declare namespace u64 {
609
619
export const MIN_VALUE : u64 ;
610
620
/** Largest representable value. */
611
621
export const MAX_VALUE : u64 ;
622
+ /** Converts a string to an u64 of this type. */
623
+ export function parse ( value : string , radix ?: i32 ) : u64 ;
612
624
}
613
625
/** Converts any other numeric value to a 32-bit (in WASM32) respectivel 64-bit (in WASM64) unsigned integer. */
614
626
declare var usize : typeof u32 | typeof u64 ;
@@ -619,6 +631,8 @@ declare namespace bool {
619
631
export const MIN_VALUE : bool ;
620
632
/** Largest representable value. */
621
633
export const MAX_VALUE : bool ;
634
+ /** Converts a string to an bool of this type. */
635
+ export function parse ( value : string ) : bool ;
622
636
}
623
637
/** Converts any other numeric value to a 32-bit float. */
624
638
declare function f32 ( value : any ) : f32 ;
@@ -641,6 +655,8 @@ declare namespace f32 {
641
655
export const NaN : f32 ;
642
656
/** Difference between 1 and the smallest representable value greater than 1. */
643
657
export const EPSILON : f32 ;
658
+ /** Converts a string to an f32 of this type. */
659
+ export function parse ( value : string , radix ?: i32 ) : f32 ;
644
660
/** Loads a 32-bit float from memory. */
645
661
export function load ( ptr : usize , immOffset ?: usize , immAlign ?: usize ) : f32 ;
646
662
/** Stores a 32-bit float to memory. */
@@ -699,6 +715,8 @@ declare namespace f64 {
699
715
export const NaN : f64 ;
700
716
/** Difference between 1 and the smallest representable value greater than 1. */
701
717
export const EPSILON : f64 ;
718
+ /** Converts a string to an f64 of this type. */
719
+ export function parse ( value : string , radix ?: i32 ) : f64 ;
702
720
/** Loads a 64-bit float from memory. */
703
721
export function load ( ptr : usize , immOffset ?: usize , immAlign ?: usize ) : f64 ;
704
722
/** Stores a 64-bit float to memory. */
@@ -1390,7 +1408,7 @@ declare class _Integer {
1390
1408
static readonly MIN_VALUE : number ;
1391
1409
/** Largest representable value. */
1392
1410
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 . */
1394
1412
static parseInt ( value : string , radix ?: number ) : number ;
1395
1413
/** Converts this integer to a string. */
1396
1414
toString ( radix ?: number ) : string ;
@@ -1423,9 +1441,9 @@ declare class _Float {
1423
1441
static isSafeInteger ( value : f32 | f64 ) : bool ;
1424
1442
/** Returns true if the value passed is an integer, false otherwise. */
1425
1443
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 . */
1427
1445
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 . */
1429
1447
static parseFloat ( value : string ) : f32 | f64 ;
1430
1448
/** Converts this floating-point number to a string. */
1431
1449
toString ( radix ?: number ) : string ;
0 commit comments