Skip to content

General type updates #679

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
Apr 8, 2019
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
33 changes: 20 additions & 13 deletions baselines/dom.generated.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -151,7 +151,6 @@ interface ByteLengthChunk {
}

interface CacheQueryOptions {
cacheName?: string;
ignoreMethod?: boolean;
ignoreSearch?: boolean;
ignoreVary?: boolean;
Expand Down Expand Up @@ -760,6 +759,10 @@ interface MouseEventInit extends EventModifierInit {
screenY?: number;
}

interface MultiCacheQueryOptions extends CacheQueryOptions {
cacheName?: string;
}

interface MutationObserverInit {
attributeFilter?: string[];
attributeOldValue?: boolean;
Expand Down Expand Up @@ -909,7 +912,8 @@ interface Pbkdf2Params extends Algorithm {

interface PerformanceObserverInit {
buffered?: boolean;
entryTypes: string[];
entryTypes?: string[];
type?: string;
}

interface PeriodicWaveConstraints {
Expand Down Expand Up @@ -955,6 +959,10 @@ interface PositionOptions {
timeout?: number;
}

interface PostMessageOptions {
transfer?: any[];
}

interface ProgressEventInit extends EventInit {
lengthComputable?: boolean;
loaded?: number;
Expand Down Expand Up @@ -1965,6 +1973,7 @@ interface AudioContext extends BaseAudioContext {
createMediaStreamSource(mediaStream: MediaStream): MediaStreamAudioSourceNode;
createMediaStreamTrackSource(mediaStreamTrack: MediaStreamTrack): MediaStreamTrackAudioSourceNode;
getOutputTimestamp(): AudioTimestamp;
resume(): Promise<void>;
suspend(): Promise<void>;
addEventListener<K extends keyof BaseAudioContextEventMap>(type: K, listener: (this: AudioContext, ev: BaseAudioContextEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;
addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void;
Expand Down Expand Up @@ -2202,7 +2211,6 @@ interface BaseAudioContext extends EventTarget {
createStereoPanner(): StereoPannerNode;
createWaveShaper(): WaveShaperNode;
decodeAudioData(audioData: ArrayBuffer, successCallback?: DecodeSuccessCallback | null, errorCallback?: DecodeErrorCallback | null): Promise<AudioBuffer>;
resume(): Promise<void>;
addEventListener<K extends keyof BaseAudioContextEventMap>(type: K, listener: (this: BaseAudioContext, ev: BaseAudioContextEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;
addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void;
removeEventListener<K extends keyof BaseAudioContextEventMap>(type: K, listener: (this: BaseAudioContext, ev: BaseAudioContextEventMap[K]) => any, options?: boolean | EventListenerOptions): void;
Expand Down Expand Up @@ -7161,6 +7169,8 @@ interface HTMLLinkElement extends HTMLElement, LinkStyle {
* Sets or retrieves the language code of the object.
*/
hreflang: string;
imageSizes: string;
imageSrcset: string;
integrity: string;
/**
* Sets or retrieves the media type.
Expand Down Expand Up @@ -10282,14 +10292,8 @@ interface MessagePort extends EventTarget {
* Disconnects the port, so that it is no longer active.
*/
close(): void;
/**
* Posts a message through the channel. Objects listed in transfer are
* transferred, not just cloned, meaning that they are no longer usable on the sending side.
* Throws a "DataCloneError" DOMException if
* transfer contains duplicate objects or port, or if message
* could not be cloned.
*/
postMessage(message: any, transfer?: Transferable[]): void;
postMessage(message: any, transfer: Transferable[]): void;
postMessage(message: any, options?: PostMessageOptions): void;
/**
* Begins dispatching messages received on the port.
*/
Expand Down Expand Up @@ -10931,6 +10935,7 @@ interface OfflineAudioContextEventMap extends BaseAudioContextEventMap {
interface OfflineAudioContext extends BaseAudioContext {
readonly length: number;
oncomplete: ((this: OfflineAudioContext, ev: OfflineAudioCompletionEvent) => any) | null;
resume(): Promise<void>;
startRendering(): Promise<AudioBuffer>;
suspend(suspendTime: number): Promise<void>;
addEventListener<K extends keyof OfflineAudioContextEventMap>(type: K, listener: (this: OfflineAudioContext, ev: OfflineAudioContextEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;
Expand Down Expand Up @@ -11284,13 +11289,14 @@ declare var PerformanceNavigationTiming: {

interface PerformanceObserver {
disconnect(): void;
observe(options: PerformanceObserverInit): void;
observe(options?: PerformanceObserverInit): void;
takeRecords(): PerformanceEntryList;
}

declare var PerformanceObserver: {
prototype: PerformanceObserver;
new(callback: PerformanceObserverCallback): PerformanceObserver;
readonly supportedEntryTypes: ReadonlyArray<string>;
};

interface PerformanceObserverEntryList {
Expand Down Expand Up @@ -14583,7 +14589,8 @@ interface ServiceWorker extends EventTarget, AbstractWorker {
onstatechange: ((this: ServiceWorker, ev: Event) => any) | null;
readonly scriptURL: string;
readonly state: ServiceWorkerState;
postMessage(message: any, transfer?: Transferable[]): void;
postMessage(message: any, transfer: Transferable[]): void;
postMessage(message: any, options?: PostMessageOptions): void;
addEventListener<K extends keyof ServiceWorkerEventMap>(type: K, listener: (this: ServiceWorker, ev: ServiceWorkerEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;
addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void;
removeEventListener<K extends keyof ServiceWorkerEventMap>(type: K, listener: (this: ServiceWorker, ev: ServiceWorkerEventMap[K]) => any, options?: boolean | EventListenerOptions): void;
Expand Down
40 changes: 24 additions & 16 deletions baselines/webworker.generated.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,6 @@ interface BlobPropertyBag {
}

interface CacheQueryOptions {
cacheName?: string;
ignoreMethod?: boolean;
ignoreSearch?: boolean;
ignoreVary?: boolean;
Expand Down Expand Up @@ -177,9 +176,9 @@ interface ExtendableMessageEventInit extends ExtendableEventInit {
interface FetchEventInit extends ExtendableEventInit {
clientId?: string;
preloadResponse?: Promise<any>;
replacesClientId?: string;
request: Request;
resultingClientId?: string;
targetClientId?: string;
}

interface FilePropertyBag extends BlobPropertyBag {
Expand Down Expand Up @@ -253,6 +252,10 @@ interface MidiPermissionDescriptor extends PermissionDescriptor {
sysex?: boolean;
}

interface MultiCacheQueryOptions extends CacheQueryOptions {
cacheName?: string;
}

interface NavigationPreloadState {
enabled?: boolean;
headerValue?: string;
Expand Down Expand Up @@ -294,7 +297,8 @@ interface Pbkdf2Params extends Algorithm {

interface PerformanceObserverInit {
buffered?: boolean;
entryTypes: string[];
entryTypes?: string[];
type?: string;
}

interface PermissionDescriptor {
Expand All @@ -308,6 +312,10 @@ interface PipeOptions {
signal?: AbortSignal;
}

interface PostMessageOptions {
transfer?: any[];
}

interface ProgressEventInit extends EventInit {
lengthComputable?: boolean;
loaded?: number;
Expand Down Expand Up @@ -692,6 +700,7 @@ declare var CanvasPattern: {

/** The Client interface represents an executable context such as a Worker, or a SharedWorker. Window clients are represented by the more-specific WindowClient. You can get Client/WindowClient objects from methods such as Clients.matchAll() and Clients.get(). */
interface Client {
readonly frameType: FrameType;
readonly id: string;
readonly type: ClientTypes;
readonly url: string;
Expand Down Expand Up @@ -1087,7 +1096,8 @@ interface DedicatedWorkerGlobalScopeEventMap extends WorkerGlobalScopeEventMap {
interface DedicatedWorkerGlobalScope extends WorkerGlobalScope {
onmessage: ((this: DedicatedWorkerGlobalScope, ev: MessageEvent) => any) | null;
close(): void;
postMessage(message: any, transfer?: Transferable[]): void;
postMessage(message: any, transfer: Transferable[]): void;
postMessage(message: any, options?: PostMessageOptions): void;
addEventListener<K extends keyof DedicatedWorkerGlobalScopeEventMap>(type: K, listener: (this: DedicatedWorkerGlobalScope, ev: DedicatedWorkerGlobalScopeEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;
addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void;
removeEventListener<K extends keyof DedicatedWorkerGlobalScopeEventMap>(type: K, listener: (this: DedicatedWorkerGlobalScope, ev: DedicatedWorkerGlobalScopeEventMap[K]) => any, options?: boolean | EventListenerOptions): void;
Expand Down Expand Up @@ -1331,9 +1341,9 @@ declare var ExtendableMessageEvent: {
interface FetchEvent extends ExtendableEvent {
readonly clientId: string;
readonly preloadResponse: Promise<any>;
readonly replacesClientId: string;
readonly request: Request;
readonly resultingClientId: string;
readonly targetClientId: string;
respondWith(r: Response | Promise<Response>): void;
}

Expand Down Expand Up @@ -2081,14 +2091,8 @@ interface MessagePort extends EventTarget {
* Disconnects the port, so that it is no longer active.
*/
close(): void;
/**
* Posts a message through the channel. Objects listed in transfer are
* transferred, not just cloned, meaning that they are no longer usable on the sending side.
* Throws a "DataCloneError" DOMException if
* transfer contains duplicate objects or port, or if message
* could not be cloned.
*/
postMessage(message: any, transfer?: Transferable[]): void;
postMessage(message: any, transfer: Transferable[]): void;
postMessage(message: any, options?: PostMessageOptions): void;
/**
* Begins dispatching messages received on the port.
*/
Expand Down Expand Up @@ -2305,13 +2309,14 @@ declare var PerformanceMeasure: {

interface PerformanceObserver {
disconnect(): void;
observe(options: PerformanceObserverInit): void;
observe(options?: PerformanceObserverInit): void;
takeRecords(): PerformanceEntryList;
}

declare var PerformanceObserver: {
prototype: PerformanceObserver;
new(callback: PerformanceObserverCallback): PerformanceObserver;
readonly supportedEntryTypes: ReadonlyArray<string>;
};

interface PerformanceObserverEntryList {
Expand Down Expand Up @@ -2655,7 +2660,8 @@ interface ServiceWorker extends EventTarget, AbstractWorker {
onstatechange: ((this: ServiceWorker, ev: Event) => any) | null;
readonly scriptURL: string;
readonly state: ServiceWorkerState;
postMessage(message: any, transfer?: Transferable[]): void;
postMessage(message: any, transfer: Transferable[]): void;
postMessage(message: any, options?: PostMessageOptions): void;
addEventListener<K extends keyof ServiceWorkerEventMap>(type: K, listener: (this: ServiceWorker, ev: ServiceWorkerEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;
addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void;
removeEventListener<K extends keyof ServiceWorkerEventMap>(type: K, listener: (this: ServiceWorker, ev: ServiceWorkerEventMap[K]) => any, options?: boolean | EventListenerOptions): void;
Expand Down Expand Up @@ -4462,7 +4468,8 @@ interface WritableStreamErrorCallback {

declare var onmessage: ((this: DedicatedWorkerGlobalScope, ev: MessageEvent) => any) | null;
declare function close(): void;
declare function postMessage(message: any, transfer?: Transferable[]): void;
declare function postMessage(message: any, transfer: Transferable[]): void;
declare function postMessage(message: any, options?: PostMessageOptions): void;
/**
* Dispatches a synthetic event event to target and returns true
* if either event's cancelable attribute value is false or its preventDefault() method was not invoked, and false otherwise.
Expand Down Expand Up @@ -4544,6 +4551,7 @@ type Transferable = ArrayBuffer | MessagePort | ImageBitmap;
type BinaryType = "blob" | "arraybuffer";
type ClientTypes = "window" | "worker" | "sharedworker" | "all";
type EndingType = "transparent" | "native";
type FrameType = "auxiliary" | "top-level" | "nested" | "none";
type IDBCursorDirection = "next" | "nextunique" | "prev" | "prevunique";
type IDBRequestReadyState = "pending" | "done";
type IDBTransactionMode = "readonly" | "readwrite" | "versionchange";
Expand Down
18 changes: 9 additions & 9 deletions inputfiles/idl/Gamepad Extensions.widl
Original file line number Diff line number Diff line change
Expand Up @@ -14,16 +14,16 @@ enum GamepadHapticActuatorType {
};

interface GamepadPose {
readonly attribute boolean hasOrientation;
readonly attribute boolean hasPosition;
readonly attribute boolean hasOrientation;
readonly attribute boolean hasPosition;

readonly attribute Float32Array? position;
readonly attribute Float32Array? linearVelocity;
readonly attribute Float32Array? linearAcceleration;
readonly attribute Float32Array? orientation;
readonly attribute Float32Array? angularVelocity;
readonly attribute Float32Array? angularAcceleration;
};
readonly attribute Float32Array? position;
readonly attribute Float32Array? linearVelocity;
readonly attribute Float32Array? linearAcceleration;
readonly attribute Float32Array? orientation;
readonly attribute Float32Array? angularVelocity;
readonly attribute Float32Array? angularAcceleration;
};

partial interface Gamepad {
readonly attribute GamepadHand hand;
Expand Down
34 changes: 17 additions & 17 deletions inputfiles/idl/Geolocation.widl
Original file line number Diff line number Diff line change
@@ -1,29 +1,29 @@
partial interface Navigator {
readonly attribute Geolocation geolocation;
};
readonly attribute Geolocation geolocation;
};

[NoInterfaceObject]
interface Geolocation {
void getCurrentPosition(PositionCallback successCallback,
optional PositionErrorCallback errorCallback,
optional PositionOptions options);
interface Geolocation {
void getCurrentPosition(PositionCallback successCallback,
optional PositionErrorCallback errorCallback,
optional PositionOptions options);

long watchPosition(PositionCallback successCallback,
optional PositionErrorCallback errorCallback,
optional PositionOptions options);
long watchPosition(PositionCallback successCallback,
optional PositionErrorCallback errorCallback,
optional PositionOptions options);

void clearWatch(long watchId);
};
void clearWatch(long watchId);
};

callback PositionCallback = void (Position position);
callback PositionCallback = void (Position position);

callback PositionErrorCallback = void (PositionError positionError);
callback PositionErrorCallback = void (PositionError positionError);

dictionary PositionOptions {
boolean enableHighAccuracy = false;
[Clamp] unsigned long timeout = 0xFFFFFFFF;
[Clamp] unsigned long maximumAge = 0;
};
boolean enableHighAccuracy = false;
[Clamp] unsigned long timeout = 0xFFFFFFFF;
[Clamp] unsigned long maximumAge = 0;
};

[NoInterfaceObject]
interface Position {
Expand Down
2 changes: 2 additions & 0 deletions inputfiles/idl/HTML - Semantics.widl
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,8 @@ interface HTMLLinkElement : HTMLElement {
[CEReactions] attribute DOMString hreflang;
[CEReactions] attribute DOMString type;
[SameObject, PutForwards=value] readonly attribute DOMTokenList sizes;
[CEReactions] attribute USVString imageSrcset;
[CEReactions] attribute DOMString imageSizes;
[CEReactions] attribute DOMString referrerPolicy;
};
HTMLLinkElement includes LinkStyle;
Expand Down
2 changes: 2 additions & 0 deletions inputfiles/idl/HTML - Web storage.widl
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,8 @@ interface StorageEvent : Event {
readonly attribute DOMString? newValue;
readonly attribute USVString url;
readonly attribute Storage? storageArea;

void initStorageEvent(DOMString type, optional boolean bubbles = false, optional boolean cancelable = false, optional DOMString? key = null, optional DOMString? oldValue = null, optional DOMString? newValue = null, optional USVString url = "", optional Storage? storageArea = null);
};

dictionary StorageEventInit : EventInit {
Expand Down
8 changes: 5 additions & 3 deletions inputfiles/idl/Performance Timeline.widl
Original file line number Diff line number Diff line change
Expand Up @@ -18,14 +18,16 @@ callback PerformanceObserverCallback = void (PerformanceObserverEntryList entrie
PerformanceObserver observer);
[Constructor(PerformanceObserverCallback callback), Exposed=(Window,Worker)]
interface PerformanceObserver {
void observe (PerformanceObserverInit options);
void observe (optional PerformanceObserverInit options);
void disconnect ();
PerformanceEntryList takeRecords();
static readonly attribute FrozenArray<DOMString> supportedEntryTypes;
};

dictionary PerformanceObserverInit {
required sequence<DOMString> entryTypes;
boolean buffered = false;
sequence<DOMString> entryTypes;
DOMString type;
boolean buffered;
};

[Exposed=(Window,Worker)]
Expand Down
2 changes: 1 addition & 1 deletion inputfiles/idl/Pointer Events.widl
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ partial interface Element {
boolean hasPointerCapture (long pointerId);
};

partial interface GlobalEventHandlers {
partial interface mixin GlobalEventHandlers {
attribute EventHandler ongotpointercapture;
attribute EventHandler onlostpointercapture;
attribute EventHandler onpointerdown;
Expand Down
Loading