Skip to content

Use Promise instead of PromiseLike in the library #14071

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
Feb 14, 2017
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
130 changes: 65 additions & 65 deletions src/lib/dom.generated.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1331,7 +1331,7 @@ interface AudioContextBase extends EventTarget {
onstatechange: (this: AudioContext, ev: Event) => any;
readonly sampleRate: number;
readonly state: string;
close(): PromiseLike<void>;
close(): Promise<void>;
createAnalyser(): AnalyserNode;
createBiquadFilter(): BiquadFilterNode;
createBuffer(numberOfChannels: number, length: number, sampleRate: number): AudioBuffer;
Expand All @@ -1351,14 +1351,14 @@ interface AudioContextBase extends EventTarget {
createScriptProcessor(bufferSize?: number, numberOfInputChannels?: number, numberOfOutputChannels?: number): ScriptProcessorNode;
createStereoPanner(): StereoPannerNode;
createWaveShaper(): WaveShaperNode;
decodeAudioData(audioData: ArrayBuffer, successCallback?: DecodeSuccessCallback, errorCallback?: DecodeErrorCallback): PromiseLike<AudioBuffer>;
resume(): PromiseLike<void>;
decodeAudioData(audioData: ArrayBuffer, successCallback?: DecodeSuccessCallback, errorCallback?: DecodeErrorCallback): Promise<AudioBuffer>;
resume(): Promise<void>;
addEventListener<K extends keyof AudioContextEventMap>(type: K, listener: (this: AudioContext, ev: AudioContextEventMap[K]) => any, useCapture?: boolean): void;
addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void;
}

interface AudioContext extends AudioContextBase {
suspend(): PromiseLike<void>;
suspend(): Promise<void>;
}

declare var AudioContext: {
Expand Down Expand Up @@ -2076,13 +2076,13 @@ declare var CSSSupportsRule: {
}

interface Cache {
add(request: RequestInfo): PromiseLike<void>;
addAll(requests: RequestInfo[]): PromiseLike<void>;
delete(request: RequestInfo, options?: CacheQueryOptions): PromiseLike<boolean>;
add(request: RequestInfo): Promise<void>;
addAll(requests: RequestInfo[]): Promise<void>;
delete(request: RequestInfo, options?: CacheQueryOptions): Promise<boolean>;
keys(request?: RequestInfo, options?: CacheQueryOptions): any;
match(request: RequestInfo, options?: CacheQueryOptions): PromiseLike<Response>;
match(request: RequestInfo, options?: CacheQueryOptions): Promise<Response>;
matchAll(request?: RequestInfo, options?: CacheQueryOptions): any;
put(request: RequestInfo, response: Response): PromiseLike<void>;
put(request: RequestInfo, response: Response): Promise<void>;
}

declare var Cache: {
Expand All @@ -2091,11 +2091,11 @@ declare var Cache: {
}

interface CacheStorage {
delete(cacheName: string): PromiseLike<boolean>;
has(cacheName: string): PromiseLike<boolean>;
delete(cacheName: string): Promise<boolean>;
has(cacheName: string): Promise<boolean>;
keys(): any;
match(request: RequestInfo, options?: CacheQueryOptions): PromiseLike<any>;
open(cacheName: string): PromiseLike<Cache>;
match(request: RequestInfo, options?: CacheQueryOptions): Promise<any>;
open(cacheName: string): Promise<Cache>;
}

declare var CacheStorage: {
Expand Down Expand Up @@ -5716,7 +5716,7 @@ interface HTMLMediaElement extends HTMLElement {
* Loads and starts playback of a media resource.
*/
play(): void;
setMediaKeys(mediaKeys: MediaKeys | null): PromiseLike<void>;
setMediaKeys(mediaKeys: MediaKeys | null): Promise<void>;
readonly HAVE_CURRENT_DATA: number;
readonly HAVE_ENOUGH_DATA: number;
readonly HAVE_FUTURE_DATA: number;
Expand Down Expand Up @@ -7294,7 +7294,7 @@ interface MSApp {
execAsyncAtPriority(asynchronousCallback: MSExecAtPriorityFunctionCallback, priority: string, ...args: any[]): void;
execAtPriority(synchronousCallback: MSExecAtPriorityFunctionCallback, priority: string, ...args: any[]): any;
getCurrentPriority(): string;
getHtmlPrintDocumentSourceAsync(htmlDoc: any): PromiseLike<any>;
getHtmlPrintDocumentSourceAsync(htmlDoc: any): Promise<any>;
getViewId(view: any): any;
isTaskScheduledAtPriorityOrHigher(priority: string): boolean;
pageHandlesAllApplicationActivations(enabled: boolean): void;
Expand Down Expand Up @@ -7355,8 +7355,8 @@ declare var MSBlobBuilder: {
}

interface MSCredentials {
getAssertion(challenge: string, filter?: MSCredentialFilter, params?: MSSignatureParameters): PromiseLike<MSAssertion>;
makeCredential(accountInfo: MSAccountInfo, params: MSCredentialParameters[], challenge?: string): PromiseLike<MSAssertion>;
getAssertion(challenge: string, filter?: MSCredentialFilter, params?: MSSignatureParameters): Promise<MSAssertion>;
makeCredential(accountInfo: MSAccountInfo, params: MSCredentialParameters[], challenge?: string): Promise<MSAssertion>;
}

declare var MSCredentials: {
Expand Down Expand Up @@ -7744,7 +7744,7 @@ interface MediaDevices extends EventTarget {
ondevicechange: (this: MediaDevices, ev: Event) => any;
enumerateDevices(): any;
getSupportedConstraints(): MediaTrackSupportedConstraints;
getUserMedia(constraints: MediaStreamConstraints): PromiseLike<MediaStream>;
getUserMedia(constraints: MediaStreamConstraints): Promise<MediaStream>;
addEventListener<K extends keyof MediaDevicesEventMap>(type: K, listener: (this: MediaDevices, ev: MediaDevicesEventMap[K]) => any, useCapture?: boolean): void;
addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void;
}
Expand Down Expand Up @@ -7803,15 +7803,15 @@ declare var MediaKeyMessageEvent: {
}

interface MediaKeySession extends EventTarget {
readonly closed: PromiseLike<void>;
readonly closed: Promise<void>;
readonly expiration: number;
readonly keyStatuses: MediaKeyStatusMap;
readonly sessionId: string;
close(): PromiseLike<void>;
generateRequest(initDataType: string, initData: any): PromiseLike<void>;
load(sessionId: string): PromiseLike<boolean>;
remove(): PromiseLike<void>;
update(response: any): PromiseLike<void>;
close(): Promise<void>;
generateRequest(initDataType: string, initData: any): Promise<void>;
load(sessionId: string): Promise<boolean>;
remove(): Promise<void>;
update(response: any): Promise<void>;
}

declare var MediaKeySession: {
Expand All @@ -7833,7 +7833,7 @@ declare var MediaKeyStatusMap: {

interface MediaKeySystemAccess {
readonly keySystem: string;
createMediaKeys(): PromiseLike<MediaKeys>;
createMediaKeys(): Promise<MediaKeys>;
getConfiguration(): MediaKeySystemConfiguration;
}

Expand All @@ -7844,7 +7844,7 @@ declare var MediaKeySystemAccess: {

interface MediaKeys {
createSession(sessionType?: string): MediaKeySession;
setServerCertificate(serverCertificate: any): PromiseLike<void>;
setServerCertificate(serverCertificate: any): Promise<void>;
}

declare var MediaKeys: {
Expand Down Expand Up @@ -7983,7 +7983,7 @@ interface MediaStreamTrack extends EventTarget {
readonly readonly: boolean;
readonly readyState: string;
readonly remote: boolean;
applyConstraints(constraints: MediaTrackConstraints): PromiseLike<void>;
applyConstraints(constraints: MediaTrackConstraints): Promise<void>;
clone(): MediaStreamTrack;
getCapabilities(): MediaTrackCapabilities;
getConstraints(): MediaTrackConstraints;
Expand Down Expand Up @@ -8217,7 +8217,7 @@ interface Navigator extends Object, NavigatorID, NavigatorOnLine, NavigatorConte
getGamepads(): Gamepad[];
javaEnabled(): boolean;
msLaunchUri(uri: string, successCallback?: MSLaunchUriCallback, noHandlerCallback?: MSLaunchUriCallback): void;
requestMediaKeySystemAccess(keySystem: string, supportedConfigurations: MediaKeySystemConfiguration[]): PromiseLike<MediaKeySystemAccess>;
requestMediaKeySystemAccess(keySystem: string, supportedConfigurations: MediaKeySystemConfiguration[]): Promise<MediaKeySystemAccess>;
vibrate(pattern: number | number[]): boolean;
}

Expand Down Expand Up @@ -8377,7 +8377,7 @@ interface Notification extends EventTarget {
declare var Notification: {
prototype: Notification;
new(title: string, options?: NotificationOptions): Notification;
requestPermission(callback?: NotificationPermissionCallback): PromiseLike<string>;
requestPermission(callback?: NotificationPermissionCallback): Promise<string>;
}

interface OES_element_index_uint {
Expand Down Expand Up @@ -8448,8 +8448,8 @@ interface OfflineAudioContextEventMap extends AudioContextEventMap {
interface OfflineAudioContext extends AudioContextBase {
readonly length: number;
oncomplete: (this: OfflineAudioContext, ev: OfflineAudioCompletionEvent) => any;
startRendering(): PromiseLike<AudioBuffer>;
suspend(suspendTime: number): PromiseLike<void>;
startRendering(): Promise<AudioBuffer>;
suspend(suspendTime: number): Promise<void>;
addEventListener<K extends keyof OfflineAudioContextEventMap>(type: K, listener: (this: OfflineAudioContext, ev: OfflineAudioContextEventMap[K]) => any, useCapture?: boolean): void;
addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void;
}
Expand Down Expand Up @@ -8564,8 +8564,8 @@ interface PaymentRequest extends EventTarget {
readonly shippingAddress: PaymentAddress | null;
readonly shippingOption: string | null;
readonly shippingType: string | null;
abort(): PromiseLike<void>;
show(): PromiseLike<PaymentResponse>;
abort(): Promise<void>;
show(): Promise<PaymentResponse>;
addEventListener<K extends keyof PaymentRequestEventMap>(type: K, listener: (this: PaymentRequest, ev: PaymentRequestEventMap[K]) => any, useCapture?: boolean): void;
addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void;
}
Expand All @@ -8576,7 +8576,7 @@ declare var PaymentRequest: {
}

interface PaymentRequestUpdateEvent extends Event {
updateWith(d: PromiseLike<PaymentDetails>): void;
updateWith(d: Promise<PaymentDetails>): void;
}

declare var PaymentRequestUpdateEvent: {
Expand All @@ -8592,7 +8592,7 @@ interface PaymentResponse {
readonly payerPhone: string | null;
readonly shippingAddress: PaymentAddress | null;
readonly shippingOption: string | null;
complete(result?: string): PromiseLike<void>;
complete(result?: string): Promise<void>;
toJSON(): any;
}

Expand Down Expand Up @@ -8918,9 +8918,9 @@ declare var ProgressEvent: {
}

interface PushManager {
getSubscription(): PromiseLike<PushSubscription>;
permissionState(options?: PushSubscriptionOptionsInit): PromiseLike<string>;
subscribe(options?: PushSubscriptionOptionsInit): PromiseLike<PushSubscription>;
getSubscription(): Promise<PushSubscription>;
permissionState(options?: PushSubscriptionOptionsInit): Promise<string>;
subscribe(options?: PushSubscriptionOptionsInit): Promise<PushSubscription>;
}

declare var PushManager: {
Expand All @@ -8933,7 +8933,7 @@ interface PushSubscription {
readonly options: PushSubscriptionOptions;
getKey(name: string): ArrayBuffer | null;
toJSON(): any;
unsubscribe(): PromiseLike<boolean>;
unsubscribe(): Promise<boolean>;
}

declare var PushSubscription: {
Expand Down Expand Up @@ -9127,19 +9127,19 @@ interface RTCPeerConnection extends EventTarget {
onsignalingstatechange: (this: RTCPeerConnection, ev: Event) => any;
readonly remoteDescription: RTCSessionDescription | null;
readonly signalingState: string;
addIceCandidate(candidate: RTCIceCandidate, successCallback?: VoidFunction, failureCallback?: RTCPeerConnectionErrorCallback): PromiseLike<void>;
addIceCandidate(candidate: RTCIceCandidate, successCallback?: VoidFunction, failureCallback?: RTCPeerConnectionErrorCallback): Promise<void>;
addStream(stream: MediaStream): void;
close(): void;
createAnswer(successCallback?: RTCSessionDescriptionCallback, failureCallback?: RTCPeerConnectionErrorCallback): PromiseLike<RTCSessionDescription>;
createOffer(successCallback?: RTCSessionDescriptionCallback, failureCallback?: RTCPeerConnectionErrorCallback, options?: RTCOfferOptions): PromiseLike<RTCSessionDescription>;
createAnswer(successCallback?: RTCSessionDescriptionCallback, failureCallback?: RTCPeerConnectionErrorCallback): Promise<RTCSessionDescription>;
createOffer(successCallback?: RTCSessionDescriptionCallback, failureCallback?: RTCPeerConnectionErrorCallback, options?: RTCOfferOptions): Promise<RTCSessionDescription>;
getConfiguration(): RTCConfiguration;
getLocalStreams(): MediaStream[];
getRemoteStreams(): MediaStream[];
getStats(selector: MediaStreamTrack | null, successCallback?: RTCStatsCallback, failureCallback?: RTCPeerConnectionErrorCallback): PromiseLike<RTCStatsReport>;
getStats(selector: MediaStreamTrack | null, successCallback?: RTCStatsCallback, failureCallback?: RTCPeerConnectionErrorCallback): Promise<RTCStatsReport>;
getStreamById(streamId: string): MediaStream | null;
removeStream(stream: MediaStream): void;
setLocalDescription(description: RTCSessionDescription, successCallback?: VoidFunction, failureCallback?: RTCPeerConnectionErrorCallback): PromiseLike<void>;
setRemoteDescription(description: RTCSessionDescription, successCallback?: VoidFunction, failureCallback?: RTCPeerConnectionErrorCallback): PromiseLike<void>;
setLocalDescription(description: RTCSessionDescription, successCallback?: VoidFunction, failureCallback?: RTCPeerConnectionErrorCallback): Promise<void>;
setRemoteDescription(description: RTCSessionDescription, successCallback?: VoidFunction, failureCallback?: RTCPeerConnectionErrorCallback): Promise<void>;
addEventListener<K extends keyof RTCPeerConnectionEventMap>(type: K, listener: (this: RTCPeerConnection, ev: RTCPeerConnectionEventMap[K]) => any, useCapture?: boolean): void;
addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void;
}
Expand Down Expand Up @@ -9245,8 +9245,8 @@ declare var RTCSsrcConflictEvent: {
}

interface RTCStatsProvider extends EventTarget {
getStats(): PromiseLike<RTCStatsReport>;
msGetStats(): PromiseLike<RTCStatsReport>;
getStats(): Promise<RTCStatsReport>;
msGetStats(): Promise<RTCStatsReport>;
}

declare var RTCStatsProvider: {
Expand Down Expand Up @@ -9300,7 +9300,7 @@ declare var Range: {

interface ReadableStream {
readonly locked: boolean;
cancel(): PromiseLike<void>;
cancel(): Promise<void>;
getReader(): ReadableStreamReader;
}

Expand All @@ -9310,8 +9310,8 @@ declare var ReadableStream: {
}

interface ReadableStreamReader {
cancel(): PromiseLike<void>;
read(): PromiseLike<any>;
cancel(): Promise<void>;
read(): Promise<any>;
releaseLock(): void;
}

Expand Down Expand Up @@ -11285,10 +11285,10 @@ interface ServiceWorkerContainer extends EventTarget {
readonly controller: ServiceWorker | null;
oncontrollerchange: (this: ServiceWorkerContainer, ev: Event) => any;
onmessage: (this: ServiceWorkerContainer, ev: ServiceWorkerMessageEvent) => any;
readonly ready: PromiseLike<ServiceWorkerRegistration>;
getRegistration(clientURL?: USVString): PromiseLike<any>;
readonly ready: Promise<ServiceWorkerRegistration>;
getRegistration(clientURL?: USVString): Promise<any>;
getRegistrations(): any;
register(scriptURL: USVString, options?: RegistrationOptions): PromiseLike<ServiceWorkerRegistration>;
register(scriptURL: USVString, options?: RegistrationOptions): Promise<ServiceWorkerRegistration>;
addEventListener<K extends keyof ServiceWorkerContainerEventMap>(type: K, listener: (this: ServiceWorkerContainer, ev: ServiceWorkerContainerEventMap[K]) => any, useCapture?: boolean): void;
addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void;
}
Expand Down Expand Up @@ -11324,9 +11324,9 @@ interface ServiceWorkerRegistration extends EventTarget {
readonly sync: SyncManager;
readonly waiting: ServiceWorker | null;
getNotifications(filter?: GetNotificationOptions): any;
showNotification(title: string, options?: NotificationOptions): PromiseLike<void>;
unregister(): PromiseLike<boolean>;
update(): PromiseLike<void>;
showNotification(title: string, options?: NotificationOptions): Promise<void>;
unregister(): Promise<boolean>;
update(): Promise<void>;
addEventListener<K extends keyof ServiceWorkerRegistrationEventMap>(type: K, listener: (this: ServiceWorkerRegistration, ev: ServiceWorkerRegistrationEventMap[K]) => any, useCapture?: boolean): void;
addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void;
}
Expand Down Expand Up @@ -11561,7 +11561,7 @@ declare var SubtleCrypto: {

interface SyncManager {
getTags(): any;
register(tag: string): PromiseLike<void>;
register(tag: string): Promise<void>;
}

declare var SyncManager: {
Expand Down Expand Up @@ -11975,8 +11975,8 @@ declare var WaveShaperNode: {
}

interface WebAuthentication {
getAssertion(assertionChallenge: any, options?: AssertionOptions): PromiseLike<WebAuthnAssertion>;
makeCredential(accountInformation: Account, cryptoParameters: ScopedCredentialParameters[], attestationChallenge: any, options?: ScopedCredentialOptions): PromiseLike<ScopedCredentialInfo>;
getAssertion(assertionChallenge: any, options?: AssertionOptions): Promise<WebAuthnAssertion>;
makeCredential(accountInformation: Account, cryptoParameters: ScopedCredentialParameters[], attestationChallenge: any, options?: ScopedCredentialOptions): Promise<ScopedCredentialInfo>;
}

declare var WebAuthentication: {
Expand Down Expand Up @@ -13469,10 +13469,10 @@ interface AbstractWorker {

interface Body {
readonly bodyUsed: boolean;
arrayBuffer(): PromiseLike<ArrayBuffer>;
blob(): PromiseLike<Blob>;
json(): PromiseLike<any>;
text(): PromiseLike<string>;
arrayBuffer(): Promise<ArrayBuffer>;
blob(): Promise<Blob>;
json(): Promise<any>;
text(): Promise<string>;
}

interface CanvasPathMethods {
Expand Down Expand Up @@ -13613,7 +13613,7 @@ interface GlobalEventHandlers {
}

interface GlobalFetch {
fetch(input: RequestInfo, init?: RequestInit): PromiseLike<Response>;
fetch(input: RequestInfo, init?: RequestInit): Promise<Response>;
}

interface HTMLTableAlignment {
Expand Down Expand Up @@ -14870,7 +14870,7 @@ declare var onwheel: (this: Window, ev: WheelEvent) => any;
declare var indexedDB: IDBFactory;
declare function atob(encodedString: string): string;
declare function btoa(rawString: string): string;
declare function fetch(input: RequestInfo, init?: RequestInit): PromiseLike<Response>;
declare function fetch(input: RequestInfo, init?: RequestInit): Promise<Response>;
declare function addEventListener<K extends keyof WindowEventMap>(type: K, listener: (this: Window, ev: WindowEventMap[K]) => any, useCapture?: boolean): void;
declare function addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void;
type AAGUID = string;
Expand Down
Loading