fix(dts): make globals available on globalThis (#19438)

This PR changes Web IDL interfaces to be declared with `var` instead of
`class`, so that accessing them via `globalThis` does not raise type
errors.

Closes #13390.
This commit is contained in:
ud2 2023-07-04 02:36:55 +08:00 committed by GitHub
parent e8a866ca8a
commit d632cce129
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
15 changed files with 735 additions and 393 deletions

View file

@ -54,18 +54,18 @@ declare interface Cache {
/** @category Cache API */
declare var Cache: {
prototype: Cache;
new (name: string): Cache;
readonly prototype: Cache;
new (): never;
};
/** @category Cache API */
declare var CacheStorage: {
prototype: CacheStorage;
new (): CacheStorage;
readonly prototype: CacheStorage;
new (): never;
};
/** @category Cache API */
interface CacheQueryOptions {
declare interface CacheQueryOptions {
ignoreMethod?: boolean;
ignoreSearch?: boolean;
ignoreVary?: boolean;