Skip to content

Update to [email protected] #1283

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Mar 2, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
201 changes: 201 additions & 0 deletions baselines/dom.generated.d.ts

Large diffs are not rendered by default.

22 changes: 22 additions & 0 deletions baselines/serviceworker.generated.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -359,6 +359,11 @@ interface MultiCacheQueryOptions extends CacheQueryOptions {
cacheName?: string;
}

interface NavigationPreloadState {
enabled?: boolean;
headerValue?: string;
}

interface NotificationAction {
action: string;
icon?: string;
Expand Down Expand Up @@ -1404,6 +1409,7 @@ declare var ExtendableMessageEvent: {
interface FetchEvent extends ExtendableEvent {
readonly clientId: string;
readonly handled: Promise<undefined>;
readonly preloadResponse: Promise<any>;
readonly request: Request;
readonly resultingClientId: string;
respondWith(r: Response | PromiseLike<Response>): void;
Expand Down Expand Up @@ -2043,6 +2049,7 @@ declare var ImageBitmapRenderingContext: {

/** The underlying pixel data of an area of a <canvas> element. It is created using the ImageData() constructor or creator methods on the CanvasRenderingContext2D object associated with a canvas: createImageData() and getImageData(). It can also be used to set a part of the canvas by using putImageData(). */
interface ImageData {
readonly colorSpace: PredefinedColorSpace;
/** Returns the one-dimensional array containing the data in RGBA order, as integers in the range 0 to 255. */
readonly data: Uint8ClampedArray;
/** Returns the actual dimensions of the data in the ImageData object, in pixels. */
Expand Down Expand Up @@ -2159,6 +2166,19 @@ declare var MessagePort: {
new(): MessagePort;
};

/** Available only in secure contexts. */
interface NavigationPreloadManager {
disable(): Promise<void>;
enable(): Promise<void>;
getState(): Promise<NavigationPreloadState>;
setHeaderValue(value: string): Promise<void>;
}

declare var NavigationPreloadManager: {
prototype: NavigationPreloadManager;
new(): NavigationPreloadManager;
};

interface NavigatorConcurrentHardware {
readonly hardwareConcurrency: number;
}
Expand Down Expand Up @@ -5113,6 +5133,7 @@ interface WindowOrWorkerGlobalScope {
reportError(e: any): void;
setInterval(handler: TimerHandler, timeout?: number, ...arguments: any[]): number;
setTimeout(handler: TimerHandler, timeout?: number, ...arguments: any[]): number;
structuredClone(value: any, options?: StructuredSerializeOptions): any;
}

interface WorkerGlobalScopeEventMap {
Expand Down Expand Up @@ -5482,6 +5503,7 @@ declare function queueMicrotask(callback: VoidFunction): void;
declare function reportError(e: any): void;
declare function setInterval(handler: TimerHandler, timeout?: number, ...arguments: any[]): number;
declare function setTimeout(handler: TimerHandler, timeout?: number, ...arguments: any[]): number;
declare function structuredClone(value: any, options?: StructuredSerializeOptions): any;
declare function addEventListener<K extends keyof ServiceWorkerGlobalScopeEventMap>(type: K, listener: (this: ServiceWorkerGlobalScope, ev: ServiceWorkerGlobalScopeEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;
declare function addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void;
declare function removeEventListener<K extends keyof ServiceWorkerGlobalScopeEventMap>(type: K, listener: (this: ServiceWorkerGlobalScope, ev: ServiceWorkerGlobalScopeEventMap[K]) => any, options?: boolean | EventListenerOptions): void;
Expand Down
21 changes: 21 additions & 0 deletions baselines/sharedworker.generated.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -334,6 +334,11 @@ interface MultiCacheQueryOptions extends CacheQueryOptions {
cacheName?: string;
}

interface NavigationPreloadState {
enabled?: boolean;
headerValue?: string;
}

interface NotificationAction {
action: string;
icon?: string;
Expand Down Expand Up @@ -1963,6 +1968,7 @@ declare var ImageBitmapRenderingContext: {

/** The underlying pixel data of an area of a <canvas> element. It is created using the ImageData() constructor or creator methods on the CanvasRenderingContext2D object associated with a canvas: createImageData() and getImageData(). It can also be used to set a part of the canvas by using putImageData(). */
interface ImageData {
readonly colorSpace: PredefinedColorSpace;
/** Returns the one-dimensional array containing the data in RGBA order, as integers in the range 0 to 255. */
readonly data: Uint8ClampedArray;
/** Returns the actual dimensions of the data in the ImageData object, in pixels. */
Expand Down Expand Up @@ -2079,6 +2085,19 @@ declare var MessagePort: {
new(): MessagePort;
};

/** Available only in secure contexts. */
interface NavigationPreloadManager {
disable(): Promise<void>;
enable(): Promise<void>;
getState(): Promise<NavigationPreloadState>;
setHeaderValue(value: string): Promise<void>;
}

declare var NavigationPreloadManager: {
prototype: NavigationPreloadManager;
new(): NavigationPreloadManager;
};

interface NavigatorConcurrentHardware {
readonly hardwareConcurrency: number;
}
Expand Down Expand Up @@ -4968,6 +4987,7 @@ interface WindowOrWorkerGlobalScope {
reportError(e: any): void;
setInterval(handler: TimerHandler, timeout?: number, ...arguments: any[]): number;
setTimeout(handler: TimerHandler, timeout?: number, ...arguments: any[]): number;
structuredClone(value: any, options?: StructuredSerializeOptions): any;
}

interface WorkerEventMap extends AbstractWorkerEventMap {
Expand Down Expand Up @@ -5499,6 +5519,7 @@ declare function queueMicrotask(callback: VoidFunction): void;
declare function reportError(e: any): void;
declare function setInterval(handler: TimerHandler, timeout?: number, ...arguments: any[]): number;
declare function setTimeout(handler: TimerHandler, timeout?: number, ...arguments: any[]): number;
declare function structuredClone(value: any, options?: StructuredSerializeOptions): any;
declare function addEventListener<K extends keyof SharedWorkerGlobalScopeEventMap>(type: K, listener: (this: SharedWorkerGlobalScope, ev: SharedWorkerGlobalScopeEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;
declare function addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void;
declare function removeEventListener<K extends keyof SharedWorkerGlobalScopeEventMap>(type: K, listener: (this: SharedWorkerGlobalScope, ev: SharedWorkerGlobalScopeEventMap[K]) => any, options?: boolean | EventListenerOptions): void;
Expand Down
85 changes: 85 additions & 0 deletions baselines/webworker.generated.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -359,6 +359,11 @@ interface MultiCacheQueryOptions extends CacheQueryOptions {
cacheName?: string;
}

interface NavigationPreloadState {
enabled?: boolean;
headerValue?: string;
}

interface NotificationAction {
action: string;
icon?: string;
Expand Down Expand Up @@ -455,6 +460,22 @@ interface QueuingStrategyInit {
highWaterMark: number;
}

interface RTCEncodedAudioFrameMetadata {
contributingSources?: number[];
synchronizationSource?: number;
}

interface RTCEncodedVideoFrameMetadata {
contributingSources?: number[];
dependencies?: number[];
frameId?: number;
height?: number;
spatialIndex?: number;
synchronizationSource?: number;
temporalIndex?: number;
width?: number;
}

interface ReadableStreamDefaultReadDoneResult {
done: true;
value?: undefined;
Expand Down Expand Up @@ -628,6 +649,13 @@ interface UnderlyingSource<R = any> {
type?: undefined;
}

interface VideoColorSpaceInit {
fullRange?: boolean;
matrix?: VideoMatrixCoefficients;
primaries?: VideoColorPrimaries;
transfer?: VideoTransferCharacteristics;
}

interface VideoConfiguration {
bitrate: number;
colorGamut?: ColorGamut;
Expand Down Expand Up @@ -1442,6 +1470,7 @@ declare var ExtendableMessageEvent: {
interface FetchEvent extends ExtendableEvent {
readonly clientId: string;
readonly handled: Promise<undefined>;
readonly preloadResponse: Promise<any>;
readonly request: Request;
readonly resultingClientId: string;
respondWith(r: Response | PromiseLike<Response>): void;
Expand Down Expand Up @@ -2095,6 +2124,7 @@ declare var ImageBitmapRenderingContext: {

/** The underlying pixel data of an area of a <canvas> element. It is created using the ImageData() constructor or creator methods on the CanvasRenderingContext2D object associated with a canvas: createImageData() and getImageData(). It can also be used to set a part of the canvas by using putImageData(). */
interface ImageData {
readonly colorSpace: PredefinedColorSpace;
/** Returns the one-dimensional array containing the data in RGBA order, as integers in the range 0 to 255. */
readonly data: Uint8ClampedArray;
/** Returns the actual dimensions of the data in the ImageData object, in pixels. */
Expand Down Expand Up @@ -2211,6 +2241,19 @@ declare var MessagePort: {
new(): MessagePort;
};

/** Available only in secure contexts. */
interface NavigationPreloadManager {
disable(): Promise<void>;
enable(): Promise<void>;
getState(): Promise<NavigationPreloadState>;
setHeaderValue(value: string): Promise<void>;
}

declare var NavigationPreloadManager: {
prototype: NavigationPreloadManager;
new(): NavigationPreloadManager;
};

interface NavigatorConcurrentHardware {
readonly hardwareConcurrency: number;
}
Expand Down Expand Up @@ -2609,6 +2652,29 @@ declare var PushSubscriptionOptions: {
new(): PushSubscriptionOptions;
};

interface RTCEncodedAudioFrame {
data: ArrayBuffer;
readonly timestamp: number;
getMetadata(): RTCEncodedAudioFrameMetadata;
}

declare var RTCEncodedAudioFrame: {
prototype: RTCEncodedAudioFrame;
new(): RTCEncodedAudioFrame;
};

interface RTCEncodedVideoFrame {
data: ArrayBuffer;
readonly timestamp: number;
readonly type: RTCEncodedVideoFrameType;
getMetadata(): RTCEncodedVideoFrameMetadata;
}

declare var RTCEncodedVideoFrame: {
prototype: RTCEncodedVideoFrame;
new(): RTCEncodedVideoFrame;
};

/** This Streams API interface represents a readable stream of byte data. The Fetch API offers a concrete instance of a ReadableStream through the body property of a Response object. */
interface ReadableStream<R = any> {
readonly locked: boolean;
Expand Down Expand Up @@ -3075,6 +3141,19 @@ declare var URLSearchParams: {
toString(): string;
};

interface VideoColorSpace {
readonly fullRange: boolean | null;
readonly matrix: VideoMatrixCoefficients | null;
readonly primaries: VideoColorPrimaries | null;
readonly transfer: VideoTransferCharacteristics | null;
toJSON(): VideoColorSpaceInit;
}

declare var VideoColorSpace: {
prototype: VideoColorSpace;
new(init?: VideoColorSpaceInit): VideoColorSpace;
};

interface WEBGL_color_buffer_float {
readonly FRAMEBUFFER_ATTACHMENT_COMPONENT_TYPE_EXT: GLenum;
readonly RGBA32F_EXT: GLenum;
Expand Down Expand Up @@ -5188,6 +5267,7 @@ interface WindowOrWorkerGlobalScope {
reportError(e: any): void;
setInterval(handler: TimerHandler, timeout?: number, ...arguments: any[]): number;
setTimeout(handler: TimerHandler, timeout?: number, ...arguments: any[]): number;
structuredClone(value: any, options?: StructuredSerializeOptions): any;
}

interface WorkerEventMap extends AbstractWorkerEventMap {
Expand Down Expand Up @@ -5727,6 +5807,7 @@ declare function queueMicrotask(callback: VoidFunction): void;
declare function reportError(e: any): void;
declare function setInterval(handler: TimerHandler, timeout?: number, ...arguments: any[]): number;
declare function setTimeout(handler: TimerHandler, timeout?: number, ...arguments: any[]): number;
declare function structuredClone(value: any, options?: StructuredSerializeOptions): any;
declare function cancelAnimationFrame(handle: number): void;
declare function requestAnimationFrame(callback: FrameRequestCallback): number;
declare function addEventListener<K extends keyof DedicatedWorkerGlobalScopeEventMap>(type: K, listener: (this: DedicatedWorkerGlobalScope, ev: DedicatedWorkerGlobalScopeEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;
Expand Down Expand Up @@ -5807,6 +5888,7 @@ type PermissionState = "denied" | "granted" | "prompt";
type PredefinedColorSpace = "display-p3" | "srgb";
type PremultiplyAlpha = "default" | "none" | "premultiply";
type PushEncryptionKeyName = "auth" | "p256dh";
type RTCEncodedVideoFrameType = "delta" | "empty" | "key";
type ReferrerPolicy = "" | "no-referrer" | "no-referrer-when-downgrade" | "origin" | "origin-when-cross-origin" | "same-origin" | "strict-origin" | "strict-origin-when-cross-origin" | "unsafe-url";
type RequestCache = "default" | "force-cache" | "no-cache" | "no-store" | "only-if-cached" | "reload";
type RequestCredentials = "include" | "omit" | "same-origin";
Expand All @@ -5819,6 +5901,9 @@ type SecurityPolicyViolationEventDisposition = "enforce" | "report";
type ServiceWorkerState = "activated" | "activating" | "installed" | "installing" | "parsed" | "redundant";
type ServiceWorkerUpdateViaCache = "all" | "imports" | "none";
type TransferFunction = "hlg" | "pq" | "srgb";
type VideoColorPrimaries = "bt470bg" | "bt709" | "smpte170m";
type VideoMatrixCoefficients = "bt470bg" | "bt709" | "rgb" | "smpte170m";
type VideoTransferCharacteristics = "bt709" | "iec61966-2-1" | "smpte170m";
type WebGLPowerPreference = "default" | "high-performance" | "low-power";
type WorkerType = "classic" | "module";
type XMLHttpRequestResponseType = "" | "arraybuffer" | "blob" | "document" | "json" | "text";
14 changes: 7 additions & 7 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 3 additions & 0 deletions src/build/helpers.ts
Original file line number Diff line number Diff line change
Expand Up @@ -99,6 +99,9 @@ export function exposesTo(o: { exposed?: string }, target: string[]): boolean {
if (!o || typeof o.exposed !== "string") {
return true;
}
if (o.exposed === "*") {
return true;
}
return o.exposed.split(" ").some((e) => target.includes(e));
}

Expand Down
3 changes: 3 additions & 0 deletions src/build/widlprocess.ts
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,9 @@ function getExtAttr(extAttrs: webidl2.ExtendedAttribute[], name: string) {
if (!attr || !attr.rhs) {
return [];
}
if (attr.rhs.type === ("*" as any)) {
return ["*"];
}
return attr.rhs.type === "identifier-list" ||
attr.rhs.type === "string-list" ||
attr.rhs.type === "decimal-list" ||
Expand Down