|
| 1 | +interface ArrayBuffer { |
| 2 | + /** |
| 3 | + * Read-only. The maximum length that this ArrayBuffer can be resized to (in bytes). |
| 4 | + */ |
| 5 | + readonly maxByteLength: number; |
| 6 | + |
| 7 | + /** |
| 8 | + * Read-only. Whether this ArrayBuffer can be resized or not. |
| 9 | + */ |
| 10 | + readonly resizable: boolean; |
| 11 | + |
| 12 | + /** |
| 13 | + * Resizes the ArrayBuffer to the specified size (in bytes). |
| 14 | + * @param newLength The new length, in bytes, to resize the ArrayBuffer to. |
| 15 | + */ |
| 16 | + resize(newLength: number): undefined; |
| 17 | +} |
| 18 | + |
| 19 | +/** |
| 20 | + * ArrayBuffer constructor options |
| 21 | + */ |
| 22 | +interface ArrayBufferOptions { |
| 23 | + maxByteLength?: number; |
| 24 | +} |
| 25 | + |
| 26 | +interface ArrayBufferConstructor { |
| 27 | + new(byteLength: number, options?: ArrayBufferOptions): ArrayBuffer; |
| 28 | +} |
| 29 | + |
| 30 | +interface SharedArrayBuffer { |
| 31 | + /** |
| 32 | + * Read-only. Whether this SharedArrayBuffer can be grow or not. |
| 33 | + */ |
| 34 | + readonly growable: number; |
| 35 | + |
| 36 | + /** |
| 37 | + * Read-only. The maximum length that this SharedArrayBuffer can be grown to (in bytes). |
| 38 | + */ |
| 39 | + readonly maxByteLength: number; |
| 40 | + |
| 41 | + /** |
| 42 | + * Grows the SharedArrayBuffer to the specified size (in bytes). |
| 43 | + * @param newLength The new length, in bytes, to resize the SharedArrayBuffer to. |
| 44 | + */ |
| 45 | + grow(newLength: number): undefined; |
| 46 | +} |
| 47 | + |
| 48 | +/** |
| 49 | + * ArrayBuffer constructor options |
| 50 | + */ |
| 51 | +interface SharedArrayBufferOptions { |
| 52 | + maxByteLength?: number; |
| 53 | +} |
| 54 | + |
| 55 | +interface SharedArrayBufferConstructor { |
| 56 | + new(); |
| 57 | + new(byteLength: number, options?: SharedArrayBufferOptions): SharedArrayBuffer; |
| 58 | +} |
0 commit comments