warpo 3.2.2 → 3.4.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1755,6 +1755,26 @@ interface ArrayLike<T> {
1755
1755
  length: i32;
1756
1756
  }
1757
1757
 
1758
+ interface ReadonlyArray<T> extends Iterable<T> {
1759
+ [key: number]: T;
1760
+ readonly length: i32;
1761
+ at(index: i32): T;
1762
+ findIndex(callbackfn: (value: T, index: i32, array: ReadonlyArray<T>) => bool): i32;
1763
+ findLastIndex(callbackfn: (value: T, index: i32, array: ReadonlyArray<T>) => bool): i32;
1764
+ includes(searchElement: T, fromIndex?: i32): bool;
1765
+ indexOf(searchElement: T, fromIndex?: i32): i32;
1766
+ lastIndexOf(searchElement: T, fromIndex?: i32): i32;
1767
+ forEach(callbackfn: (value: T, index: i32, array: ReadonlyArray<T>) => void): void;
1768
+ filter(callbackfn: (value: T, index: i32, array: ReadonlyArray<T>) => bool): Array<T>;
1769
+ every(callbackfn: (value: T, index: i32, array: ReadonlyArray<T>) => bool): bool;
1770
+ some(callbackfn: (value: T, index: i32, array: ReadonlyArray<T>) => bool): bool;
1771
+ concat(other: Array<T>): Array<T>;
1772
+ slice(from?: i32, to?: i32): Array<T>;
1773
+ join(separator?: string): string;
1774
+ flat(): T;
1775
+ toString(): string;
1776
+ }
1777
+
1758
1778
  /** Interface for a typed view on an array buffer. */
1759
1779
  interface ArrayBufferView {
1760
1780
  /** The {@link ArrayBuffer} referenced by this view. */
@@ -1890,7 +1910,7 @@ declare class Float64Array extends TypedArray<f64> {
1890
1910
  }
1891
1911
 
1892
1912
  /** Class representing a sequence of values of type `T`. */
1893
- declare class Array<T> {
1913
+ declare class Array<T> implements ReadonlyArray<T> {
1894
1914
  /** Tests if a value is an array. */
1895
1915
  static isArray<U>(value: any): value is Array<any>;
1896
1916
 
@@ -2057,8 +2077,26 @@ declare namespace String {
2057
2077
  }
2058
2078
  }
2059
2079
 
2060
- declare class TemplateStringsArray extends Array<string> {
2061
- readonly raw: string[];
2080
+ declare class TemplateStringsArray implements ReadonlyArray<string> {
2081
+ [key: number]: string;
2082
+ readonly raw: ReadonlyArray<string>;
2083
+ readonly length: i32;
2084
+ [Symbol.iterator](): Iterator<string>;
2085
+ at(index: i32): string;
2086
+ findIndex(callbackfn: (value: string, index: i32, array: ReadonlyArray<string>) => bool): i32;
2087
+ findLastIndex(callbackfn: (value: string, index: i32, array: ReadonlyArray<string>) => bool): i32;
2088
+ includes(searchElement: string, fromIndex?: i32): bool;
2089
+ indexOf(searchElement: string, fromIndex?: i32): i32;
2090
+ lastIndexOf(searchElement: string, fromIndex?: i32): i32;
2091
+ forEach(callbackfn: (value: string, index: i32, array: ReadonlyArray<string>) => void): void;
2092
+ filter(callbackfn: (value: string, index: i32, array: ReadonlyArray<string>) => bool): Array<string>;
2093
+ every(callbackfn: (value: string, index: i32, array: ReadonlyArray<string>) => bool): bool;
2094
+ some(callbackfn: (value: string, index: i32, array: ReadonlyArray<string>) => bool): bool;
2095
+ concat(other: Array<string>): Array<string>;
2096
+ slice(from?: i32, to?: i32): Array<string>;
2097
+ join(separator?: string): string;
2098
+ flat(): string;
2099
+ toString(): string;
2062
2100
  }
2063
2101
 
2064
2102
  declare class Object {
@@ -8,6 +8,10 @@ declare module "warpo/ffi" {
8
8
  }
9
9
  }
10
10
 
11
+ declare module "warpo/memory" {
12
+ function memory_expose<T>(): void;
13
+ }
14
+
11
15
  declare module "rt/index" {
12
16
  // allocate new object with size and rtid
13
17
  function __new(size: usize, id: u32): usize;
@@ -0,0 +1,6 @@
1
+ // Copyright (C) 2026 wasm-ecosystem
2
+ // SPDX-License-Identifier: Apache-2.0
3
+
4
+ // @ts-ignore: decorator
5
+ @builtin
6
+ export declare function memory_expose<T>(): void;