Skip to content

Commit

Permalink
General type updates
Browse files Browse the repository at this point in the history
  • Loading branch information
saschanaz committed Nov 23, 2019
1 parent 4d745be commit 720ea39
Show file tree
Hide file tree
Showing 21 changed files with 332 additions and 204 deletions.
62 changes: 26 additions & 36 deletions baselines/dom.generated.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1674,6 +1674,13 @@ interface ShadowRootInit {
mode: ShadowRootMode;
}

interface StaticRangeInit {
endContainer: Node;
endOffset: number;
startContainer: Node;
startOffset: number;
}

interface StereoPannerOptions extends AudioNodeOptions {
pan?: number;
}
Expand Down Expand Up @@ -2140,8 +2147,8 @@ interface AudioBuffer {
readonly length: number;
readonly numberOfChannels: number;
readonly sampleRate: number;
copyFromChannel(destination: Float32Array, channelNumber: number, startInChannel?: number): void;
copyToChannel(source: Float32Array, channelNumber: number, startInChannel?: number): void;
copyFromChannel(destination: Float32Array, channelNumber: number, bufferOffset?: number): void;
copyToChannel(source: Float32Array, channelNumber: number, bufferOffset?: number): void;
getChannelData(channel: number): Float32Array;
}

Expand Down Expand Up @@ -2509,7 +2516,10 @@ declare var BiquadFilterNode: {
interface Blob {
readonly size: number;
readonly type: string;
arrayBuffer(): Promise<ArrayBuffer>;
slice(start?: number, end?: number, contentType?: string): Blob;
stream(): ReadableStream;
text(): Promise<string>;
}

declare var Blob: {
Expand Down Expand Up @@ -3150,7 +3160,8 @@ interface CSSStyleDeclaration {
webkitBoxFlex: string;
/** @deprecated */
webkitBoxOrdinalGroup: string;
webkitBoxOrient: string | null;
/** @deprecated */
webkitBoxOrient: string;
/** @deprecated */
webkitBoxPack: string;
/** @deprecated */
Expand Down Expand Up @@ -3817,7 +3828,7 @@ declare var CryptoKeyPair: {
};

interface CustomElementRegistry {
define(name: string, constructor: Function, options?: ElementDefinitionOptions): void;
define(name: string, constructor: CustomElementConstructor, options?: ElementDefinitionOptions): void;
get(name: string): any;
upgrade(root: Node): void;
whenDefined(name: string): Promise<void>;
Expand Down Expand Up @@ -4504,10 +4515,6 @@ interface Document extends Node, DocumentAndElementEventHandlers, DocumentOrShad
* Sets or gets the URL for the current document.
*/
readonly URL: string;
/**
* Gets the object that has the focus when the parent document has focus.
*/
readonly activeElement: Element | null;
/**
* Sets or gets the color of all active links in the document.
*/
Expand Down Expand Up @@ -5508,7 +5515,7 @@ interface EventTarget {
*
* When set to true, options's capture prevents callback from being invoked when the event's eventPhase attribute value is BUBBLING_PHASE. When false (or not present), callback will not be invoked when event's eventPhase attribute value is CAPTURING_PHASE. Either way, callback will be invoked if event's eventPhase attribute value is AT_TARGET.
*
* When set to true, options's passive indicates that the callback will not cancel the event by invoking preventDefault(). This is used to enable performance optimizations described in §2.8 Observing event listeners.
* When set to true, options's passive indicates that the callback will not cancel the event by invoking preventDefault(). This is used to enable performance optimizations described in § 2.8 Observing event listeners.
*
* When set to true, options's once indicates that the callback will only be invoked once after which the event listener will be removed.
*
Expand Down Expand Up @@ -5813,7 +5820,6 @@ interface GlobalEventHandlersEventMap {
"load": Event;
"loadeddata": Event;
"loadedmetadata": Event;
"loadend": ProgressEvent;
"loadstart": Event;
"lostpointercapture": PointerEvent;
"mousedown": MouseEvent;
Expand Down Expand Up @@ -5998,7 +6004,6 @@ interface GlobalEventHandlers {
* @param ev The event.
*/
onloadedmetadata: ((this: GlobalEventHandlers, ev: Event) => any) | null;
onloadend: ((this: GlobalEventHandlers, ev: ProgressEvent) => any) | null;
/**
* Occurs when Internet Explorer begins looking for media data.
* @param ev The event.
Expand Down Expand Up @@ -6420,10 +6425,6 @@ declare var HTMLBodyElement: {

/** Provides properties and methods (beyond the regular HTMLElement interface it also has available to it by inheritance) for manipulating <button> elements. */
interface HTMLButtonElement extends HTMLElement {
/**
* Provides a way to direct a user to a specific field when a document loads. This can provide both direction and convenience for a user, reducing the need to click or tab to a field when a page opens. This attribute is true when present on an element, and false when missing.
*/
autofocus: boolean;
disabled: boolean;
/**
* Retrieves a reference to the form that the object is embedded in.
Expand Down Expand Up @@ -7270,10 +7271,6 @@ interface HTMLInputElement extends HTMLElement {
* Specifies whether autocomplete is applied to an editable text field.
*/
autocomplete: string;
/**
* Provides a way to direct a user to a specific field when a document loads. This can provide both direction and convenience for a user, reducing the need to click or tab to a field when a page opens. This attribute is true when present on an element, and false when missing.
*/
autofocus: boolean;
/**
* Sets or retrieves the state of the check box or radio button.
*/
Expand Down Expand Up @@ -8159,6 +8156,7 @@ declare var HTMLOptionsCollection: {
};

interface HTMLOrSVGElement {
autofocus: boolean;
readonly dataset: DOMStringMap;
nonce?: string;
tabIndex: number;
Expand Down Expand Up @@ -8367,10 +8365,6 @@ declare var HTMLScriptElement: {
/** A <select> HTML Element. These elements also share all of the properties and methods of other HTML elements via the HTMLElement interface. */
interface HTMLSelectElement extends HTMLElement {
autocomplete: string;
/**
* Provides a way to direct a user to a specific field when a document loads. This can provide both direction and convenience for a user, reducing the need to click or tab to a field when a page opens. This attribute is true when present on an element, and false when missing.
*/
autofocus: boolean;
disabled: boolean;
/**
* Retrieves a reference to the form that the object is embedded in.
Expand Down Expand Up @@ -8907,10 +8901,6 @@ declare var HTMLTemplateElement: {
/** Provides special properties and methods for manipulating the layout and presentation of <textarea> elements. */
interface HTMLTextAreaElement extends HTMLElement {
autocomplete: string;
/**
* Provides a way to direct a user to a specific field when a document loads. This can provide both direction and convenience for a user, reducing the need to click or tab to a field when a page opens. This attribute is true when present on an element, and false when missing.
*/
autofocus: boolean;
/**
* Sets or retrieves the width of the object.
*/
Expand Down Expand Up @@ -15455,7 +15445,7 @@ interface StaticRange extends AbstractRange {

declare var StaticRange: {
prototype: StaticRange;
new(): StaticRange;
new(init: StaticRangeInit): StaticRange;
};

/** The pan property takes a unitless value between -1 (full left pan) and 1 (full right pan). This interface was introduced as a much simpler way to apply a simple panning effect than having to use a full PannerNode. */
Expand Down Expand Up @@ -18536,7 +18526,7 @@ interface WindowEventMap extends GlobalEventHandlersEventMap, WindowEventHandler
}

/** A window containing a DOM document; the document property points to the DOM document loaded in that window. */
interface Window extends EventTarget, AnimationFrameProvider, GlobalEventHandlers, IDBEnvironment, WindowBase64, WindowConsole, WindowEventHandlers, WindowLocalStorage, WindowOrWorkerGlobalScope, WindowSessionStorage, WindowTimers {
interface Window extends EventTarget, AnimationFrameProvider, GlobalEventHandlers, IDBEnvironment, WindowBase64, WindowConsole, WindowEventHandlers, WindowLocalStorage, WindowOrWorkerGlobalScope, WindowSessionStorage {
readonly applicationCache: ApplicationCache;
readonly caches: CacheStorage;
readonly clientInformation: Navigator;
Expand Down Expand Up @@ -18738,7 +18728,7 @@ interface WindowOrWorkerGlobalScope {
createImageBitmap(image: ImageBitmapSource): Promise<ImageBitmap>;
createImageBitmap(image: ImageBitmapSource, sx: number, sy: number, sw: number, sh: number): Promise<ImageBitmap>;
fetch(input: RequestInfo, init?: RequestInit): Promise<Response>;
queueMicrotask(callback: Function): void;
queueMicrotask(callback: VoidFunction): void;
setInterval(handler: TimerHandler, timeout?: number, ...arguments: any[]): number;
setTimeout(handler: TimerHandler, timeout?: number, ...arguments: any[]): number;
}
Expand All @@ -18747,9 +18737,6 @@ interface WindowSessionStorage {
readonly sessionStorage: Storage;
}

interface WindowTimers {
}

interface WorkerEventMap extends AbstractWorkerEventMap {
"message": MessageEvent;
}
Expand Down Expand Up @@ -19211,6 +19198,10 @@ interface BlobCallback {
(blob: Blob | null): void;
}

interface CustomElementConstructor {
(): any;
}

interface DecodeErrorCallback {
(error: DOMException): void;
}
Expand Down Expand Up @@ -19797,7 +19788,6 @@ declare var onloadeddata: ((this: Window, ev: Event) => any) | null;
* @param ev The event.
*/
declare var onloadedmetadata: ((this: Window, ev: Event) => any) | null;
declare var onloadend: ((this: Window, ev: ProgressEvent) => any) | null;
/**
* Occurs when Internet Explorer begins looking for media data.
* @param ev The event.
Expand Down Expand Up @@ -19946,7 +19936,7 @@ declare function clearTimeout(handle?: number): void;
declare function createImageBitmap(image: ImageBitmapSource): Promise<ImageBitmap>;
declare function createImageBitmap(image: ImageBitmapSource, sx: number, sy: number, sw: number, sh: number): Promise<ImageBitmap>;
declare function fetch(input: RequestInfo, init?: RequestInit): Promise<Response>;
declare function queueMicrotask(callback: Function): void;
declare function queueMicrotask(callback: VoidFunction): void;
declare function setInterval(handler: TimerHandler, timeout?: number, ...arguments: any[]): number;
declare function setTimeout(handler: TimerHandler, timeout?: number, ...arguments: any[]): number;
declare var sessionStorage: Storage;
Expand Down Expand Up @@ -20151,7 +20141,7 @@ type ScrollLogicalPosition = "start" | "center" | "end" | "nearest";
type ScrollRestoration = "auto" | "manual";
type ScrollSetting = "" | "up";
type SelectionMode = "select" | "start" | "end" | "preserve";
type ServiceWorkerState = "installing" | "installed" | "activating" | "activated" | "redundant";
type ServiceWorkerState = "parsed" | "installing" | "installed" | "activating" | "activated" | "redundant";
type ServiceWorkerUpdateViaCache = "imports" | "all" | "none";
type ShadowRootMode = "open" | "closed";
type SpeechRecognitionErrorCode = "no-speech" | "aborted" | "audio-capture" | "network" | "not-allowed" | "service-not-allowed" | "bad-grammar" | "language-not-supported";
Expand Down
20 changes: 14 additions & 6 deletions baselines/webworker.generated.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -350,7 +350,7 @@ interface PushPermissionDescriptor extends PermissionDescriptor {
userVisibleOnly?: boolean;
}

interface PushSubscriptionChangeInit extends ExtendableEventInit {
interface PushSubscriptionChangeEventInit extends ExtendableEventInit {
newSubscription?: PushSubscription;
oldSubscription?: PushSubscription;
}
Expand Down Expand Up @@ -632,7 +632,10 @@ interface AnimationFrameProvider {
interface Blob {
readonly size: number;
readonly type: string;
arrayBuffer(): Promise<ArrayBuffer>;
slice(start?: number, end?: number, contentType?: string): Blob;
stream(): ReadableStream;
text(): Promise<string>;
}

declare var Blob: {
Expand Down Expand Up @@ -1465,7 +1468,7 @@ interface EventTarget {
*
* When set to true, options's capture prevents callback from being invoked when the event's eventPhase attribute value is BUBBLING_PHASE. When false (or not present), callback will not be invoked when event's eventPhase attribute value is CAPTURING_PHASE. Either way, callback will be invoked if event's eventPhase attribute value is AT_TARGET.
*
* When set to true, options's passive indicates that the callback will not cancel the event by invoking preventDefault(). This is used to enable performance optimizations described in §2.8 Observing event listeners.
* When set to true, options's passive indicates that the callback will not cancel the event by invoking preventDefault(). This is used to enable performance optimizations described in § 2.8 Observing event listeners.
*
* When set to true, options's once indicates that the callback will only be invoked once after which the event listener will be removed.
*
Expand Down Expand Up @@ -2705,7 +2708,7 @@ interface PushSubscriptionChangeEvent extends ExtendableEvent {

declare var PushSubscriptionChangeEvent: {
prototype: PushSubscriptionChangeEvent;
new(type: string, eventInitDict?: PushSubscriptionChangeInit): PushSubscriptionChangeEvent;
new(type: string, eventInitDict?: PushSubscriptionChangeEventInit): PushSubscriptionChangeEvent;
};

interface PushSubscriptionOptions {
Expand Down Expand Up @@ -2948,6 +2951,7 @@ interface ServiceWorkerGlobalScope extends WorkerGlobalScope {
onpushsubscriptionchange: ((this: ServiceWorkerGlobalScope, ev: PushSubscriptionChangeEvent) => any) | null;
onsync: ((this: ServiceWorkerGlobalScope, ev: SyncEvent) => any) | null;
readonly registration: ServiceWorkerRegistration;
readonly serviceWorker: ServiceWorker;
skipWaiting(): Promise<void>;
addEventListener<K extends keyof ServiceWorkerGlobalScopeEventMap>(type: K, listener: (this: ServiceWorkerGlobalScope, ev: ServiceWorkerGlobalScopeEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;
addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void;
Expand Down Expand Up @@ -5336,7 +5340,7 @@ interface WindowOrWorkerGlobalScope {
createImageBitmap(image: ImageBitmapSource): Promise<ImageBitmap>;
createImageBitmap(image: ImageBitmapSource, sx: number, sy: number, sw: number, sh: number): Promise<ImageBitmap>;
fetch(input: RequestInfo, init?: RequestInit): Promise<Response>;
queueMicrotask(callback: Function): void;
queueMicrotask(callback: VoidFunction): void;
setInterval(handler: TimerHandler, timeout?: number, ...arguments: any[]): number;
setTimeout(handler: TimerHandler, timeout?: number, ...arguments: any[]): number;
}
Expand Down Expand Up @@ -5741,6 +5745,10 @@ interface TransformStreamDefaultControllerTransformCallback<I, O> {
(chunk: I, controller: TransformStreamDefaultController<O>): void | PromiseLike<void>;
}

interface VoidFunction {
(): void;
}

interface WritableStreamDefaultControllerCloseCallback {
(): void | PromiseLike<void>;
}
Expand Down Expand Up @@ -5795,7 +5803,7 @@ declare function clearTimeout(handle?: number): void;
declare function createImageBitmap(image: ImageBitmapSource): Promise<ImageBitmap>;
declare function createImageBitmap(image: ImageBitmapSource, sx: number, sy: number, sw: number, sh: number): Promise<ImageBitmap>;
declare function fetch(input: RequestInfo, init?: RequestInit): Promise<Response>;
declare function queueMicrotask(callback: Function): void;
declare function queueMicrotask(callback: VoidFunction): void;
declare function setInterval(handler: TimerHandler, timeout?: number, ...arguments: any[]): number;
declare function setTimeout(handler: TimerHandler, timeout?: number, ...arguments: any[]): number;
declare function cancelAnimationFrame(handle: number): void;
Expand Down Expand Up @@ -5874,7 +5882,7 @@ type RequestDestination = "" | "audio" | "audioworklet" | "document" | "embed" |
type RequestMode = "navigate" | "same-origin" | "no-cors" | "cors";
type RequestRedirect = "follow" | "error" | "manual";
type ResponseType = "basic" | "cors" | "default" | "error" | "opaque" | "opaqueredirect";
type ServiceWorkerState = "installing" | "installed" | "activating" | "activated" | "redundant";
type ServiceWorkerState = "parsed" | "installing" | "installed" | "activating" | "activated" | "redundant";
type ServiceWorkerUpdateViaCache = "imports" | "all" | "none";
type VisibilityState = "hidden" | "visible";
type WebGLPowerPreference = "default" | "low-power" | "high-performance";
Expand Down
4 changes: 4 additions & 0 deletions inputfiles/addedTypes.json
Original file line number Diff line number Diff line change
Expand Up @@ -489,6 +489,10 @@
"userSelect": {
"name": "userSelect",
"type": "CSSOMString"
},
"webkitAppearance": {
"nullable": 0,
"deprecated": 1
}
}
}
Expand Down
Loading

0 comments on commit 720ea39

Please sign in to comment.