diff --git a/README.md b/README.md index 258ba48..4b20e34 100644 --- a/README.md +++ b/README.md @@ -135,5 +135,4 @@ The type declarations in this repository include the following specifications (g - [Global Privacy Control](https://privacycg.github.io/gpc-spec/) - [TC39](https://tc39.es): - [Array.fromAsync](https://tc39.es/proposal-array-from-async/) - - [Array Grouping](https://tc39.es/proposal-array-grouping/) - [ECMAScript Language Specification](https://tc39.es/ecma262/) diff --git a/css-houdini/typed-om.d.ts b/css-houdini/typed-om.d.ts new file mode 100644 index 0000000..b87c821 --- /dev/null +++ b/css-houdini/typed-om.d.ts @@ -0,0 +1,12 @@ + +// CSS Typed OM Level 1 +// Specification: https://drafts.css-houdini.org/css-typed-om-1/ +// Repository: https://github.com/w3c/css-houdini-drafts/tree/main/css-typed-om + +// This file only defines the CSS.in() function for completeness, which is left out in the lib.dom.d.ts definitions +// https://drafts.css-houdini.org/css-typed-om/#dom-css-in + +declare namespace CSS { + function _in(value: number): CSSUnitValue; + export { _in as in }; +} diff --git a/csswg/cssom.d.ts b/csswg/cssom.d.ts index 01b7db5..4ea89bb 100644 --- a/csswg/cssom.d.ts +++ b/csswg/cssom.d.ts @@ -3,7 +3,7 @@ // Specification: https://drafts.csswg.org/cssom-1/ // Repository: https://github.com/w3c/csswg-drafts/tree/main/cssom-1 -// This file is auto-generated from my CSS properties index (http://localhost/webindex/css.html). +// This file is auto-generated from my CSS properties index (https://benjaminaster.com/webindex/css.html). // The properties already in TypeScript's standard type declarations were removed. interface CSSStyleDeclaration { diff --git a/index.d.ts b/index.d.ts index 1a5d7c8..82016a3 100644 --- a/index.d.ts +++ b/index.d.ts @@ -5,6 +5,7 @@ /// +/// /// /// diff --git a/tc39/esnext.d.ts b/tc39/esnext.d.ts index 81c156b..7c256d6 100644 --- a/tc39/esnext.d.ts +++ b/tc39/esnext.d.ts @@ -1,6 +1,6 @@ // ECMAScript Language Specification -// Specification: https://tc39.es/ecma262/ +// Specification: https://tc39.es/ecma262/multipage/ // Repository: https://github.com/tc39/ecma262 // Fundamental Objects @@ -10,7 +10,47 @@ interface ObjectConstructor { groupBy(array: T[], callback: (item: T, index?: number) => string): Record; } +// Text Processing +// https://tc39.es/ecma262/multipage/text-processing.html + +interface String { + isWellFormed(): boolean; + toWellFormed(): string; +} + +interface RegExp { + readonly unicodeSets: boolean; +} + +// Keyed Collections +// https://tc39.es/ecma262/multipage/keyed-collections.html + interface MapConstructor { groupBy(array: T[], callback: (item: T, index?: number) => K): Map; } +// Structured Data +// https://tc39.es/ecma262/multipage/structured-data.html + +interface ArrayBuffer { + readonly maxByteLength: number; + readonly resizable: boolean; + resize(newLength: number): void; +} + +interface SharedArrayBuffer { + grow(newLength: number): void; + readonly growable: boolean; + readonly maxByteLength: number; +} + +// Control Abstraction Objects +// https://tc39.es/ecma262/multipage/control-abstraction-objects.html + +interface PromiseConstructor { + withResolvers(): { + promise: Promise; + resolve: (value?: T | PromiseLike) => void; + reject: (reason?: any) => void; + }; +} diff --git a/test.ts b/test.ts index e66e620..090fab2 100644 --- a/test.ts +++ b/test.ts @@ -15,10 +15,51 @@ Object.fromEntries Map.toString +Promise.allSettled +ArrayBuffer.prototype + +SharedArrayBuffer.prototype + +let buffer = new ArrayBuffer(5) +buffer.resize(10) + +let sab = new SharedArrayBuffer(10) +sab.growable && sab.grow(20) + +"".charCodeAt(0) +"".toWellFormed() +"".isWellFormed() + +;[].toReversed +;[].toSorted +;[].toSpliced +;[].with +Uint8Array.prototype.toReversed +Uint8Array.prototype.toSorted +Uint8Array.prototype.with + +new Promise((res, rej) => { + res() +}) + +let { promise, resolve, reject } = Promise.withResolvers(); +{ + let { promise, resolve, reject } = Promise.withResolvers(); +} CSS.lvmin +CSS.in +CSS.vi + + +StylePropertyMapReadOnly + +let a: CSSUnparsedSegment + +CSSMathSum + new DecompressionStream("deflate-raw"); window.DeviceMotionEvent.requestPermission();