forked from BabylonJS/Editor
-
Notifications
You must be signed in to change notification settings - Fork 0
/
babylonjs-editor-code-editor.d.ts
152 lines (145 loc) · 5.19 KB
/
babylonjs-editor-code-editor.d.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
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
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
// Generated by dts-bundle v0.7.3
// Dependencies for this module:
// ../../../babylonjs
// ../../../babylonjs-editor
declare module 'babylonjs-editor-code-editor' {
import CodeProjectEditor, { Script } from 'babylonjs-editor-code-editor/project-editor';
export default CodeProjectEditor;
export { Script };
}
declare module 'babylonjs-editor-code-editor/project-editor' {
import { Scene } from 'babylonjs';
import Editor, { Layout } from 'babylonjs-editor';
import CodeGraph from 'babylonjs-editor-code-editor/graph';
import CodeLayout from 'babylonjs-editor-code-editor/code-layout';
import CodeEditorToolbar from 'babylonjs-editor-code-editor/toolbar';
/**
* Script interface that all editable scripts should follow
*/
export interface Script {
id: string;
name: string;
code: string;
compiledCode: string;
}
export default class CodeProjectEditor {
editor: Editor;
scene: Scene;
scripts: Script[];
layout: Layout;
graph: CodeGraph;
codeLayout: CodeLayout;
toolbar: CodeEditorToolbar;
/**
* Constructor
* @param editor the editor reference
*/
constructor(editor: Editor);
/**
* Creates the code editor
*/
create(): Promise<void>;
/**
* Resizes the code editor
*/
resize(): void;
/**
* Refreshes the code editor
*/
refresh(): void;
}
}
declare module 'babylonjs-editor-code-editor/graph' {
import { Tree } from "babylonjs-editor";
import CodeProjectEditor from "babylonjs-editor-code-editor/project-editor";
export default class CodeGraph {
codeEditor: CodeProjectEditor;
tree: Tree;
scriptsRoot: string;
postProcessesRoot: string;
static Uid: number;
/**
* Constructor
* @param codeEditor the code editor reference
*/
constructor(codeEditor: CodeProjectEditor);
/**
* Fills the graph
*/
fill(): void;
}
}
declare module 'babylonjs-editor-code-editor/code-layout' {
import { ResizableLayout, IStringDictionary } from "babylonjs-editor";
import CodeProjectEditor, { Script } from 'babylonjs-editor-code-editor/project-editor';
import CodeEdit from "babylonjs-editor-code-editor/code-editor";
export interface OpenedCodeEditor {
editor: CodeEdit;
script: Script;
}
export default class CodeLayout {
codeEditor: CodeProjectEditor;
layout: ResizableLayout;
openedCodeEditors: IStringDictionary<OpenedCodeEditor>;
/**
* Constructor
* @param codeEditor the code editor reference
*/
constructor(codeEditor: CodeProjectEditor);
/**
* Creates the resizable layout
*/
create(): Promise<void>;
/**
* Opens a new code editor
* @param script the code to modify
*/
openCode(script: Script): Promise<void>;
/**
* Closes the code editor identified by the given Id
* @param codeId the code if to close
*/
closeCode(codeId: string): void;
/**
* Updates the typings
*/
updateTypings(): void;
}
}
declare module 'babylonjs-editor-code-editor/toolbar' {
import { Toolbar } from 'babylonjs-editor';
import CodeProjectEditor from 'babylonjs-editor-code-editor/project-editor';
export default class CodeEditorToolbar {
codeEditor: CodeProjectEditor;
toolbar: Toolbar;
/**
* Constructor
* @param codeEditor the code editor reference
*/
constructor(codeEditor: CodeProjectEditor);
/**
* Once the user clicks on a menu of the main toolbar
* @param target the target element
*/
protected onClick(target: string): Promise<void>;
}
}
declare module 'babylonjs-editor-code-editor/code-editor' {
import { CodeEditor } from 'babylonjs-editor';
import CodeProjectEditor, { Script } from 'babylonjs-editor-code-editor/project-editor';
export default class CodeEdit {
codeEditor: CodeProjectEditor;
code: CodeEditor;
onClose: () => void;
onChange: () => void;
/**
* Constructor
* @param codeEditor the code editor reference
*/
constructor(codeEditor: CodeProjectEditor);
/**
* Creates the code editor
*/
create(code: Script): Promise<void>;
}
}