forked from jvilk/BrowserFS
-
Notifications
You must be signed in to change notification settings - Fork 0
/
typedoc.ts
49 lines (46 loc) · 1.48 KB
/
typedoc.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
import {FileSystem} from './core/file_system';
/**
* We use typedoc in 'file' mode to avoid many issues.
* Unfortunately, it does not process export statements properly in some circumstances.
* Here, we redefine the main BrowserFS object for documentation purposes.
*/
import {FileSystem as Backends, BFSRequire} from './index';
/**
* BrowserFS's main interface.
*
* In the browser, this is exposed as the `BrowserFS` global.
*
* In node, this is the object you receive when you `require('browserfs')`.
*/
export interface BrowserFS {
/**
* Exposes all of the file system backends available in BrowserFS.
*/
FileSystem: typeof Backends;
/**
* Emulates Node's `require()` function for filesystem-related modules (`'fs'`, `'path'`, `'buffer'`, etc).
*/
BFSRequire: typeof BFSRequire;
/**
* You must call this function with a properly-instantiated root file system
* before using any file system API method.
* @param rootFS The root filesystem to use for the
* entire BrowserFS file system.
*/
initialize(rootFS: FileSystem): void;
/**
* Installs BrowserFS onto the given object.
* We recommend that you run install with the 'window' object to make things
* global, as in Node.
*
* Properties installed:
*
* * Buffer
* * process
* * require (we monkey-patch it)
*
* This allows you to write code as if you were running inside Node.
* @param obj The object to install things onto (e.g. window)
*/
install(obj: any): void;
}