first commit

This commit is contained in:
micialware committed 2026-09-13 18:43:42 +03:00
commit 4646dad2b8
18 files changed
+1971

No files matched your search

+34
View File
@@ -0,0 +1,34 @@
// Минимальные типы OPFS (Origin Private File System) по WICG
// «File System Access», в том виде, как они используются в wa-sqlite v1.0.0.
// Используем собственные имена (Opfs*), чтобы не пересекаться с типами
// из DOM-библиотеки TypeScript.
/** Файл в OPFS. */
interface OpfsFileHandle {
getFile(): Promise<File>;
createWritable(): Promise<OpfsWritableFileHandle>;
}
/** Записываемый файловый дескриптор OPFS. */
interface OpfsWritableFileHandle {
write(data: Uint8Array, at?: number): Promise<number>;
truncate?(newSize: number): Promise<void>;
close(): Promise<void>;
}
/** Каталог OPFS (корень приватного хранилища origin). */
interface OpfsDirectoryHandle {
getFileHandle(
name: string,
options?: { create?: boolean },
): Promise<OpfsFileHandle | null>;
removeEntry(name: string): Promise<void>;
}
interface OpfsStorage {
getDirectory(id?: string): Promise<OpfsDirectoryHandle>;
}
interface Navigator {
readonly storage?: OpfsStorage;
}