[generated] sandpack files from: codesandbox-client

This commit is contained in:
Will Chen
2025-04-12 00:09:50 -07:00
parent 4b641a3303
commit a618ec3f56
442 changed files with 393342 additions and 0 deletions

View File

@@ -0,0 +1,48 @@
import { BaseFileSystem, FileSystem, BFSCallback, FileSystemOptions } from '../core/file_system';
/**
* Configuration options for a FolderAdapter file system.
*/
export interface FolderAdapterOptions {
folder: string;
wrapped: FileSystem;
}
/**
* The FolderAdapter file system wraps a file system, and scopes all interactions to a subfolder of that file system.
*
* Example: Given a file system `foo` with folder `bar` and file `bar/baz`...
*
* ```javascript
* BrowserFS.configure({
* fs: "FolderAdapter",
* options: {
* folder: "bar",
* wrapped: foo
* }
* }, function(e) {
* var fs = BrowserFS.BFSRequire('fs');
* fs.readdirSync('/'); // ['baz']
* });
* ```
*/
export default class FolderAdapter extends BaseFileSystem implements FileSystem {
static readonly Name = "FolderAdapter";
static readonly Options: FileSystemOptions;
/**
* Creates a FolderAdapter instance with the given options.
*/
static Create(opts: FolderAdapterOptions, cb: BFSCallback<FolderAdapter>): void;
static isAvailable(): boolean;
_wrapped: FileSystem;
_folder: string;
private constructor();
getName(): string;
isReadOnly(): boolean;
supportsProps(): boolean;
supportsSynch(): boolean;
supportsLinks(): boolean;
/**
* Initialize the file system. Ensures that the wrapped file system
* has the given folder.
*/
private _initialize;
}