TypeScript API / laikacms/storage/web-fs / WebFsStorageRepositoryOptions
Interface: WebFsStorageRepositoryOptions
Constructor options for WebFsStorageRepository.
Security & data integrity
Everything a directory handle reaches is readable and writable by any script that obtains the same handle — an origin-private root by every script on the origin, a user-picked directory by every other program on the machine. There is no access control of its own, and every write it accepts is inherently unauthenticated (there is no server in the loop to check who's writing). Never store credentials, API keys, or other secrets in a WebFsStorageRepository. Authorization for client-writable content belongs on a server proxy path (e.g. laikacms/storage/jsonapi-proxy), not in this repository.
Properties
defaultExtension
defaultExtension: string;Extension used for newly created objects when no other extension is determined.
determineExtension?
optional determineExtension?: DetermineExtension;ignoreList?
optional ignoreList?: string[];Same default-exclusions convention as the other storage repositories.
mode?
optional mode?: WebFsAccessMode;Access mode passed to queryPermission() when the root handle exposes it (user-picked showDirectoryPicker() handles do; origin-private handles typically don't and are treated as granted). This only controls what is queried — a 'read'-granted root still fails writes at write time with a PermissionDeniedError.
Default
'readwrite'namespace?
optional namespace?: string;Subdirectory chain below root that every operation is scoped under, so a WebFsStorageRepository never reads, lists, overwrites, or deletes an entry belonging to a different namespace or to unrelated data already present in the same directory tree. Pass '' to use root as-is.
Default
'laikacms'root?
optional root?: WebFsRootInput;The root directory to store content under: a FileSystemDirectoryHandle from anywhere — await navigator.storage.getDirectory() (or any subdirectory of it), a user-picked await showDirectoryPicker() directory, an in-memory shim satisfying the same structural contract — or a provider resolving one lazily. The repository deliberately does not care where the handle came from; it (re-)validates permission and liveness on every operation instead.
When omitted, navigator.storage.getDirectory() is resolved lazily, on the first operation that needs it — never at construction or import time — so this repository can be constructed (though not yet used) during SSR.
serializerRegistry
serializerRegistry: StorageSerializerRegistry;