Merge pull request #14071 from Microsoft/portLibChanges
Use `Promise` instead of `PromiseLike` in the library
This commit is contained in:
commit
891b1aecde
130
src/lib/dom.generated.d.ts
vendored
130
src/lib/dom.generated.d.ts
vendored
|
@ -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;
|
||||
|
@ -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: {
|
||||
|
@ -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: {
|
||||
|
@ -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: {
|
||||
|
@ -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;
|
||||
|
@ -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;
|
||||
|
@ -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: {
|
||||
|
@ -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;
|
||||
}
|
||||
|
@ -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: {
|
||||
|
@ -7833,7 +7833,7 @@ declare var MediaKeyStatusMap: {
|
|||
|
||||
interface MediaKeySystemAccess {
|
||||
readonly keySystem: string;
|
||||
createMediaKeys(): PromiseLike<MediaKeys>;
|
||||
createMediaKeys(): Promise<MediaKeys>;
|
||||
getConfiguration(): MediaKeySystemConfiguration;
|
||||
}
|
||||
|
||||
|
@ -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: {
|
||||
|
@ -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;
|
||||
|
@ -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;
|
||||
}
|
||||
|
||||
|
@ -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 {
|
||||
|
@ -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;
|
||||
}
|
||||
|
@ -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;
|
||||
}
|
||||
|
@ -8576,7 +8576,7 @@ declare var PaymentRequest: {
|
|||
}
|
||||
|
||||
interface PaymentRequestUpdateEvent extends Event {
|
||||
updateWith(d: PromiseLike<PaymentDetails>): void;
|
||||
updateWith(d: Promise<PaymentDetails>): void;
|
||||
}
|
||||
|
||||
declare var PaymentRequestUpdateEvent: {
|
||||
|
@ -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;
|
||||
}
|
||||
|
||||
|
@ -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: {
|
||||
|
@ -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: {
|
||||
|
@ -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;
|
||||
}
|
||||
|
@ -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: {
|
||||
|
@ -9300,7 +9300,7 @@ declare var Range: {
|
|||
|
||||
interface ReadableStream {
|
||||
readonly locked: boolean;
|
||||
cancel(): PromiseLike<void>;
|
||||
cancel(): Promise<void>;
|
||||
getReader(): ReadableStreamReader;
|
||||
}
|
||||
|
||||
|
@ -9310,8 +9310,8 @@ declare var ReadableStream: {
|
|||
}
|
||||
|
||||
interface ReadableStreamReader {
|
||||
cancel(): PromiseLike<void>;
|
||||
read(): PromiseLike<any>;
|
||||
cancel(): Promise<void>;
|
||||
read(): Promise<any>;
|
||||
releaseLock(): void;
|
||||
}
|
||||
|
||||
|
@ -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;
|
||||
}
|
||||
|
@ -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;
|
||||
}
|
||||
|
@ -11561,7 +11561,7 @@ declare var SubtleCrypto: {
|
|||
|
||||
interface SyncManager {
|
||||
getTags(): any;
|
||||
register(tag: string): PromiseLike<void>;
|
||||
register(tag: string): Promise<void>;
|
||||
}
|
||||
|
||||
declare var SyncManager: {
|
||||
|
@ -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: {
|
||||
|
@ -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 {
|
||||
|
@ -13613,7 +13613,7 @@ interface GlobalEventHandlers {
|
|||
}
|
||||
|
||||
interface GlobalFetch {
|
||||
fetch(input: RequestInfo, init?: RequestInit): PromiseLike<Response>;
|
||||
fetch(input: RequestInfo, init?: RequestInit): Promise<Response>;
|
||||
}
|
||||
|
||||
interface HTMLTableAlignment {
|
||||
|
@ -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;
|
||||
|
|
70
src/lib/webworker.generated.d.ts
vendored
70
src/lib/webworker.generated.d.ts
vendored
|
@ -168,13 +168,13 @@ declare var Blob: {
|
|||
}
|
||||
|
||||
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: {
|
||||
|
@ -183,11 +183,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: {
|
||||
|
@ -746,7 +746,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 Performance {
|
||||
|
@ -862,9 +862,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: {
|
||||
|
@ -877,7 +877,7 @@ interface PushSubscription {
|
|||
readonly options: PushSubscriptionOptions;
|
||||
getKey(name: string): ArrayBuffer | null;
|
||||
toJSON(): any;
|
||||
unsubscribe(): PromiseLike<boolean>;
|
||||
unsubscribe(): Promise<boolean>;
|
||||
}
|
||||
|
||||
declare var PushSubscription: {
|
||||
|
@ -897,7 +897,7 @@ declare var PushSubscriptionOptions: {
|
|||
|
||||
interface ReadableStream {
|
||||
readonly locked: boolean;
|
||||
cancel(): PromiseLike<void>;
|
||||
cancel(): Promise<void>;
|
||||
getReader(): ReadableStreamReader;
|
||||
}
|
||||
|
||||
|
@ -907,8 +907,8 @@ declare var ReadableStream: {
|
|||
}
|
||||
|
||||
interface ReadableStreamReader {
|
||||
cancel(): PromiseLike<void>;
|
||||
read(): PromiseLike<any>;
|
||||
cancel(): Promise<void>;
|
||||
read(): Promise<any>;
|
||||
releaseLock(): void;
|
||||
}
|
||||
|
||||
|
@ -986,9 +986,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;
|
||||
}
|
||||
|
@ -1000,7 +1000,7 @@ declare var ServiceWorkerRegistration: {
|
|||
|
||||
interface SyncManager {
|
||||
getTags(): any;
|
||||
register(tag: string): PromiseLike<void>;
|
||||
register(tag: string): Promise<void>;
|
||||
}
|
||||
|
||||
declare var SyncManager: {
|
||||
|
@ -1130,14 +1130,14 @@ 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 GlobalFetch {
|
||||
fetch(input: RequestInfo, init?: RequestInit): PromiseLike<Response>;
|
||||
fetch(input: RequestInfo, init?: RequestInit): Promise<Response>;
|
||||
}
|
||||
|
||||
interface MSBaseReaderEventMap {
|
||||
|
@ -1234,10 +1234,10 @@ declare var Client: {
|
|||
}
|
||||
|
||||
interface Clients {
|
||||
claim(): PromiseLike<void>;
|
||||
get(id: string): PromiseLike<any>;
|
||||
claim(): Promise<void>;
|
||||
get(id: string): Promise<any>;
|
||||
matchAll(options?: ClientQueryOptions): any;
|
||||
openWindow(url: USVString): PromiseLike<WindowClient>;
|
||||
openWindow(url: USVString): Promise<WindowClient>;
|
||||
}
|
||||
|
||||
declare var Clients: {
|
||||
|
@ -1263,7 +1263,7 @@ declare var DedicatedWorkerGlobalScope: {
|
|||
}
|
||||
|
||||
interface ExtendableEvent extends Event {
|
||||
waitUntil(f: PromiseLike<any>): void;
|
||||
waitUntil(f: Promise<any>): void;
|
||||
}
|
||||
|
||||
declare var ExtendableEvent: {
|
||||
|
@ -1288,7 +1288,7 @@ interface FetchEvent extends ExtendableEvent {
|
|||
readonly clientId: string | null;
|
||||
readonly isReload: boolean;
|
||||
readonly request: Request;
|
||||
respondWith(r: PromiseLike<Response>): void;
|
||||
respondWith(r: Promise<Response>): void;
|
||||
}
|
||||
|
||||
declare var FetchEvent: {
|
||||
|
@ -1363,7 +1363,7 @@ interface ServiceWorkerGlobalScope extends WorkerGlobalScope {
|
|||
onpushsubscriptionchange: (this: ServiceWorkerGlobalScope, ev: ExtendableEvent) => any;
|
||||
onsync: (this: ServiceWorkerGlobalScope, ev: SyncEvent) => any;
|
||||
readonly registration: ServiceWorkerRegistration;
|
||||
skipWaiting(): PromiseLike<void>;
|
||||
skipWaiting(): Promise<void>;
|
||||
addEventListener<K extends keyof ServiceWorkerGlobalScopeEventMap>(type: K, listener: (this: ServiceWorkerGlobalScope, ev: ServiceWorkerGlobalScopeEventMap[K]) => any, useCapture?: boolean): void;
|
||||
addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void;
|
||||
}
|
||||
|
@ -1386,8 +1386,8 @@ declare var SyncEvent: {
|
|||
interface WindowClient extends Client {
|
||||
readonly focused: boolean;
|
||||
readonly visibilityState: string;
|
||||
focus(): PromiseLike<WindowClient>;
|
||||
navigate(url: USVString): PromiseLike<WindowClient>;
|
||||
focus(): Promise<WindowClient>;
|
||||
navigate(url: USVString): Promise<WindowClient>;
|
||||
}
|
||||
|
||||
declare var WindowClient: {
|
||||
|
@ -1715,7 +1715,7 @@ declare function setTimeout(handler: any, timeout?: any, ...args: any[]): number
|
|||
declare function atob(encodedString: string): string;
|
||||
declare function btoa(rawString: string): string;
|
||||
declare var console: Console;
|
||||
declare function fetch(input: RequestInfo, init?: RequestInit): PromiseLike<Response>;
|
||||
declare function fetch(input: RequestInfo, init?: RequestInit): Promise<Response>;
|
||||
declare function dispatchEvent(evt: Event): boolean;
|
||||
declare function removeEventListener(type: string, listener?: EventListenerOrEventListenerObject, useCapture?: boolean): void;
|
||||
declare function addEventListener<K extends keyof DedicatedWorkerGlobalScopeEventMap>(type: K, listener: (this: DedicatedWorkerGlobalScope, ev: DedicatedWorkerGlobalScopeEventMap[K]) => any, useCapture?: boolean): void;
|
||||
|
|
Loading…
Reference in a new issue