Skip to content

Commit

Permalink
Alias backends to interfaces
Browse files Browse the repository at this point in the history
  • Loading branch information
james-pre committed Oct 10, 2024
1 parent 2db8977 commit bcc1034
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 3 deletions.
6 changes: 5 additions & 1 deletion src/IndexedDB.ts
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,7 @@ export interface IndexedDBOptions {
* A file system that uses the IndexedDB key value file system.
*/

export const IndexedDB = {
const _IndexedDB = {
name: 'IndexedDB',

options: {
Expand Down Expand Up @@ -164,3 +164,7 @@ export const IndexedDB = {
return fs;
},
} as const satisfies Backend<StoreFS, IndexedDBOptions>;
type _IndexedDB = typeof _IndexedDB;
// eslint-disable-next-line @typescript-eslint/no-empty-object-type
interface IndexedDB extends _IndexedDB {}
export const IndexedDB: IndexedDB = _IndexedDB;
6 changes: 5 additions & 1 deletion src/Storage.ts
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ export interface WebStorageOptions {
/**
* A synchronous file system backed by a `Storage` (e.g. localStorage).
*/
export const WebStorage = {
const _WebStorage = {
name: 'WebStorage',

options: {
Expand All @@ -84,3 +84,7 @@ export const WebStorage = {
return new StoreFS(new WebStorageStore(storage));
},
} as const satisfies Backend<StoreFS, WebStorageOptions>;
type _WebStorage = typeof _WebStorage;
// eslint-disable-next-line @typescript-eslint/no-empty-object-type
interface WebStorage extends _WebStorage {}
export const WebStorage: WebStorage = _WebStorage;
6 changes: 5 additions & 1 deletion src/access.ts
Original file line number Diff line number Diff line change
Expand Up @@ -212,7 +212,7 @@ export class WebAccessFS extends Async(FileSystem) {
}
}

export const WebAccess = {
const _WebAccess = {
name: 'WebAccess',

options: {
Expand All @@ -231,3 +231,7 @@ export const WebAccess = {
return new WebAccessFS(options.handle);
},
} as const satisfies Backend<WebAccessFS, WebAccessOptions>;
type _WebAccess = typeof _WebAccess;
// eslint-disable-next-line @typescript-eslint/no-empty-object-type
interface WebAccess extends _WebAccess {}
export const WebAccess: WebAccess = _WebAccess;

0 comments on commit bcc1034

Please sign in to comment.