Skip to content

Update Navigator type #700

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 17 commits into from
Jun 20, 2019
Merged
Show file tree
Hide file tree
Changes from 10 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
125 changes: 71 additions & 54 deletions baselines/dom.generated.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -241,10 +241,6 @@ interface ComputedKeyframe {
[property: string]: string | number | null | undefined;
}

interface ConfirmSiteSpecificExceptionsInformation extends ExceptionInformation {
arrayOfDomainStrings?: string[];
}

interface ConstantSourceOptions {
offset?: number;
}
Expand Down Expand Up @@ -483,10 +479,6 @@ interface EventSourceInit {
withCredentials?: boolean;
}

interface ExceptionInformation {
domain?: string | null;
}

interface FilePropertyBag extends BlobPropertyBag {
lastModified?: number;
}
Expand Down Expand Up @@ -1681,16 +1673,6 @@ interface StorageEventInit extends EventInit {
url?: string;
}

interface StoreExceptionsInformation extends ExceptionInformation {
detailURI?: string | null;
explanationString?: string | null;
siteName?: string | null;
}

interface StoreSiteSpecificExceptionsInformation extends StoreExceptionsInformation {
arrayOfDomainStrings?: string[];
}

interface TextDecodeOptions {
stream?: boolean;
}
Expand Down Expand Up @@ -3634,6 +3616,10 @@ interface ConcatParams extends Algorithm {
publicInfo?: Uint8Array;
}

interface ConfirmSiteSpecificExceptionsInformation extends ExceptionInformation {
arrayOfDomainStrings?: string[];
}

/** Provides access to the browser's debugging console (e.g. the Web Console in Firefox). The specifics of how it works varies from browser to browser, but there is a de facto set of features that are typically provided. */
interface Console {
memory: any;
Expand Down Expand Up @@ -5480,6 +5466,10 @@ declare var EventTarget: {
new(): EventTarget;
};

interface ExceptionInformation {
domain?: string | null;
}

interface ExtensionScriptApis {
extensionIdToShortId(extensionId: string): number;
fireExtensionApiTelemetry(functionName: string, isSucceeded: boolean, isSupported: boolean, errorString: string): void;
Expand Down Expand Up @@ -10070,6 +10060,10 @@ declare var MSInputMethodContext: {
new(): MSInputMethodContext;
};

interface MSLaunchUriCallback {
(): void;
}

interface MSMediaKeyError {
readonly code: number;
readonly systemCode: number;
Expand Down Expand Up @@ -10631,9 +10625,21 @@ declare var MessagePort: {

/** Provides contains information about a MIME type associated with a particular plugin. NavigatorPlugins.mimeTypes returns an array of this object. */
interface MimeType {
/**
* Returns the MIME type's description.
*/
readonly description: string;
/**
* Returns the Plugin object that implements this MIME type.
*/
readonly enabledPlugin: Plugin;
/**
* Returns the MIME type's typical file extensions, in a comma-separated list.
*/
readonly suffixes: string;
/**
* Returns the MIME type.
*/
readonly type: string;
}

Expand All @@ -10645,9 +10651,9 @@ declare var MimeType: {
/** Returns an array of MimeType instances, each of which contains information about a supported browser plugins. This object is returned by NavigatorPlugins.mimeTypes. */
interface MimeTypeArray {
readonly length: number;
item(index: number): Plugin;
namedItem(type: string): Plugin;
[index: number]: Plugin;
item(index: number): MimeType | null;
namedItem(name: string): MimeType | null;
[index: number]: MimeType;
}

declare var MimeTypeArray: {
Expand Down Expand Up @@ -10805,30 +10811,21 @@ declare var NavigationPreloadManager: {
};

/** The state and the identity of the user agent. It allows scripts to query it and to register themselves to carry on some activities. */
interface Navigator extends NavigatorID, NavigatorOnLine, NavigatorContentUtils, NavigatorStorageUtils, MSNavigatorDoNotTrack, MSFileSaver, NavigatorBeacon, NavigatorConcurrentHardware, NavigatorUserMedia, NavigatorLanguage, NavigatorStorage, NavigatorAutomationInformation {
readonly activeVRDisplays: ReadonlyArray<VRDisplay>;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We should restore activeVRDisplays/getVRDisplays() and NavigatorBeacon. Looks good otherwise.

readonly authentication: WebAuthentication;
interface Navigator extends NavigatorID, NavigatorLanguage, NavigatorOnLine, NavigatorContentUtils, NavigatorCookies, NavigatorPlugins, NavigatorConcurrentHardware, NavigatorStorage, NavigatorAutomationInformation, MSFileSaver, MSNavigatorDoNotTrack {
readonly clipboard: Clipboard;
readonly cookieEnabled: boolean;
readonly credentials: CredentialsContainer;
readonly doNotTrack: string | null;
gamepadInputEmulation: GamepadInputEmulationType;
readonly geolocation: Geolocation;
readonly maxTouchPoints: number;
readonly mediaDevices: MediaDevices;
readonly mimeTypes: MimeTypeArray;
readonly msManipulationViewsEnabled: boolean;
readonly msMaxTouchPoints: number;
readonly msPointerEnabled: boolean;
readonly permissions: Permissions;
readonly plugins: PluginArray;
readonly pointerEnabled: boolean;
readonly serviceWorker: ServiceWorkerContainer;
readonly webdriver: boolean;
getGamepads(): (Gamepad | null)[];
getUserMedia(constraints: MediaStreamConstraints, successCallback: NavigatorUserMediaSuccessCallback, errorCallback: NavigatorUserMediaErrorCallback): void;
getVRDisplays(): Promise<VRDisplay[]>;
javaEnabled(): boolean;
msLaunchUri(uri: string, successCallback?: MSLaunchUriCallback, noHandlerCallback?: MSLaunchUriCallback): void;
requestMediaKeySystemAccess(keySystem: string, supportedConfigurations: MediaKeySystemConfiguration[]): Promise<MediaKeySystemAccess>;
vibrate(pattern: number | number[]): boolean;
Expand All @@ -10843,27 +10840,31 @@ interface NavigatorAutomationInformation {
readonly webdriver: boolean;
}

interface NavigatorBeacon {
sendBeacon(url: string, data?: Blob | Int8Array | Int16Array | Int32Array | Uint8Array | Uint16Array | Uint32Array | Uint8ClampedArray | Float32Array | Float64Array | DataView | ArrayBuffer | FormData | string | null): boolean;
}

interface NavigatorConcurrentHardware {
readonly hardwareConcurrency: number;
}

interface NavigatorContentUtils {
registerProtocolHandler(scheme: string, url: string, title: string): void;
unregisterProtocolHandler(scheme: string, url: string): void;
}

interface NavigatorCookies {
readonly cookieEnabled: boolean;
}

interface NavigatorID {
readonly appCodeName: string;
readonly appName: string;
readonly appVersion: string;
readonly oscpu: string;
readonly platform: string;
readonly product: string;
readonly productSub: string;
readonly userAgent: string;
readonly vendor: string;
readonly vendorSub: string;
taintEnabled(): boolean;
}

interface NavigatorLanguage {
Expand All @@ -10875,17 +10876,14 @@ interface NavigatorOnLine {
readonly onLine: boolean;
}

interface NavigatorStorage {
readonly storage: StorageManager;
}

interface NavigatorStorageUtils {
interface NavigatorPlugins {
readonly mimeTypes: MimeTypeArray;
readonly plugins: PluginArray;
javaEnabled(): boolean;
}

interface NavigatorUserMedia {
readonly mediaDevices: MediaDevices;
getDisplayMedia(constraints: MediaStreamConstraints): Promise<MediaStream>;
getUserMedia(constraints: MediaStreamConstraints, successCallback: NavigatorUserMediaSuccessCallback, errorCallback: NavigatorUserMediaErrorCallback): void;
interface NavigatorStorage {
readonly storage: StorageManager;
}

/** Node is an interface from which a number of DOM API object types inherit. It allows those types to be treated similarly; for example, inheriting the same set of methods, or being tested in the same way. */
Expand Down Expand Up @@ -11839,13 +11837,27 @@ declare var Permissions: {

/** Provides information about a browser plugin. */
interface Plugin {
/**
* Returns the plugin's description.
*/
readonly description: string;
/**
* Returns the plugin library's filename, if applicable on the current platform.
*/
readonly filename: string;
/**
* Returns the number of MIME types, represented by MimeType objects, supported by the plugin.
*/
readonly length: number;
/**
* Returns the plugin's name.
*/
readonly name: string;
readonly version: string;
item(index: number): MimeType;
namedItem(type: string): MimeType;
/**
* Returns the specified MimeType object.
*/
item(index: number): MimeType | null;
namedItem(name: string): MimeType | null;
[index: number]: MimeType;
}

Expand All @@ -11857,8 +11869,8 @@ declare var Plugin: {
/** Used to store a list of Plugin objects describing the available plugins; it's returned by the window.navigator.plugins property. The PluginArray is not a JavaScript array, but has the length property and supports accessing individual items using bracket notation (plugins[2]), as well as via item(index) and namedItem("name") methods. */
interface PluginArray {
readonly length: number;
item(index: number): Plugin;
namedItem(name: string): Plugin;
item(index: number): Plugin | null;
namedItem(name: string): Plugin | null;
refresh(reload?: boolean): void;
[index: number]: Plugin;
}
Expand Down Expand Up @@ -15468,6 +15480,16 @@ declare var StorageManager: {
new(): StorageManager;
};

interface StoreExceptionsInformation extends ExceptionInformation {
detailURI?: string | null;
explanationString?: string | null;
siteName?: string | null;
}

interface StoreSiteSpecificExceptionsInformation extends StoreExceptionsInformation {
arrayOfDomainStrings?: string[];
}

interface StyleMedia {
readonly type: string;
matchMedium(mediaquery: string): boolean;
Expand Down Expand Up @@ -19153,10 +19175,6 @@ interface IntersectionObserverCallback {
(entries: IntersectionObserverEntry[], observer: IntersectionObserver): void;
}

interface MSLaunchUriCallback {
(): void;
}

interface MutationCallback {
(mutations: MutationRecord[], observer: MutationObserver): void;
}
Expand Down Expand Up @@ -19986,7 +20004,6 @@ type FillMode = "none" | "forwards" | "backwards" | "both" | "auto";
type FullscreenNavigationUI = "auto" | "show" | "hide";
type GamepadHand = "" | "left" | "right";
type GamepadHapticActuatorType = "vibration";
type GamepadInputEmulationType = "mouse" | "keyboard" | "gamepad";
type GamepadMappingType = "" | "standard";
type IDBCursorDirection = "next" | "nextunique" | "prev" | "prevunique";
type IDBRequestReadyState = "pending" | "done";
Expand Down
14 changes: 7 additions & 7 deletions baselines/dom.iterable.generated.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -134,7 +134,7 @@ interface MediaList {
}

interface MimeTypeArray {
[Symbol.iterator](): IterableIterator<Plugin>;
[Symbol.iterator](): IterableIterator<MimeType>;
}

interface NamedNodeMap {
Expand Down Expand Up @@ -273,8 +273,8 @@ interface WebAuthentication {
}

interface WebGL2RenderingContextBase {
uniformMatrix2x4fv(location: WebGLUniformLocation | null, transpose: GLboolean, data: Iterable<GLfloat>, srcOffset?: GLuint, srcLength?: GLuint): void;
invalidateFramebuffer(target: GLenum, attachments: Iterable<GLenum>): void;
invalidateSubFramebuffer(target: GLenum, attachments: Iterable<GLenum>, x: GLint, y: GLint, width: GLsizei, height: GLsizei): void;
uniform1uiv(location: WebGLUniformLocation | null, data: Iterable<GLuint>, srcOffset?: GLuint, srcLength?: GLuint): void;
uniform2uiv(location: WebGLUniformLocation | null, data: Iterable<GLuint>, srcOffset?: GLuint, srcLength?: GLuint): void;
uniform3uiv(location: WebGLUniformLocation | null, data: Iterable<GLuint>, srcOffset?: GLuint, srcLength?: GLuint): void;
Expand All @@ -283,7 +283,7 @@ interface WebGL2RenderingContextBase {
uniformMatrix4x2fv(location: WebGLUniformLocation | null, transpose: GLboolean, data: Iterable<GLfloat>, srcOffset?: GLuint, srcLength?: GLuint): void;
uniformMatrix2x3fv(location: WebGLUniformLocation | null, transpose: GLboolean, data: Iterable<GLfloat>, srcOffset?: GLuint, srcLength?: GLuint): void;
uniformMatrix4x3fv(location: WebGLUniformLocation | null, transpose: GLboolean, data: Iterable<GLfloat>, srcOffset?: GLuint, srcLength?: GLuint): void;
uniformMatrix2x4fv(location: WebGLUniformLocation | null, transpose: GLboolean, data: Iterable<GLfloat>, srcOffset?: GLuint, srcLength?: GLuint): void;
invalidateSubFramebuffer(target: GLenum, attachments: Iterable<GLenum>, x: GLint, y: GLint, width: GLsizei, height: GLsizei): void;
uniformMatrix3x4fv(location: WebGLUniformLocation | null, transpose: GLboolean, data: Iterable<GLfloat>, srcOffset?: GLuint, srcLength?: GLuint): void;
vertexAttribI4iv(index: GLuint, values: Iterable<GLint>): void;
vertexAttribI4uiv(index: GLuint, values: Iterable<GLuint>): void;
Expand All @@ -297,12 +297,12 @@ interface WebGL2RenderingContextBase {
}

interface WebGL2RenderingContextOverloads {
uniform2iv(location: WebGLUniformLocation | null, data: Iterable<GLint>, srcOffset?: GLuint, srcLength?: GLuint): void;
uniform1fv(location: WebGLUniformLocation | null, data: Iterable<GLfloat>, srcOffset?: GLuint, srcLength?: GLuint): void;
uniform2fv(location: WebGLUniformLocation | null, data: Iterable<GLfloat>, srcOffset?: GLuint, srcLength?: GLuint): void;
uniform3fv(location: WebGLUniformLocation | null, data: Iterable<GLfloat>, srcOffset?: GLuint, srcLength?: GLuint): void;
uniform4fv(location: WebGLUniformLocation | null, data: Iterable<GLfloat>, srcOffset?: GLuint, srcLength?: GLuint): void;
uniform1iv(location: WebGLUniformLocation | null, data: Iterable<GLint>, srcOffset?: GLuint, srcLength?: GLuint): void;
uniform2iv(location: WebGLUniformLocation | null, data: Iterable<GLint>, srcOffset?: GLuint, srcLength?: GLuint): void;
uniform2fv(location: WebGLUniformLocation | null, data: Iterable<GLfloat>, srcOffset?: GLuint, srcLength?: GLuint): void;
uniform3iv(location: WebGLUniformLocation | null, data: Iterable<GLint>, srcOffset?: GLuint, srcLength?: GLuint): void;
uniform4iv(location: WebGLUniformLocation | null, data: Iterable<GLint>, srcOffset?: GLuint, srcLength?: GLuint): void;
uniformMatrix2fv(location: WebGLUniformLocation | null, transpose: GLboolean, data: Iterable<GLfloat>, srcOffset?: GLuint, srcLength?: GLuint): void;
Expand All @@ -318,12 +318,12 @@ interface WebGLRenderingContextBase {
}

interface WebGLRenderingContextOverloads {
uniform2iv(location: WebGLUniformLocation | null, v: Iterable<GLint>): void;
uniform1fv(location: WebGLUniformLocation | null, v: Iterable<GLfloat>): void;
uniform2fv(location: WebGLUniformLocation | null, v: Iterable<GLfloat>): void;
uniform3fv(location: WebGLUniformLocation | null, v: Iterable<GLfloat>): void;
uniform4fv(location: WebGLUniformLocation | null, v: Iterable<GLfloat>): void;
uniform1iv(location: WebGLUniformLocation | null, v: Iterable<GLint>): void;
uniform2iv(location: WebGLUniformLocation | null, v: Iterable<GLint>): void;
uniform2fv(location: WebGLUniformLocation | null, v: Iterable<GLfloat>): void;
uniform3iv(location: WebGLUniformLocation | null, v: Iterable<GLint>): void;
uniform4iv(location: WebGLUniformLocation | null, v: Iterable<GLint>): void;
uniformMatrix2fv(location: WebGLUniformLocation | null, transpose: GLboolean, value: Iterable<GLfloat>): void;
Expand Down
Loading