Add discriminants to FileSystemHandle subtypes (#1251)

Co-authored-by: saschanaz <saschanaz@users.noreply.github.com>
This commit is contained in:
Nathan Shively-Sanders 2022-01-26 10:37:16 -08:00 коммит произвёл GitHub
Родитель 464221ebe6
Коммит 23b54aa88c
Не найден ключ, соответствующий данной подписи
Идентификатор ключа GPG: 4AEE18F83AFDEB23
5 изменённых файлов: 32 добавлений и 0 удалений

2
baselines/dom.generated.d.ts поставляемый
Просмотреть файл

@ -5123,6 +5123,7 @@ declare var FileSystemDirectoryEntry: {
/** Available only in secure contexts. */
interface FileSystemDirectoryHandle extends FileSystemHandle {
readonly kind: "directory";
getDirectoryHandle(name: string, options?: FileSystemGetDirectoryOptions): Promise<FileSystemDirectoryHandle>;
getFileHandle(name: string, options?: FileSystemGetFileOptions): Promise<FileSystemFileHandle>;
removeEntry(name: string, options?: FileSystemRemoveOptions): Promise<void>;
@ -5168,6 +5169,7 @@ declare var FileSystemFileEntry: {
/** Available only in secure contexts. */
interface FileSystemFileHandle extends FileSystemHandle {
readonly kind: "file";
getFile(): Promise<File>;
}

2
baselines/serviceworker.generated.d.ts поставляемый
Просмотреть файл

@ -1482,6 +1482,7 @@ declare var FileReader: {
/** Available only in secure contexts. */
interface FileSystemDirectoryHandle extends FileSystemHandle {
readonly kind: "directory";
getDirectoryHandle(name: string, options?: FileSystemGetDirectoryOptions): Promise<FileSystemDirectoryHandle>;
getFileHandle(name: string, options?: FileSystemGetFileOptions): Promise<FileSystemFileHandle>;
removeEntry(name: string, options?: FileSystemRemoveOptions): Promise<void>;
@ -1495,6 +1496,7 @@ declare var FileSystemDirectoryHandle: {
/** Available only in secure contexts. */
interface FileSystemFileHandle extends FileSystemHandle {
readonly kind: "file";
getFile(): Promise<File>;
}

2
baselines/sharedworker.generated.d.ts поставляемый
Просмотреть файл

@ -1402,6 +1402,7 @@ declare var FileReaderSync: {
/** Available only in secure contexts. */
interface FileSystemDirectoryHandle extends FileSystemHandle {
readonly kind: "directory";
getDirectoryHandle(name: string, options?: FileSystemGetDirectoryOptions): Promise<FileSystemDirectoryHandle>;
getFileHandle(name: string, options?: FileSystemGetFileOptions): Promise<FileSystemFileHandle>;
removeEntry(name: string, options?: FileSystemRemoveOptions): Promise<void>;
@ -1415,6 +1416,7 @@ declare var FileSystemDirectoryHandle: {
/** Available only in secure contexts. */
interface FileSystemFileHandle extends FileSystemHandle {
readonly kind: "file";
getFile(): Promise<File>;
}

2
baselines/webworker.generated.d.ts поставляемый
Просмотреть файл

@ -1534,6 +1534,7 @@ declare var FileReaderSync: {
/** Available only in secure contexts. */
interface FileSystemDirectoryHandle extends FileSystemHandle {
readonly kind: "directory";
getDirectoryHandle(name: string, options?: FileSystemGetDirectoryOptions): Promise<FileSystemDirectoryHandle>;
getFileHandle(name: string, options?: FileSystemGetFileOptions): Promise<FileSystemFileHandle>;
removeEntry(name: string, options?: FileSystemRemoveOptions): Promise<void>;
@ -1547,6 +1548,7 @@ declare var FileSystemDirectoryHandle: {
/** Available only in secure contexts. */
interface FileSystemFileHandle extends FileSystemHandle {
readonly kind: "file";
getFile(): Promise<File>;
}

Просмотреть файл

@ -1060,6 +1060,30 @@
}
]
}
},
"FileSystemFileHandle": {
"name": "FileSystemFileHandle",
"properties": {
"property": {
"kind": {
"name": "kind",
"readonly": true,
"overrideType": "\"file\""
}
}
}
},
"FileSystemDirectoryHandle": {
"name": "FileSystemDirectoryHandle",
"properties": {
"property": {
"kind": {
"name": "kind",
"readonly": true,
"overrideType": "\"directory\""
}
}
}
}
}
},