@@ -1550,6 +1550,12 @@ function createTypeScriptDefinitions() {
1550
1550
. replace ( / < S t r i n g > / gm, "<string>" )
1551
1551
. replace ( / < B o o l e a n > / gm, "<boolean>" )
1552
1552
. replace ( / < O b j e c t > / gm, "<object>" )
1553
+ // The class has to be called PropertyBag for JSDoc purposes, but we can rename
1554
+ // it and reuse the `PropertyBag` name for a union type, see below
1555
+ . replace (
1556
+ / e x p o r t ( c l a s s | i n t e r f a c e ) P r o p e r t y B a g / gm,
1557
+ "export $1 PropertyBagBase"
1558
+ )
1553
1559
. replace (
1554
1560
/ = " W e b G L C o n s t a n t s \. ( .+ ) " / gm,
1555
1561
( match , p1 ) => `= WebGLConstants.${ p1 } `
@@ -1562,19 +1568,14 @@ function createTypeScriptDefinitions() {
1562
1568
/**
1563
1569
* Private interfaces to support PropertyBag being a dictionary-like object.
1564
1570
*/
1571
+ interface DictionaryLike {
1572
+ [index: string]: any;
1573
+ }
1565
1574
interface PropertyDictionary {
1566
1575
[key: string]: Property | undefined;
1567
1576
}
1568
- class PropertyBagBase {
1569
- readonly propertyNames: string[];
1570
- constructor(value?: object, createPropertyCallback?: Function);
1571
- addProperty(propertyName: string, value?: any, createPropertyCallback?: Function): void;
1572
- hasProperty(propertyName: string): boolean;
1573
- merge(source: Object, createPropertyCallback?: Function): void;
1574
- removeProperty(propertyName: string): void;
1575
- }
1576
1577
/** This has to be in the workaround section because JSDoc doesn't support Intersection Types */
1577
- type PropertyBagType = PropertyDictionary & Property & PropertyBagBase;
1578
+ type PropertyBag = PropertyDictionary & Property & PropertyBagBase;
1578
1579
1579
1580
${ source }
1580
1581
}
0 commit comments