@wapython/wasi
Version:
Javascript library for interacting with WASI Modules in Node.js and the Browser.
39 lines (38 loc) • 893 B
TypeScript
/// <reference types="node" />
import { DirectoryJSON } from "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 {};