forked from codesandbox/codesandbox-client
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtypes.d.ts
More file actions
76 lines (68 loc) · 1.57 KB
/
types.d.ts
File metadata and controls
76 lines (68 loc) · 1.57 KB
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
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
export interface IFile {
code: string;
}
export interface IFiles {
[path: string]: IFile;
}
export interface IModule {
code: string;
path: string;
}
export interface IModuleSource {
fileName: string;
compiledCode: string;
sourceMap: Object | undefined;
}
export interface IModuleError {
title: string;
message: string;
path: string;
line: number;
column: number;
}
export interface ITranspiledModule {
module: IModule;
query: string;
source: IModuleSource | undefined;
assets: {
[name: string]: IModuleSource;
};
isEntry: boolean;
isTestFile: boolean;
childModules: Array<string>;
/**
* All extra modules emitted by the loader
*/
emittedAssets: Array<IModuleSource>;
initiators: Array<string>;
dependencies: Array<string>;
asyncDependencies: Array<string>;
transpilationDependencies: Array<string>;
transpilationInitiators: Array<string>;
}
export interface IManagerState {
entry: string;
transpiledModules: {
[id: string]: ITranspiledModule;
};
}
export interface ISandpackContext {
browserFrame: HTMLIFrameElement | null;
managerStatus: ManagerStatus;
managerState: IManagerState | undefined;
bundlerURL: string | undefined;
browserPath: string;
openedPath: string;
errors: Array<IModuleError>;
files: IFiles;
openFile: (path: string) => void;
updateFiles: (files: IFiles) => void;
getManagerTranspilerContext: () => Promise<{ [transpiler: string]: Object }>;
}
export type ManagerStatus =
| 'initializing'
| 'installing-dependencies'
| 'transpiling'
| 'evaluating'
| 'running-tests'
| 'idle';