Skip to content

Commit

Permalink
0.4.1
Browse files Browse the repository at this point in the history
  • Loading branch information
BenjaminAster committed Dec 29, 2023
1 parent a08c543 commit b94bd41
Show file tree
Hide file tree
Showing 6 changed files with 96 additions and 3 deletions.
1 change: 0 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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/)
12 changes: 12 additions & 0 deletions css-houdini/typed-om.d.ts
Original file line number Diff line number Diff line change
@@ -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 };
}
2 changes: 1 addition & 1 deletion csswg/cssom.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down
1 change: 1 addition & 0 deletions index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@

/// <reference path="./worker.d.ts" />

/// <reference path="./css-houdini/typed-om.d.ts" />
/// <reference path="./css-houdini/worklet-animation.d.ts" />
/// <reference path="./css-houdini/worklets.d.ts" />

Expand Down
42 changes: 41 additions & 1 deletion tc39/esnext.d.ts
Original file line number Diff line number Diff line change
@@ -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
Expand All @@ -10,7 +10,47 @@ interface ObjectConstructor {
groupBy<T>(array: T[], callback: (item: T, index?: number) => string): Record<string, T[]>;
}

// 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<T, K>(array: T[], callback: (item: T, index?: number) => K): Map<K, T[]>;
}

// 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<T = any>(): {
promise: Promise<T>;
resolve: (value?: T | PromiseLike<T>) => void;
reject: (reason?: any) => void;
};
}
41 changes: 41 additions & 0 deletions test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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<void>((res, rej) => {
res()
})

let { promise, resolve, reject } = Promise.withResolvers();
{
let { promise, resolve, reject } = Promise.withResolvers<number>();
}

CSS.lvmin

CSS.in
CSS.vi


StylePropertyMapReadOnly

let a: CSSUnparsedSegment

CSSMathSum

new DecompressionStream("deflate-raw");

window.DeviceMotionEvent.requestPermission();
Expand Down

0 comments on commit b94bd41

Please sign in to comment.