Skip to content

Commit 9a0f379

Browse files
Bashamegasaschanaz
andauthored
Generate comments for WebAssembly (#2072)
* feat: Generate comments for webassembly * Generate * subdirectories --------- Co-authored-by: Kagami Sascha Rosylight <[email protected]>
1 parent 7fe6559 commit 9a0f379

16 files changed

+1144
-233
lines changed

baselines/audioworklet.generated.d.ts

Lines changed: 75 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1540,7 +1540,11 @@ declare namespace WebAssembly {
15401540
(message?: string): CompileError;
15411541
};
15421542

1543-
/** [MDN Reference](https://developer.mozilla.org/docs/WebAssembly/Reference/JavaScript_interface/Global) */
1543+
/**
1544+
* A **`WebAssembly.Global`** object represents a global variable instance, accessible from both JavaScript and importable/exportable across one or more `WebAssembly.Module` instances.
1545+
*
1546+
* [MDN Reference](https://developer.mozilla.org/docs/WebAssembly/Reference/JavaScript_interface/Global)
1547+
*/
15441548
interface Global<T extends ValueType = ValueType> {
15451549
value: ValueTypeMap[T];
15461550
valueOf(): ValueTypeMap[T];
@@ -1551,9 +1555,17 @@ declare namespace WebAssembly {
15511555
new<T extends ValueType = ValueType>(descriptor: GlobalDescriptor<T>, v?: ValueTypeMap[T]): Global<T>;
15521556
};
15531557

1554-
/** [MDN Reference](https://developer.mozilla.org/docs/WebAssembly/Reference/JavaScript_interface/Instance) */
1558+
/**
1559+
* A **`WebAssembly.Instance`** object is a stateful, executable instance of a `WebAssembly.Module`.
1560+
*
1561+
* [MDN Reference](https://developer.mozilla.org/docs/WebAssembly/Reference/JavaScript_interface/Instance)
1562+
*/
15551563
interface Instance {
1556-
/** [MDN Reference](https://developer.mozilla.org/docs/WebAssembly/Reference/JavaScript_interface/Instance/exports) */
1564+
/**
1565+
* The **`exports`** read-only property of the `WebAssembly.Instance` object prototype returns an object containing as its members all the functions exported from the WebAssembly module instance, to allow them to be accessed and used by JavaScript.
1566+
*
1567+
* [MDN Reference](https://developer.mozilla.org/docs/WebAssembly/Reference/JavaScript_interface/Instance/exports)
1568+
*/
15571569
readonly exports: Exports;
15581570
}
15591571

@@ -1571,11 +1583,23 @@ declare namespace WebAssembly {
15711583
(message?: string): LinkError;
15721584
};
15731585

1574-
/** [MDN Reference](https://developer.mozilla.org/docs/WebAssembly/Reference/JavaScript_interface/Memory) */
1586+
/**
1587+
* The **`WebAssembly.Memory`** object is a resizable ArrayBuffer or SharedArrayBuffer that holds raw bytes of memory accessed by a `WebAssembly.Instance`.
1588+
*
1589+
* [MDN Reference](https://developer.mozilla.org/docs/WebAssembly/Reference/JavaScript_interface/Memory)
1590+
*/
15751591
interface Memory {
1576-
/** [MDN Reference](https://developer.mozilla.org/docs/WebAssembly/Reference/JavaScript_interface/Memory/buffer) */
1592+
/**
1593+
* The read-only **`buffer`** prototype property of the `WebAssembly.Memory` object returns the buffer contained in the memory.
1594+
*
1595+
* [MDN Reference](https://developer.mozilla.org/docs/WebAssembly/Reference/JavaScript_interface/Memory/buffer)
1596+
*/
15771597
readonly buffer: ArrayBuffer;
1578-
/** [MDN Reference](https://developer.mozilla.org/docs/WebAssembly/Reference/JavaScript_interface/Memory/grow) */
1598+
/**
1599+
* The **`grow()`** prototype method of the `WebAssembly.Memory` object increases the size of the memory instance by a specified number of WebAssembly pages.
1600+
*
1601+
* [MDN Reference](https://developer.mozilla.org/docs/WebAssembly/Reference/JavaScript_interface/Memory/grow)
1602+
*/
15791603
grow(delta: number): number;
15801604
}
15811605

@@ -1584,18 +1608,34 @@ declare namespace WebAssembly {
15841608
new(descriptor: MemoryDescriptor): Memory;
15851609
};
15861610

1587-
/** [MDN Reference](https://developer.mozilla.org/docs/WebAssembly/Reference/JavaScript_interface/Module) */
1611+
/**
1612+
* A **`WebAssembly.Module`** object contains stateless WebAssembly code that has already been compiled by the browser — this can be efficiently shared with Workers, and instantiated multiple times.
1613+
*
1614+
* [MDN Reference](https://developer.mozilla.org/docs/WebAssembly/Reference/JavaScript_interface/Module)
1615+
*/
15881616
interface Module {
15891617
}
15901618

15911619
var Module: {
15921620
prototype: Module;
15931621
new(bytes: BufferSource): Module;
1594-
/** [MDN Reference](https://developer.mozilla.org/docs/WebAssembly/Reference/JavaScript_interface/Module/customSections_static) */
1622+
/**
1623+
* 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.
1624+
*
1625+
* [MDN Reference](https://developer.mozilla.org/docs/WebAssembly/Reference/JavaScript_interface/Module/customSections_static)
1626+
*/
15951627
customSections(moduleObject: Module, sectionName: string): ArrayBuffer[];
1596-
/** [MDN Reference](https://developer.mozilla.org/docs/WebAssembly/Reference/JavaScript_interface/Module/exports_static) */
1628+
/**
1629+
* The **`WebAssembly.Module.exports()`** static method returns an array containing descriptions of all the declared exports of the given `Module`.
1630+
*
1631+
* [MDN Reference](https://developer.mozilla.org/docs/WebAssembly/Reference/JavaScript_interface/Module/exports_static)
1632+
*/
15971633
exports(moduleObject: Module): ModuleExportDescriptor[];
1598-
/** [MDN Reference](https://developer.mozilla.org/docs/WebAssembly/Reference/JavaScript_interface/Module/imports_static) */
1634+
/**
1635+
* The **`WebAssembly.Module.imports()`** static method returns an array containing descriptions of all the declared imports of the given `Module`.
1636+
*
1637+
* [MDN Reference](https://developer.mozilla.org/docs/WebAssembly/Reference/JavaScript_interface/Module/imports_static)
1638+
*/
15991639
imports(moduleObject: Module): ModuleImportDescriptor[];
16001640
};
16011641

@@ -1608,15 +1648,35 @@ declare namespace WebAssembly {
16081648
(message?: string): RuntimeError;
16091649
};
16101650

1611-
/** [MDN Reference](https://developer.mozilla.org/docs/WebAssembly/Reference/JavaScript_interface/Table) */
1651+
/**
1652+
* The **`WebAssembly.Table`** object is a JavaScript wrapper object — an array-like structure representing a WebAssembly table, which stores homogeneous references.
1653+
*
1654+
* [MDN Reference](https://developer.mozilla.org/docs/WebAssembly/Reference/JavaScript_interface/Table)
1655+
*/
16121656
interface Table {
1613-
/** [MDN Reference](https://developer.mozilla.org/docs/WebAssembly/Reference/JavaScript_interface/Table/length) */
1657+
/**
1658+
* The read-only **`length`** prototype property of the `WebAssembly.Table` object returns the length of the table, i.e., the number of elements in the table.
1659+
*
1660+
* [MDN Reference](https://developer.mozilla.org/docs/WebAssembly/Reference/JavaScript_interface/Table/length)
1661+
*/
16141662
readonly length: number;
1615-
/** [MDN Reference](https://developer.mozilla.org/docs/WebAssembly/Reference/JavaScript_interface/Table/get) */
1663+
/**
1664+
* The **`get()`** prototype method of the `WebAssembly.Table()` object retrieves the element stored at a given index.
1665+
*
1666+
* [MDN Reference](https://developer.mozilla.org/docs/WebAssembly/Reference/JavaScript_interface/Table/get)
1667+
*/
16161668
get(index: number): any;
1617-
/** [MDN Reference](https://developer.mozilla.org/docs/WebAssembly/Reference/JavaScript_interface/Table/grow) */
1669+
/**
1670+
* 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.
1671+
*
1672+
* [MDN Reference](https://developer.mozilla.org/docs/WebAssembly/Reference/JavaScript_interface/Table/grow)
1673+
*/
16181674
grow(delta: number, value?: any): number;
1619-
/** [MDN Reference](https://developer.mozilla.org/docs/WebAssembly/Reference/JavaScript_interface/Table/set) */
1675+
/**
1676+
* The **`set()`** prototype method of the `WebAssembly.Table` object mutates a reference stored at a given index to a different value.
1677+
*
1678+
* [MDN Reference](https://developer.mozilla.org/docs/WebAssembly/Reference/JavaScript_interface/Table/set)
1679+
*/
16201680
set(index: number, value?: any): void;
16211681
}
16221682

baselines/dom.generated.d.ts

Lines changed: 75 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -38122,7 +38122,11 @@ declare namespace WebAssembly {
3812238122
(message?: string): CompileError;
3812338123
};
3812438124

38125-
/** [MDN Reference](https://developer.mozilla.org/docs/WebAssembly/Reference/JavaScript_interface/Global) */
38125+
/**
38126+
* A **`WebAssembly.Global`** object represents a global variable instance, accessible from both JavaScript and importable/exportable across one or more `WebAssembly.Module` instances.
38127+
*
38128+
* [MDN Reference](https://developer.mozilla.org/docs/WebAssembly/Reference/JavaScript_interface/Global)
38129+
*/
3812638130
interface Global<T extends ValueType = ValueType> {
3812738131
value: ValueTypeMap[T];
3812838132
valueOf(): ValueTypeMap[T];
@@ -38133,9 +38137,17 @@ declare namespace WebAssembly {
3813338137
new<T extends ValueType = ValueType>(descriptor: GlobalDescriptor<T>, v?: ValueTypeMap[T]): Global<T>;
3813438138
};
3813538139

38136-
/** [MDN Reference](https://developer.mozilla.org/docs/WebAssembly/Reference/JavaScript_interface/Instance) */
38140+
/**
38141+
* A **`WebAssembly.Instance`** object is a stateful, executable instance of a `WebAssembly.Module`.
38142+
*
38143+
* [MDN Reference](https://developer.mozilla.org/docs/WebAssembly/Reference/JavaScript_interface/Instance)
38144+
*/
3813738145
interface Instance {
38138-
/** [MDN Reference](https://developer.mozilla.org/docs/WebAssembly/Reference/JavaScript_interface/Instance/exports) */
38146+
/**
38147+
* The **`exports`** read-only property of the `WebAssembly.Instance` object prototype returns an object containing as its members all the functions exported from the WebAssembly module instance, to allow them to be accessed and used by JavaScript.
38148+
*
38149+
* [MDN Reference](https://developer.mozilla.org/docs/WebAssembly/Reference/JavaScript_interface/Instance/exports)
38150+
*/
3813938151
readonly exports: Exports;
3814038152
}
3814138153

@@ -38153,11 +38165,23 @@ declare namespace WebAssembly {
3815338165
(message?: string): LinkError;
3815438166
};
3815538167

38156-
/** [MDN Reference](https://developer.mozilla.org/docs/WebAssembly/Reference/JavaScript_interface/Memory) */
38168+
/**
38169+
* The **`WebAssembly.Memory`** object is a resizable ArrayBuffer or SharedArrayBuffer that holds raw bytes of memory accessed by a `WebAssembly.Instance`.
38170+
*
38171+
* [MDN Reference](https://developer.mozilla.org/docs/WebAssembly/Reference/JavaScript_interface/Memory)
38172+
*/
3815738173
interface Memory {
38158-
/** [MDN Reference](https://developer.mozilla.org/docs/WebAssembly/Reference/JavaScript_interface/Memory/buffer) */
38174+
/**
38175+
* The read-only **`buffer`** prototype property of the `WebAssembly.Memory` object returns the buffer contained in the memory.
38176+
*
38177+
* [MDN Reference](https://developer.mozilla.org/docs/WebAssembly/Reference/JavaScript_interface/Memory/buffer)
38178+
*/
3815938179
readonly buffer: ArrayBuffer;
38160-
/** [MDN Reference](https://developer.mozilla.org/docs/WebAssembly/Reference/JavaScript_interface/Memory/grow) */
38180+
/**
38181+
* The **`grow()`** prototype method of the `WebAssembly.Memory` object increases the size of the memory instance by a specified number of WebAssembly pages.
38182+
*
38183+
* [MDN Reference](https://developer.mozilla.org/docs/WebAssembly/Reference/JavaScript_interface/Memory/grow)
38184+
*/
3816138185
grow(delta: number): number;
3816238186
}
3816338187

@@ -38166,18 +38190,34 @@ declare namespace WebAssembly {
3816638190
new(descriptor: MemoryDescriptor): Memory;
3816738191
};
3816838192

38169-
/** [MDN Reference](https://developer.mozilla.org/docs/WebAssembly/Reference/JavaScript_interface/Module) */
38193+
/**
38194+
* A **`WebAssembly.Module`** object contains stateless WebAssembly code that has already been compiled by the browser — this can be efficiently shared with Workers, and instantiated multiple times.
38195+
*
38196+
* [MDN Reference](https://developer.mozilla.org/docs/WebAssembly/Reference/JavaScript_interface/Module)
38197+
*/
3817038198
interface Module {
3817138199
}
3817238200

3817338201
var Module: {
3817438202
prototype: Module;
3817538203
new(bytes: BufferSource): Module;
38176-
/** [MDN Reference](https://developer.mozilla.org/docs/WebAssembly/Reference/JavaScript_interface/Module/customSections_static) */
38204+
/**
38205+
* 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.
38206+
*
38207+
* [MDN Reference](https://developer.mozilla.org/docs/WebAssembly/Reference/JavaScript_interface/Module/customSections_static)
38208+
*/
3817738209
customSections(moduleObject: Module, sectionName: string): ArrayBuffer[];
38178-
/** [MDN Reference](https://developer.mozilla.org/docs/WebAssembly/Reference/JavaScript_interface/Module/exports_static) */
38210+
/**
38211+
* The **`WebAssembly.Module.exports()`** static method returns an array containing descriptions of all the declared exports of the given `Module`.
38212+
*
38213+
* [MDN Reference](https://developer.mozilla.org/docs/WebAssembly/Reference/JavaScript_interface/Module/exports_static)
38214+
*/
3817938215
exports(moduleObject: Module): ModuleExportDescriptor[];
38180-
/** [MDN Reference](https://developer.mozilla.org/docs/WebAssembly/Reference/JavaScript_interface/Module/imports_static) */
38216+
/**
38217+
* The **`WebAssembly.Module.imports()`** static method returns an array containing descriptions of all the declared imports of the given `Module`.
38218+
*
38219+
* [MDN Reference](https://developer.mozilla.org/docs/WebAssembly/Reference/JavaScript_interface/Module/imports_static)
38220+
*/
3818138221
imports(moduleObject: Module): ModuleImportDescriptor[];
3818238222
};
3818338223

@@ -38190,15 +38230,35 @@ declare namespace WebAssembly {
3819038230
(message?: string): RuntimeError;
3819138231
};
3819238232

38193-
/** [MDN Reference](https://developer.mozilla.org/docs/WebAssembly/Reference/JavaScript_interface/Table) */
38233+
/**
38234+
* The **`WebAssembly.Table`** object is a JavaScript wrapper object — an array-like structure representing a WebAssembly table, which stores homogeneous references.
38235+
*
38236+
* [MDN Reference](https://developer.mozilla.org/docs/WebAssembly/Reference/JavaScript_interface/Table)
38237+
*/
3819438238
interface Table {
38195-
/** [MDN Reference](https://developer.mozilla.org/docs/WebAssembly/Reference/JavaScript_interface/Table/length) */
38239+
/**
38240+
* The read-only **`length`** prototype property of the `WebAssembly.Table` object returns the length of the table, i.e., the number of elements in the table.
38241+
*
38242+
* [MDN Reference](https://developer.mozilla.org/docs/WebAssembly/Reference/JavaScript_interface/Table/length)
38243+
*/
3819638244
readonly length: number;
38197-
/** [MDN Reference](https://developer.mozilla.org/docs/WebAssembly/Reference/JavaScript_interface/Table/get) */
38245+
/**
38246+
* The **`get()`** prototype method of the `WebAssembly.Table()` object retrieves the element stored at a given index.
38247+
*
38248+
* [MDN Reference](https://developer.mozilla.org/docs/WebAssembly/Reference/JavaScript_interface/Table/get)
38249+
*/
3819838250
get(index: number): any;
38199-
/** [MDN Reference](https://developer.mozilla.org/docs/WebAssembly/Reference/JavaScript_interface/Table/grow) */
38251+
/**
38252+
* 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.
38253+
*
38254+
* [MDN Reference](https://developer.mozilla.org/docs/WebAssembly/Reference/JavaScript_interface/Table/grow)
38255+
*/
3820038256
grow(delta: number, value?: any): number;
38201-
/** [MDN Reference](https://developer.mozilla.org/docs/WebAssembly/Reference/JavaScript_interface/Table/set) */
38257+
/**
38258+
* The **`set()`** prototype method of the `WebAssembly.Table` object mutates a reference stored at a given index to a different value.
38259+
*
38260+
* [MDN Reference](https://developer.mozilla.org/docs/WebAssembly/Reference/JavaScript_interface/Table/set)
38261+
*/
3820238262
set(index: number, value?: any): void;
3820338263
}
3820438264

0 commit comments

Comments
 (0)