Skip to content

Commit 9ff5a92

Browse files
committed
Merge Main
2 parents cc500ae + 60b79a3 commit 9ff5a92

File tree

92 files changed

+85024
-3283
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

92 files changed

+85024
-3283
lines changed

.github/workflows/ci.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ jobs:
1111
submodules: true # Ensures submodules are cloned
1212

1313

14-
- uses: actions/setup-node@v4
14+
- uses: actions/setup-node@v5
1515
with:
1616
node-version: "lts/*"
1717
cache: npm

.github/workflows/deploy.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ jobs:
1919
with:
2020
submodules: true # Ensures submodules are cloned
2121

22-
- uses: actions/setup-node@v4
22+
- uses: actions/setup-node@v5
2323
with:
2424
node-version: "lts/*"
2525
cache: npm

.github/workflows/test_typescript.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ jobs:
1818
submodules: true # Ensures submodules are cloned
1919

2020

21-
- uses: actions/setup-node@v4
21+
- uses: actions/setup-node@v5
2222
with:
2323
node-version: "lts/*"
2424
cache: npm

.github/workflows/update-core-deps.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ jobs:
1717

1818
- name: Update submodules
1919
run: git submodule update --init --remote
20-
- uses: actions/setup-node@v4
20+
- uses: actions/setup-node@v5
2121
with:
2222
node-version: "lts/*"
2323
cache: npm

README.md

Lines changed: 1 addition & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -86,25 +86,6 @@ If you are familiar with Web IDL, you may also want to check whether the upstrea
8686
- `addedTypes.jsonc`: types that should exist but are missing from the spec data.
8787
- `overridingTypes.jsonc`: types that are defined in the spec but have TypeScript-friendly modifications in the json files.
8888
- `removedTypes.jsonc`: types that are defined in the spec but should be removed.
89+
- `patches/*.kdl`: KDL types
8990
- `comments.json`: comment strings to be embedded in the generated .d.ts files.
9091
- `deprecatedMessage.json`: the reason why one type is deprecated.
91-
92-
## Deployment to TypeScript
93-
94-
To migrate the *.d.ts files into TypeScript:
95-
96-
1. [Trigger the workflow here](https://github.com/microsoft/TypeScript-DOM-lib-generator/actions/workflows/pr-to-typescript.yml) - this will send a PR to TypeScript under your alias.
97-
98-
99-
1. Update the README table with the mappings for versions in the `@types/[lib]`. E.g. TS 4.5 -> `@types/web` `0.0.23`. Find that number here: https://www.npmjs.com/package/@types/web
100-
101-
1. Generate a CHANGELOG for the releases:
102-
103-
```sh
104-
# lib from to
105-
npm run ts-changelog -- @types/web 0.0.2 0.0.23
106-
```
107-
108-
You might need to run `git pull origin main --tags` to run this ^
109-
110-
1. Add the CHANGELOG to the release issue
Lines changed: 2 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,2 @@
1-
/////////////////////////////
2-
/// AudioWorklet Async Iterable APIs
3-
/////////////////////////////
4-
5-
interface ReadableStreamAsyncIterator<T> extends AsyncIteratorObject<T, BuiltinIteratorReturn, unknown> {
6-
[Symbol.asyncIterator](): ReadableStreamAsyncIterator<T>;
7-
}
8-
9-
interface ReadableStream<R = any> {
10-
[Symbol.asyncIterator](options?: ReadableStreamIteratorOptions): ReadableStreamAsyncIterator<R>;
11-
values(options?: ReadableStreamIteratorOptions): ReadableStreamAsyncIterator<R>;
12-
}
1+
// This file's contents are now included in the main types file.
2+
// The file has been left for backward compatibility.

baselines/audioworklet.generated.d.ts

Lines changed: 122 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
1+
/// <reference lib="es2015" />
2+
/// <reference lib="es2018.asynciterable" />
3+
14
/////////////////////////////
25
/// AudioWorklet APIs
36
/////////////////////////////
@@ -57,6 +60,10 @@ interface QueuingStrategyInit {
5760
highWaterMark: number;
5861
}
5962

63+
interface ReadableStreamBYOBReaderReadOptions {
64+
min?: number;
65+
}
66+
6067
interface ReadableStreamGetReaderOptions {
6168
/**
6269
* Creates a ReadableStreamBYOBReader and locks the stream to the new reader.
@@ -952,7 +959,7 @@ interface ReadableStreamBYOBReader extends ReadableStreamGenericReader {
952959
*
953960
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/ReadableStreamBYOBReader/read)
954961
*/
955-
read<T extends ArrayBufferView>(view: T): Promise<ReadableStreamReadResult<T>>;
962+
read<T extends ArrayBufferView>(view: T, options?: ReadableStreamBYOBReaderReadOptions): Promise<ReadableStreamReadResult<T>>;
956963
/**
957964
* The **`releaseLock()`** method of the ReadableStreamBYOBReader interface releases the reader's lock on the stream.
958965
*
@@ -1540,6 +1547,37 @@ declare namespace WebAssembly {
15401547
(message?: string): CompileError;
15411548
};
15421549

1550+
/**
1551+
* The **`WebAssembly.Exception`** object represents a runtime exception thrown from WebAssembly to JavaScript, or thrown from JavaScript to a WebAssembly exception handler.
1552+
*
1553+
* [MDN Reference](https://developer.mozilla.org/docs/WebAssembly/Reference/JavaScript_interface/Exception)
1554+
*/
1555+
interface Exception {
1556+
/**
1557+
* The read-only **`stack`** property of an object instance of type `WebAssembly.Exception` _may_ contain a stack trace.
1558+
*
1559+
* [MDN Reference](https://developer.mozilla.org/docs/WebAssembly/Reference/JavaScript_interface/Exception/stack)
1560+
*/
1561+
readonly stack: string | undefined;
1562+
/**
1563+
* The **`getArg()`** prototype method of the `Exception` object can be used to get the value of a specified item in the exception's data arguments.
1564+
*
1565+
* [MDN Reference](https://developer.mozilla.org/docs/WebAssembly/Reference/JavaScript_interface/Exception/getArg)
1566+
*/
1567+
getArg(index: number): any;
1568+
/**
1569+
* The **`is()`** prototype method of the `Exception` object can be used to test if the `Exception` matches a given tag.
1570+
*
1571+
* [MDN Reference](https://developer.mozilla.org/docs/WebAssembly/Reference/JavaScript_interface/Exception/is)
1572+
*/
1573+
is(exceptionTag: Tag): boolean;
1574+
}
1575+
1576+
var Exception: {
1577+
prototype: Exception;
1578+
new(exceptionTag: Tag, payload: any[], options?: ExceptionOptions): Exception;
1579+
};
1580+
15431581
/**
15441582
* A **`WebAssembly.Global`** object represents a global variable instance, accessible from both JavaScript and importable/exportable across one or more `WebAssembly.Module` instances.
15451583
*
@@ -1600,7 +1638,7 @@ declare namespace WebAssembly {
16001638
*
16011639
* [MDN Reference](https://developer.mozilla.org/docs/WebAssembly/Reference/JavaScript_interface/Memory/grow)
16021640
*/
1603-
grow(delta: number): number;
1641+
grow(delta: AddressValue): AddressValue;
16041642
}
16051643

16061644
var Memory: {
@@ -1618,7 +1656,7 @@ declare namespace WebAssembly {
16181656

16191657
var Module: {
16201658
prototype: Module;
1621-
new(bytes: BufferSource): Module;
1659+
new(bytes: BufferSource, options?: WebAssemblyCompileOptions): Module;
16221660
/**
16231661
* The **`WebAssembly.Module.customSections()`** static method returns a copy of the contents of all custom sections in the given module with the given string name.
16241662
*
@@ -1659,40 +1697,58 @@ declare namespace WebAssembly {
16591697
*
16601698
* [MDN Reference](https://developer.mozilla.org/docs/WebAssembly/Reference/JavaScript_interface/Table/length)
16611699
*/
1662-
readonly length: number;
1700+
readonly length: AddressValue;
16631701
/**
16641702
* The **`get()`** prototype method of the `WebAssembly.Table()` object retrieves the element stored at a given index.
16651703
*
16661704
* [MDN Reference](https://developer.mozilla.org/docs/WebAssembly/Reference/JavaScript_interface/Table/get)
16671705
*/
1668-
get(index: number): any;
1706+
get(index: AddressValue): any;
16691707
/**
16701708
* The **`grow()`** prototype method of the `WebAssembly.Table` object increases the size of the `Table` instance by a specified number of elements, filled with the provided value.
16711709
*
16721710
* [MDN Reference](https://developer.mozilla.org/docs/WebAssembly/Reference/JavaScript_interface/Table/grow)
16731711
*/
1674-
grow(delta: number, value?: any): number;
1712+
grow(delta: AddressValue, value?: any): AddressValue;
16751713
/**
16761714
* The **`set()`** prototype method of the `WebAssembly.Table` object mutates a reference stored at a given index to a different value.
16771715
*
16781716
* [MDN Reference](https://developer.mozilla.org/docs/WebAssembly/Reference/JavaScript_interface/Table/set)
16791717
*/
1680-
set(index: number, value?: any): void;
1718+
set(index: AddressValue, value?: any): void;
16811719
}
16821720

16831721
var Table: {
16841722
prototype: Table;
16851723
new(descriptor: TableDescriptor, value?: any): Table;
16861724
};
16871725

1726+
/**
1727+
* The **`WebAssembly.Tag`** object defines a _type_ of a WebAssembly exception that can be thrown to/from WebAssembly code.
1728+
*
1729+
* [MDN Reference](https://developer.mozilla.org/docs/WebAssembly/Reference/JavaScript_interface/Tag)
1730+
*/
1731+
interface Tag {
1732+
}
1733+
1734+
var Tag: {
1735+
prototype: Tag;
1736+
new(type: TagType): Tag;
1737+
};
1738+
1739+
interface ExceptionOptions {
1740+
traceStack?: boolean;
1741+
}
1742+
16881743
interface GlobalDescriptor<T extends ValueType = ValueType> {
16891744
mutable?: boolean;
16901745
value: T;
16911746
}
16921747

16931748
interface MemoryDescriptor {
1694-
initial: number;
1695-
maximum?: number;
1749+
address?: AddressType;
1750+
initial: AddressValue;
1751+
maximum?: AddressValue;
16961752
shared?: boolean;
16971753
}
16981754

@@ -1708,9 +1764,14 @@ declare namespace WebAssembly {
17081764
}
17091765

17101766
interface TableDescriptor {
1767+
address?: AddressType;
17111768
element: TableKind;
1712-
initial: number;
1713-
maximum?: number;
1769+
initial: AddressValue;
1770+
maximum?: AddressValue;
1771+
}
1772+
1773+
interface TagType {
1774+
parameters: ValueType[];
17141775
}
17151776

17161777
interface ValueTypeMap {
@@ -1723,26 +1784,34 @@ declare namespace WebAssembly {
17231784
v128: never;
17241785
}
17251786

1787+
interface WebAssemblyCompileOptions {
1788+
builtins?: string[];
1789+
importedStringConstants?: string | null;
1790+
}
1791+
17261792
interface WebAssemblyInstantiatedSource {
17271793
instance: Instance;
17281794
module: Module;
17291795
}
17301796

1731-
type ImportExportKind = "function" | "global" | "memory" | "table";
1797+
type AddressType = "i32" | "i64";
1798+
type ImportExportKind = "function" | "global" | "memory" | "table" | "tag";
17321799
type TableKind = "anyfunc" | "externref";
1800+
type AddressValue = number;
17331801
type ExportValue = Function | Global | Memory | Table;
17341802
type Exports = Record<string, ExportValue>;
17351803
type ImportValue = ExportValue | number;
17361804
type Imports = Record<string, ModuleImports>;
17371805
type ModuleImports = Record<string, ImportValue>;
17381806
type ValueType = keyof ValueTypeMap;
1807+
var JSTag: Tag;
17391808
/** [MDN Reference](https://developer.mozilla.org/docs/WebAssembly/Reference/JavaScript_interface/compile_static) */
1740-
function compile(bytes: BufferSource): Promise<Module>;
1809+
function compile(bytes: BufferSource, options?: WebAssemblyCompileOptions): Promise<Module>;
17411810
/** [MDN Reference](https://developer.mozilla.org/docs/WebAssembly/Reference/JavaScript_interface/instantiate_static) */
1742-
function instantiate(bytes: BufferSource, importObject?: Imports): Promise<WebAssemblyInstantiatedSource>;
1811+
function instantiate(bytes: BufferSource, importObject?: Imports, options?: WebAssemblyCompileOptions): Promise<WebAssemblyInstantiatedSource>;
17431812
function instantiate(moduleObject: Module, importObject?: Imports): Promise<Instance>;
17441813
/** [MDN Reference](https://developer.mozilla.org/docs/WebAssembly/Reference/JavaScript_interface/validate_static) */
1745-
function validate(bytes: BufferSource): boolean;
1814+
function validate(bytes: BufferSource, options?: WebAssemblyCompileOptions): boolean;
17461815
}
17471816

17481817
/** The **`console`** object provides access to the debugging console (e.g., the Web console in Firefox). */
@@ -1955,3 +2024,41 @@ type Transferable = MessagePort | ReadableStream | WritableStream | TransformStr
19552024
type CompressionFormat = "deflate" | "deflate-raw" | "gzip";
19562025
type ReadableStreamReaderMode = "byob";
19572026
type ReadableStreamType = "bytes";
2027+
2028+
2029+
/////////////////////////////
2030+
/// AudioWorklet Iterable APIs
2031+
/////////////////////////////
2032+
2033+
interface MessageEvent<T = any> {
2034+
/** @deprecated */
2035+
initMessageEvent(type: string, bubbles?: boolean, cancelable?: boolean, data?: any, origin?: string, lastEventId?: string, source?: MessageEventSource | null, ports?: MessagePort[]): void;
2036+
}
2037+
2038+
interface URLSearchParamsIterator<T> extends IteratorObject<T, BuiltinIteratorReturn, unknown> {
2039+
[Symbol.iterator](): URLSearchParamsIterator<T>;
2040+
}
2041+
2042+
interface URLSearchParams {
2043+
[Symbol.iterator](): URLSearchParamsIterator<[string, string]>;
2044+
/** Returns an array of key, value pairs for every entry in the search params. */
2045+
entries(): URLSearchParamsIterator<[string, string]>;
2046+
/** Returns a list of keys in the search params. */
2047+
keys(): URLSearchParamsIterator<string>;
2048+
/** Returns a list of values in the search params. */
2049+
values(): URLSearchParamsIterator<string>;
2050+
}
2051+
2052+
2053+
/////////////////////////////
2054+
/// AudioWorklet Async Iterable APIs
2055+
/////////////////////////////
2056+
2057+
interface ReadableStreamAsyncIterator<T> extends AsyncIteratorObject<T, BuiltinIteratorReturn, unknown> {
2058+
[Symbol.asyncIterator](): ReadableStreamAsyncIterator<T>;
2059+
}
2060+
2061+
interface ReadableStream<R = any> {
2062+
[Symbol.asyncIterator](options?: ReadableStreamIteratorOptions): ReadableStreamAsyncIterator<R>;
2063+
values(options?: ReadableStreamIteratorOptions): ReadableStreamAsyncIterator<R>;
2064+
}
Lines changed: 2 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,2 @@
1-
/////////////////////////////
2-
/// AudioWorklet Iterable APIs
3-
/////////////////////////////
4-
5-
interface MessageEvent<T = any> {
6-
/** @deprecated */
7-
initMessageEvent(type: string, bubbles?: boolean, cancelable?: boolean, data?: any, origin?: string, lastEventId?: string, source?: MessageEventSource | null, ports?: Iterable<MessagePort>): void;
8-
}
9-
10-
interface URLSearchParamsIterator<T> extends IteratorObject<T, BuiltinIteratorReturn, unknown> {
11-
[Symbol.iterator](): URLSearchParamsIterator<T>;
12-
}
13-
14-
interface URLSearchParams {
15-
[Symbol.iterator](): URLSearchParamsIterator<[string, string]>;
16-
/** Returns an array of key, value pairs for every entry in the search params. */
17-
entries(): URLSearchParamsIterator<[string, string]>;
18-
/** Returns a list of keys in the search params. */
19-
keys(): URLSearchParamsIterator<string>;
20-
/** Returns a list of values in the search params. */
21-
values(): URLSearchParamsIterator<string>;
22-
}
1+
// This file's contents are now included in the main types file.
2+
// The file has been left for backward compatibility.
Lines changed: 2 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -1,23 +1,2 @@
1-
/////////////////////////////
2-
/// Window Async Iterable APIs
3-
/////////////////////////////
4-
5-
interface FileSystemDirectoryHandleAsyncIterator<T> extends AsyncIteratorObject<T, BuiltinIteratorReturn, unknown> {
6-
[Symbol.asyncIterator](): FileSystemDirectoryHandleAsyncIterator<T>;
7-
}
8-
9-
interface FileSystemDirectoryHandle {
10-
[Symbol.asyncIterator](): FileSystemDirectoryHandleAsyncIterator<[string, FileSystemHandle]>;
11-
entries(): FileSystemDirectoryHandleAsyncIterator<[string, FileSystemHandle]>;
12-
keys(): FileSystemDirectoryHandleAsyncIterator<string>;
13-
values(): FileSystemDirectoryHandleAsyncIterator<FileSystemHandle>;
14-
}
15-
16-
interface ReadableStreamAsyncIterator<T> extends AsyncIteratorObject<T, BuiltinIteratorReturn, unknown> {
17-
[Symbol.asyncIterator](): ReadableStreamAsyncIterator<T>;
18-
}
19-
20-
interface ReadableStream<R = any> {
21-
[Symbol.asyncIterator](options?: ReadableStreamIteratorOptions): ReadableStreamAsyncIterator<R>;
22-
values(options?: ReadableStreamIteratorOptions): ReadableStreamAsyncIterator<R>;
23-
}
1+
// This file's contents are now included in the main types file.
2+
// The file has been left for backward compatibility.

0 commit comments

Comments
 (0)