securityos/node_modules/wasi-js/dist/fs.d.ts

39 lines
901 B
TypeScript
Raw Normal View History

2024-09-06 15:32:35 +00:00
/// <reference types="node" />
import { DirectoryJSON } from "@cowasm/memfs";
import { WASIFileSystem } from "./types";
interface NativeFs {
type: "native";
}
interface DevFs {
type: "dev";
}
interface ZipFsFile {
type: "zipfile";
zipfile: string;
mountpoint: string;
async?: boolean;
}
interface ZipFsUrl {
type: "zipurl";
zipurl: string;
mountpoint: string;
async?: boolean;
}
interface ZipFs {
type: "zip";
data: Buffer;
mountpoint: string;
}
interface ZipFsAsync {
type: "zip-async";
getData: () => Promise<Buffer>;
mountpoint: string;
}
interface MemFs {
type: "mem";
contents?: DirectoryJSON;
}
export declare type FileSystemSpec = NativeFs | ZipFs | ZipFsAsync | ZipFsFile | ZipFsUrl | MemFs | DevFs;
export declare function createFileSystem(specs: FileSystemSpec[], nativeFs?: WASIFileSystem): WASIFileSystem;
export {};