mirror of
https://github.com/DustinBrett/daedalOS.git
synced 2025-12-06 12:20:20 +01:00
26 lines
566 B
TypeScript
26 lines
566 B
TypeScript
import type * as BrowserFS from 'browserfs';
|
|
import type { ListingObj } from '@/types/utils/filesystem';
|
|
|
|
export const writableJsonFs = (
|
|
path: string,
|
|
listingUrlOrObj: string | ListingObj
|
|
): { [key: string]: BrowserFS.FileSystemConfiguration } => ({
|
|
[path]: {
|
|
fs: 'OverlayFS',
|
|
options: {
|
|
readable: {
|
|
fs: 'XmlHttpRequest',
|
|
options: {
|
|
index: listingUrlOrObj
|
|
}
|
|
},
|
|
writable: {
|
|
fs: 'IndexedDB',
|
|
options: {
|
|
storeName: `browser-fs-cache (${path})`
|
|
}
|
|
}
|
|
}
|
|
}
|
|
});
|