@microbit/makecode-embed 0.0.0-alpha.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE.md +21 -0
- package/README.md +43 -0
- package/dist/react/MakeCodeBlocksRendering.d.ts +24 -0
- package/dist/react/MakeCodeBlocksRendering.js +80 -0
- package/dist/react/MakeCodeBlocksRendering.js.map +1 -0
- package/dist/react/MakeCodeFrame.d.ts +38 -0
- package/dist/react/MakeCodeFrame.js +72 -0
- package/dist/react/MakeCodeFrame.js.map +1 -0
- package/dist/react/MakeCodeRenderBlocksProvider.d.ts +8 -0
- package/dist/react/MakeCodeRenderBlocksProvider.js +14 -0
- package/dist/react/MakeCodeRenderBlocksProvider.js.map +1 -0
- package/dist/react/index.d.ts +4 -0
- package/dist/react/index.js +4 -0
- package/dist/react/index.js.map +1 -0
- package/dist/react/useMakeCodeRenderBlocks.d.ts +6 -0
- package/dist/react/useMakeCodeRenderBlocks.js +16 -0
- package/dist/react/useMakeCodeRenderBlocks.js.map +1 -0
- package/dist/vanilla/examples.d.ts +3 -0
- package/dist/vanilla/examples.js +17 -0
- package/dist/vanilla/examples.js.map +1 -0
- package/dist/vanilla/index.d.ts +4 -0
- package/dist/vanilla/index.js +4 -0
- package/dist/vanilla/index.js.map +1 -0
- package/dist/vanilla/makecode-frame-driver.d.ts +263 -0
- package/dist/vanilla/makecode-frame-driver.js +609 -0
- package/dist/vanilla/makecode-frame-driver.js.map +1 -0
- package/dist/vanilla/makecode-render-blocks.d.ts +32 -0
- package/dist/vanilla/makecode-render-blocks.js +214 -0
- package/dist/vanilla/makecode-render-blocks.js.map +1 -0
- package/dist/vanilla/pxt.d.ts +875 -0
- package/dist/vanilla/pxt.js +33 -0
- package/dist/vanilla/pxt.js.map +1 -0
- package/package.json +68 -0
- package/storybook-static/assets/Color-KGDBMAHA-Dc_5Y-jU.js +1 -0
- package/storybook-static/assets/DocsRenderer-PKQXORMH-Cguo1Gle.js +574 -0
- package/storybook-static/assets/MakeCodeBlocksRendering.stories-BlUxOnyw.js +464 -0
- package/storybook-static/assets/MakeCodeFrame.stories-CLEdpFft.js +47 -0
- package/storybook-static/assets/entry-preview-BD3I3EAZ.js +1 -0
- package/storybook-static/assets/entry-preview-docs-BZaLlg6H.js +62 -0
- package/storybook-static/assets/iframe-BXldcLa5.js +2 -0
- package/storybook-static/assets/index-BrV66TDq.js +1 -0
- package/storybook-static/assets/index-CCdbwdZP.js +1 -0
- package/storybook-static/assets/index-D-8MO0q_.js +1 -0
- package/storybook-static/assets/index-DrFu-skq.js +6 -0
- package/storybook-static/assets/index-SSXOyoI7.js +9 -0
- package/storybook-static/assets/isArray-D0A16MCt.js +8 -0
- package/storybook-static/assets/jsx-runtime-DFKZ3ixi.js +9 -0
- package/storybook-static/assets/preview-9hFJSo5S.js +20 -0
- package/storybook-static/assets/preview-BJPLiuSt.js +1 -0
- package/storybook-static/assets/preview-BnWGZYux.js +1 -0
- package/storybook-static/assets/preview-BpcF_O6y.js +7 -0
- package/storybook-static/assets/preview-BrwKgnKZ.js +2 -0
- package/storybook-static/assets/preview-CIRcjyVj.js +1 -0
- package/storybook-static/assets/preview-Cdum89jS.js +1 -0
- package/storybook-static/assets/preview-Ct5NkTJf.js +1 -0
- package/storybook-static/assets/preview-DB9FwMii.js +396 -0
- package/storybook-static/assets/preview-gLmJTRpJ.js +28 -0
- package/storybook-static/assets/react-18-4p7UWKLl.js +24 -0
- package/storybook-static/favicon.svg +1 -0
- package/storybook-static/iframe.html +639 -0
- package/storybook-static/index.html +181 -0
- package/storybook-static/index.json +1 -0
- package/storybook-static/nunito-sans-bold-italic.woff2 +0 -0
- package/storybook-static/nunito-sans-bold.woff2 +0 -0
- package/storybook-static/nunito-sans-italic.woff2 +0 -0
- package/storybook-static/nunito-sans-regular.woff2 +0 -0
- package/storybook-static/project.json +1 -0
- package/storybook-static/sb-addons/chromatic-com-storybook-9/manager-bundle.js +333 -0
- package/storybook-static/sb-addons/chromatic-com-storybook-9/manager-bundle.js.LEGAL.txt +40 -0
- package/storybook-static/sb-addons/essentials-actions-3/manager-bundle.js +3 -0
- package/storybook-static/sb-addons/essentials-actions-3/manager-bundle.js.LEGAL.txt +0 -0
- package/storybook-static/sb-addons/essentials-backgrounds-4/manager-bundle.js +12 -0
- package/storybook-static/sb-addons/essentials-backgrounds-4/manager-bundle.js.LEGAL.txt +0 -0
- package/storybook-static/sb-addons/essentials-controls-2/manager-bundle.js +412 -0
- package/storybook-static/sb-addons/essentials-controls-2/manager-bundle.js.LEGAL.txt +0 -0
- package/storybook-static/sb-addons/essentials-measure-7/manager-bundle.js +3 -0
- package/storybook-static/sb-addons/essentials-measure-7/manager-bundle.js.LEGAL.txt +0 -0
- package/storybook-static/sb-addons/essentials-outline-8/manager-bundle.js +3 -0
- package/storybook-static/sb-addons/essentials-outline-8/manager-bundle.js.LEGAL.txt +0 -0
- package/storybook-static/sb-addons/essentials-toolbars-6/manager-bundle.js +3 -0
- package/storybook-static/sb-addons/essentials-toolbars-6/manager-bundle.js.LEGAL.txt +0 -0
- package/storybook-static/sb-addons/essentials-viewport-5/manager-bundle.js +3 -0
- package/storybook-static/sb-addons/essentials-viewport-5/manager-bundle.js.LEGAL.txt +0 -0
- package/storybook-static/sb-addons/interactions-10/manager-bundle.js +234 -0
- package/storybook-static/sb-addons/interactions-10/manager-bundle.js.LEGAL.txt +0 -0
- package/storybook-static/sb-addons/links-1/manager-bundle.js +3 -0
- package/storybook-static/sb-addons/links-1/manager-bundle.js.LEGAL.txt +0 -0
- package/storybook-static/sb-addons/storybook-core-core-server-presets-0/common-manager-bundle.js +3 -0
- package/storybook-static/sb-addons/storybook-core-core-server-presets-0/common-manager-bundle.js.LEGAL.txt +0 -0
- package/storybook-static/sb-common-assets/favicon.svg +1 -0
- package/storybook-static/sb-common-assets/nunito-sans-bold-italic.woff2 +0 -0
- package/storybook-static/sb-common-assets/nunito-sans-bold.woff2 +0 -0
- package/storybook-static/sb-common-assets/nunito-sans-italic.woff2 +0 -0
- package/storybook-static/sb-common-assets/nunito-sans-regular.woff2 +0 -0
- package/storybook-static/sb-manager/globals-module-info.js +995 -0
- package/storybook-static/sb-manager/globals-runtime.js +53525 -0
- package/storybook-static/sb-manager/globals.js +48 -0
- package/storybook-static/sb-manager/runtime.js +11884 -0
- package/storybook-static/sb-preview/globals.js +33 -0
- package/storybook-static/sb-preview/runtime.js +9485 -0
|
@@ -0,0 +1,875 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* MakeCode/pxt types needed for the iframe messages.
|
|
3
|
+
*
|
|
4
|
+
* These are substantially derived from the PXT project. The types are hard to use
|
|
5
|
+
* directly due to logical splits that make sense for MakeCode internally, but not
|
|
6
|
+
* for this interface, and TypeScript features that make them hard to reuse in a
|
|
7
|
+
* library context: namespaces and const enums.
|
|
8
|
+
*
|
|
9
|
+
* We've also extracted interfaces for the request parameters separately from the
|
|
10
|
+
* request metadata and corrected some types that don't appear to behave as
|
|
11
|
+
* described.
|
|
12
|
+
*
|
|
13
|
+
* Original is Copyright (c) Microsoft Corporation
|
|
14
|
+
* MIT licensed: https://github.com/microsoft/pxt/blob/master/LICENSE
|
|
15
|
+
*
|
|
16
|
+
* Modifications are Copright (c) Micro:bit Educational Foundation and contributors
|
|
17
|
+
* 2024.
|
|
18
|
+
*/
|
|
19
|
+
export interface JsonScriptMeta {
|
|
20
|
+
blocksWidth?: number;
|
|
21
|
+
blocksHeight?: number;
|
|
22
|
+
versions?: TargetVersions;
|
|
23
|
+
}
|
|
24
|
+
export interface InstallHeader {
|
|
25
|
+
name: string;
|
|
26
|
+
meta: JsonScriptMeta;
|
|
27
|
+
editor: string;
|
|
28
|
+
board?: string;
|
|
29
|
+
temporary?: boolean;
|
|
30
|
+
target: string;
|
|
31
|
+
targetVersion: string;
|
|
32
|
+
pubId: string;
|
|
33
|
+
pubCurrent: boolean;
|
|
34
|
+
pubVersions?: PublishVersion[];
|
|
35
|
+
pubPermalink?: string;
|
|
36
|
+
anonymousSharePreference?: boolean;
|
|
37
|
+
githubId?: string;
|
|
38
|
+
githubTag?: string;
|
|
39
|
+
githubCurrent?: boolean;
|
|
40
|
+
tutorial?: TutorialOptions;
|
|
41
|
+
tutorialCompleted?: TutorialCompletionInfo;
|
|
42
|
+
extensionUnderTest?: string;
|
|
43
|
+
cloudUserId?: string;
|
|
44
|
+
isSkillmapProject?: boolean;
|
|
45
|
+
}
|
|
46
|
+
export interface Header extends InstallHeader {
|
|
47
|
+
id: string;
|
|
48
|
+
path?: string;
|
|
49
|
+
recentUse: number;
|
|
50
|
+
modificationTime: number;
|
|
51
|
+
icon?: string;
|
|
52
|
+
isDeleted: boolean;
|
|
53
|
+
saveId?: any;
|
|
54
|
+
cloudVersion: string;
|
|
55
|
+
cloudCurrent: boolean;
|
|
56
|
+
cloudLastSyncTime: number;
|
|
57
|
+
backupRef?: string;
|
|
58
|
+
isBackup?: boolean;
|
|
59
|
+
_rev: string;
|
|
60
|
+
}
|
|
61
|
+
interface PublishVersion {
|
|
62
|
+
id: string;
|
|
63
|
+
type: 'snapshot' | 'permalink';
|
|
64
|
+
}
|
|
65
|
+
export type ScriptText = Record<string, string>;
|
|
66
|
+
export interface Project {
|
|
67
|
+
header?: Header;
|
|
68
|
+
text?: ScriptText;
|
|
69
|
+
}
|
|
70
|
+
export interface Asset {
|
|
71
|
+
name: string;
|
|
72
|
+
size: number;
|
|
73
|
+
url: string;
|
|
74
|
+
}
|
|
75
|
+
export type Version = any;
|
|
76
|
+
export interface File {
|
|
77
|
+
header: Header;
|
|
78
|
+
text: ScriptText;
|
|
79
|
+
version: Version;
|
|
80
|
+
}
|
|
81
|
+
export interface EditorMessage {
|
|
82
|
+
/**
|
|
83
|
+
* Constant identifier
|
|
84
|
+
*/
|
|
85
|
+
type: 'pxteditor' | 'pxthost' | 'pxtpkgext' | 'pxtsim';
|
|
86
|
+
/**
|
|
87
|
+
* Original request id
|
|
88
|
+
*/
|
|
89
|
+
id?: string;
|
|
90
|
+
/**
|
|
91
|
+
* flag to request response
|
|
92
|
+
*/
|
|
93
|
+
response?: boolean;
|
|
94
|
+
/**
|
|
95
|
+
* Frame identifier that can be passed to the iframe by adding the frameId query parameter
|
|
96
|
+
*/
|
|
97
|
+
frameId?: string;
|
|
98
|
+
}
|
|
99
|
+
export interface EditorMessageResponse extends EditorMessage {
|
|
100
|
+
/**
|
|
101
|
+
* Additional response payload provided by the command
|
|
102
|
+
*/
|
|
103
|
+
resp?: any;
|
|
104
|
+
/**
|
|
105
|
+
* indicate if operation started or completed successfully
|
|
106
|
+
*/
|
|
107
|
+
success: boolean;
|
|
108
|
+
/**
|
|
109
|
+
* Error object if any
|
|
110
|
+
*/
|
|
111
|
+
error?: any;
|
|
112
|
+
}
|
|
113
|
+
export interface EditorMessageRequest extends EditorMessage {
|
|
114
|
+
/**
|
|
115
|
+
* Request action
|
|
116
|
+
*/
|
|
117
|
+
action: 'switchblocks' | 'switchjavascript' | 'switchpython' | 'startsimulator' | 'restartsimulator' | 'stopsimulator' | 'hidesimulator' | 'showsimulator' | 'closeflyout' | 'newproject' | 'importproject' | 'importexternalproject' | 'importtutorial' | 'openheader' | 'proxytosim' | 'undo' | 'redo' | 'renderblocks' | 'renderpython' | 'renderxml' | 'renderbyblockid' | 'setscale' | 'startactivity' | 'saveproject' | 'compile' | 'unloadproject' | 'shareproject' | 'savelocalprojectstocloud' | 'projectcloudstatus' | 'requestprojectcloudstatus' | 'convertcloudprojectstolocal' | 'setlanguagerestriction' | 'gettoolboxcategories' | 'toggletrace' | 'togglehighcontrast' | 'sethighcontrast' | 'togglegreenscreen' | 'settracestate' | 'setsimulatorfullscreen' | 'print' | 'pair' | 'workspacesync' | 'workspacereset' | 'workspacesave' | 'workspaceloaded' | 'workspaceevent' | 'workspacediagnostics' | 'event' | 'simevent' | 'info' | 'tutorialevent' | 'editorcontentloaded' | 'serviceworkerregistered' | 'runeval';
|
|
118
|
+
}
|
|
119
|
+
/**
|
|
120
|
+
* Request sent by the editor when a tick/error/expection is registered
|
|
121
|
+
*/
|
|
122
|
+
export interface EditorMessageEventRequest extends EditorMessageRequest {
|
|
123
|
+
action: 'event';
|
|
124
|
+
tick: string;
|
|
125
|
+
category?: string;
|
|
126
|
+
message?: string;
|
|
127
|
+
data?: Record<string, string | number>;
|
|
128
|
+
}
|
|
129
|
+
export type EditorMessageTutorialEventRequest = EditorMessageTutorialProgressEventRequest | EditorMessageTutorialCompletedEventRequest | EditorMessageTutorialLoadedEventRequest | EditorMessageTutorialExitEventRequest;
|
|
130
|
+
export interface EditorMessageTutorialProgressEventRequest extends EditorMessageRequest {
|
|
131
|
+
action: 'tutorialevent';
|
|
132
|
+
tutorialEvent: 'progress';
|
|
133
|
+
currentStep: number;
|
|
134
|
+
totalSteps: number;
|
|
135
|
+
isCompleted: boolean;
|
|
136
|
+
tutorialId: string;
|
|
137
|
+
projectHeaderId: string;
|
|
138
|
+
}
|
|
139
|
+
export interface EditorMessageTutorialCompletedEventRequest extends EditorMessageRequest {
|
|
140
|
+
action: 'tutorialevent';
|
|
141
|
+
tutorialEvent: 'completed';
|
|
142
|
+
tutorialId: string;
|
|
143
|
+
projectHeaderId: string;
|
|
144
|
+
}
|
|
145
|
+
export interface EditorMessageTutorialLoadedEventRequest extends EditorMessageRequest {
|
|
146
|
+
action: 'tutorialevent';
|
|
147
|
+
tutorialEvent: 'loaded';
|
|
148
|
+
tutorialId: string;
|
|
149
|
+
projectHeaderId: string;
|
|
150
|
+
}
|
|
151
|
+
export interface EditorMessageTutorialExitEventRequest extends EditorMessageRequest {
|
|
152
|
+
action: 'tutorialevent';
|
|
153
|
+
tutorialEvent: 'exit';
|
|
154
|
+
tutorialId: string;
|
|
155
|
+
projectHeaderId: string;
|
|
156
|
+
}
|
|
157
|
+
export interface EditorMessageStopRequest extends EditorMessageRequest {
|
|
158
|
+
action: 'stopsimulator';
|
|
159
|
+
/**
|
|
160
|
+
* Indicates if simulator iframes should be unloaded or kept hot.
|
|
161
|
+
*/
|
|
162
|
+
unload?: boolean;
|
|
163
|
+
}
|
|
164
|
+
export interface EditorMessageNewProjectRequest extends EditorMessageRequest {
|
|
165
|
+
action: 'newproject';
|
|
166
|
+
/**
|
|
167
|
+
* Additional optional to create new project
|
|
168
|
+
*/
|
|
169
|
+
options?: ProjectCreationOptions;
|
|
170
|
+
}
|
|
171
|
+
export interface EditorContentLoadedRequest extends EditorMessageRequest {
|
|
172
|
+
action: 'editorcontentloaded';
|
|
173
|
+
}
|
|
174
|
+
export interface EditorMessageSetScaleRequest extends EditorMessageRequest {
|
|
175
|
+
action: 'setscale';
|
|
176
|
+
scale: number;
|
|
177
|
+
}
|
|
178
|
+
export interface EditorMessageSimulatorMessageProxyRequest extends EditorMessageRequest {
|
|
179
|
+
action: 'proxytosim';
|
|
180
|
+
/**
|
|
181
|
+
* Content to send to the simulator
|
|
182
|
+
*/
|
|
183
|
+
content: any;
|
|
184
|
+
}
|
|
185
|
+
export interface EditorWorkspaceSyncRequest extends EditorMessageRequest {
|
|
186
|
+
/**
|
|
187
|
+
* Synching projects from host into
|
|
188
|
+
*/
|
|
189
|
+
action: 'workspacesync' | 'workspacereset' | 'workspaceloaded';
|
|
190
|
+
}
|
|
191
|
+
export interface EditorWorkspaceEvent extends EditorMessageRequest {
|
|
192
|
+
action: 'workspaceevent';
|
|
193
|
+
event: EditorEvent;
|
|
194
|
+
}
|
|
195
|
+
export interface EditorWorkspaceDiagnostics extends EditorMessageRequest {
|
|
196
|
+
action: 'workspacediagnostics';
|
|
197
|
+
operation: 'compile' | 'decompile' | 'typecheck';
|
|
198
|
+
output: string;
|
|
199
|
+
diagnostics: {
|
|
200
|
+
code: number;
|
|
201
|
+
category: 'error' | 'warning' | 'message';
|
|
202
|
+
fileName?: string;
|
|
203
|
+
start?: number;
|
|
204
|
+
length?: number;
|
|
205
|
+
line?: number;
|
|
206
|
+
column?: number;
|
|
207
|
+
endLine?: number;
|
|
208
|
+
endColumn?: number;
|
|
209
|
+
}[];
|
|
210
|
+
}
|
|
211
|
+
export interface EditorSyncState {
|
|
212
|
+
filters?: ProjectFilters;
|
|
213
|
+
searchBar?: boolean;
|
|
214
|
+
}
|
|
215
|
+
export interface EditorWorkspaceSyncResponse extends EditorMessageResponse {
|
|
216
|
+
projects: Project[];
|
|
217
|
+
editor?: EditorSyncState;
|
|
218
|
+
controllerId?: string;
|
|
219
|
+
}
|
|
220
|
+
export interface EditorWorkspaceSaveRequest extends EditorMessageRequest {
|
|
221
|
+
action: 'workspacesave';
|
|
222
|
+
project: Project;
|
|
223
|
+
}
|
|
224
|
+
export interface ImportProjectOptions {
|
|
225
|
+
project: Project;
|
|
226
|
+
filters?: ProjectFilters;
|
|
227
|
+
searchBar?: boolean;
|
|
228
|
+
}
|
|
229
|
+
export interface EditorMessageImportProjectRequest extends EditorMessageRequest, ImportProjectOptions {
|
|
230
|
+
action: 'importproject';
|
|
231
|
+
}
|
|
232
|
+
export interface ImportExternalProjectOptions {
|
|
233
|
+
project: Project;
|
|
234
|
+
}
|
|
235
|
+
export interface EditorMessageImportExternalProjectRequest extends EditorMessageRequest, ImportExternalProjectOptions {
|
|
236
|
+
action: 'importexternalproject';
|
|
237
|
+
}
|
|
238
|
+
export interface EditorMessageImportExternalProjectResponse extends EditorMessageResponse {
|
|
239
|
+
action: 'importexternalproject';
|
|
240
|
+
resp: {
|
|
241
|
+
importUrl: string;
|
|
242
|
+
};
|
|
243
|
+
}
|
|
244
|
+
export interface EditorMessageSaveLocalProjectsToCloud extends EditorMessageRequest {
|
|
245
|
+
action: 'savelocalprojectstocloud';
|
|
246
|
+
headerIds: string[];
|
|
247
|
+
}
|
|
248
|
+
export interface EditorMessageSaveLocalProjectsToCloudResponse extends EditorMessageResponse {
|
|
249
|
+
action: 'savelocalprojectstocloud';
|
|
250
|
+
headerIdMap?: Record<string, string>;
|
|
251
|
+
}
|
|
252
|
+
export interface EditorMessageProjectCloudStatus extends EditorMessageRequest {
|
|
253
|
+
action: 'projectcloudstatus';
|
|
254
|
+
headerId: string;
|
|
255
|
+
status: CloudStatus;
|
|
256
|
+
}
|
|
257
|
+
export interface EditorMessageRequestProjectCloudStatus extends EditorMessageRequest {
|
|
258
|
+
action: 'requestprojectcloudstatus';
|
|
259
|
+
headerIds: string[];
|
|
260
|
+
}
|
|
261
|
+
export interface EditorMessageConvertCloudProjectsToLocal extends EditorMessageRequest {
|
|
262
|
+
action: 'convertcloudprojectstolocal';
|
|
263
|
+
userId: string;
|
|
264
|
+
}
|
|
265
|
+
export interface EditorMessageImportTutorialRequest extends EditorMessageRequest {
|
|
266
|
+
action: 'importtutorial';
|
|
267
|
+
markdown: string;
|
|
268
|
+
}
|
|
269
|
+
export interface EditorMessageOpenHeaderRequest extends EditorMessageRequest {
|
|
270
|
+
action: 'openheader';
|
|
271
|
+
headerId: string;
|
|
272
|
+
}
|
|
273
|
+
export interface RenderBlocksOptions {
|
|
274
|
+
ts: string;
|
|
275
|
+
snippetMode?: boolean;
|
|
276
|
+
layout?: BlockLayout;
|
|
277
|
+
}
|
|
278
|
+
export interface EditorMessageRenderBlocksRequest extends EditorMessageRequest, RenderBlocksOptions {
|
|
279
|
+
action: 'renderblocks';
|
|
280
|
+
}
|
|
281
|
+
export interface RenderXmlOptions {
|
|
282
|
+
xml: string;
|
|
283
|
+
snippetMode?: boolean;
|
|
284
|
+
layout?: BlockLayout;
|
|
285
|
+
}
|
|
286
|
+
export interface EditorMessageRenderXmlRequest extends EditorMessageRequest, RenderXmlOptions {
|
|
287
|
+
action: 'renderxml';
|
|
288
|
+
}
|
|
289
|
+
export interface RenderByBlockIdOptions {
|
|
290
|
+
blockId: string;
|
|
291
|
+
snippetMode?: boolean;
|
|
292
|
+
layout?: BlockLayout;
|
|
293
|
+
}
|
|
294
|
+
export interface EditorMessageRenderByBlockIdRequest extends EditorMessageRequest, RenderByBlockIdOptions {
|
|
295
|
+
action: 'renderbyblockid';
|
|
296
|
+
}
|
|
297
|
+
export interface EditorMessageRenderBlocksResponse {
|
|
298
|
+
resp: string | undefined;
|
|
299
|
+
}
|
|
300
|
+
export interface EditorMessageRenderXmlResponse {
|
|
301
|
+
resp: string | undefined;
|
|
302
|
+
}
|
|
303
|
+
export interface EditorMessageRenderByBlockIdResponse {
|
|
304
|
+
resp: string | undefined;
|
|
305
|
+
}
|
|
306
|
+
export interface EditorMessageRenderPythonRequest extends EditorMessageRequest {
|
|
307
|
+
action: 'renderpython';
|
|
308
|
+
ts: string;
|
|
309
|
+
}
|
|
310
|
+
export interface EditorMessageRenderPythonResponse {
|
|
311
|
+
resp: string;
|
|
312
|
+
}
|
|
313
|
+
export interface EditorSimulatorEvent extends EditorMessageRequest {
|
|
314
|
+
action: 'simevent';
|
|
315
|
+
subtype: 'toplevelfinished' | 'started' | 'stopped' | 'resumed';
|
|
316
|
+
}
|
|
317
|
+
export interface EditorSimulatorStoppedEvent extends EditorSimulatorEvent {
|
|
318
|
+
subtype: 'stopped';
|
|
319
|
+
exception?: string;
|
|
320
|
+
}
|
|
321
|
+
export interface EditorMessageToggleTraceRequest extends EditorMessageRequest {
|
|
322
|
+
action: 'toggletrace';
|
|
323
|
+
intervalSpeed?: number;
|
|
324
|
+
}
|
|
325
|
+
export interface EditorMessageSetTraceStateRequest extends EditorMessageRequest {
|
|
326
|
+
action: 'settracestate';
|
|
327
|
+
enabled: boolean;
|
|
328
|
+
intervalSpeed?: number;
|
|
329
|
+
}
|
|
330
|
+
export interface EditorMessageSetSimulatorFullScreenRequest extends EditorMessageRequest {
|
|
331
|
+
action: 'setsimulatorfullscreen';
|
|
332
|
+
enabled: boolean;
|
|
333
|
+
}
|
|
334
|
+
export interface EditorMessageSetHighContrastRequest extends EditorMessageRequest {
|
|
335
|
+
action: 'sethighcontrast';
|
|
336
|
+
on: boolean;
|
|
337
|
+
}
|
|
338
|
+
export interface StartActivityOptions {
|
|
339
|
+
activityType: 'tutorial' | 'example' | 'recipe';
|
|
340
|
+
path: string;
|
|
341
|
+
title?: string;
|
|
342
|
+
previousProjectHeaderId?: string;
|
|
343
|
+
carryoverPreviousCode?: boolean;
|
|
344
|
+
}
|
|
345
|
+
export interface EditorMessageStartActivity extends EditorMessageRequest, StartActivityOptions {
|
|
346
|
+
action: 'startactivity';
|
|
347
|
+
}
|
|
348
|
+
export interface InfoMessage {
|
|
349
|
+
versions: TargetVersions;
|
|
350
|
+
locale: string;
|
|
351
|
+
availableLocales?: string[];
|
|
352
|
+
}
|
|
353
|
+
export interface PackageExtensionData {
|
|
354
|
+
ts: string;
|
|
355
|
+
json?: any;
|
|
356
|
+
}
|
|
357
|
+
export interface EditorPkgExtMessageRequest extends EditorMessageRequest {
|
|
358
|
+
package: string;
|
|
359
|
+
}
|
|
360
|
+
export interface EditorPkgExtMessageResponse extends EditorMessageResponse {
|
|
361
|
+
package: string;
|
|
362
|
+
}
|
|
363
|
+
export interface EditorSimulatorTickEvent extends EditorMessageEventRequest {
|
|
364
|
+
type: 'pxtsim';
|
|
365
|
+
}
|
|
366
|
+
export interface EditorShareRequest extends EditorMessageRequest {
|
|
367
|
+
action: 'shareproject';
|
|
368
|
+
headerId: string;
|
|
369
|
+
projectName: string;
|
|
370
|
+
}
|
|
371
|
+
export interface ShareResult {
|
|
372
|
+
embed: {
|
|
373
|
+
code: string;
|
|
374
|
+
editor: string;
|
|
375
|
+
simulator: string;
|
|
376
|
+
};
|
|
377
|
+
qr: string;
|
|
378
|
+
url: string;
|
|
379
|
+
}
|
|
380
|
+
export interface EditorShareResponse extends EditorMessageResponse {
|
|
381
|
+
action: 'shareproject';
|
|
382
|
+
resp: ShareResult;
|
|
383
|
+
}
|
|
384
|
+
export interface EditorSetLanguageRestriction extends EditorMessageRequest {
|
|
385
|
+
action: 'setlanguagerestriction';
|
|
386
|
+
restriction: LanguageRestriction;
|
|
387
|
+
}
|
|
388
|
+
export interface EditorMessageGetToolboxCategoriesRequest extends EditorMessageRequest {
|
|
389
|
+
action: 'gettoolboxcategories';
|
|
390
|
+
advanced?: boolean;
|
|
391
|
+
}
|
|
392
|
+
export interface EditorMessageServiceWorkerRegisteredRequest extends EditorMessageRequest {
|
|
393
|
+
action: 'serviceworkerregistered';
|
|
394
|
+
}
|
|
395
|
+
export interface EditorMessageGetToolboxCategoriesResponse {
|
|
396
|
+
categories: ToolboxCategoryDefinition[];
|
|
397
|
+
}
|
|
398
|
+
interface ProjectTemplate {
|
|
399
|
+
id: string;
|
|
400
|
+
config: PackageConfig;
|
|
401
|
+
files: Record<string, string>;
|
|
402
|
+
}
|
|
403
|
+
export interface ProjectCreationOptions {
|
|
404
|
+
prj?: ProjectTemplate;
|
|
405
|
+
name?: string;
|
|
406
|
+
documentation?: string;
|
|
407
|
+
filesOverride?: Record<string, string>;
|
|
408
|
+
filters?: ProjectFilters;
|
|
409
|
+
temporary?: boolean;
|
|
410
|
+
tutorial?: TutorialOptions;
|
|
411
|
+
dependencies?: Record<string, string>;
|
|
412
|
+
tsOnly?: boolean;
|
|
413
|
+
languageRestriction?: LanguageRestriction;
|
|
414
|
+
preferredEditor?: string;
|
|
415
|
+
extensionUnderTest?: string;
|
|
416
|
+
skillmapProject?: boolean;
|
|
417
|
+
simTheme?: Partial<PackageConfig>;
|
|
418
|
+
firstProject?: boolean;
|
|
419
|
+
}
|
|
420
|
+
export interface ProjectFilters {
|
|
421
|
+
namespaces?: {
|
|
422
|
+
[index: string]: FilterState;
|
|
423
|
+
};
|
|
424
|
+
blocks?: {
|
|
425
|
+
[index: string]: FilterState;
|
|
426
|
+
};
|
|
427
|
+
fns?: {
|
|
428
|
+
[index: string]: FilterState;
|
|
429
|
+
};
|
|
430
|
+
defaultState?: FilterState;
|
|
431
|
+
}
|
|
432
|
+
export declare enum FilterState {
|
|
433
|
+
Hidden = 0,
|
|
434
|
+
Visible = 1,
|
|
435
|
+
Disabled = 2
|
|
436
|
+
}
|
|
437
|
+
export declare enum BlockLayout {
|
|
438
|
+
None = 0,
|
|
439
|
+
Align = 1,
|
|
440
|
+
Clean = 3,
|
|
441
|
+
Flow = 4
|
|
442
|
+
}
|
|
443
|
+
export type EditorType = 'blocks' | 'ts';
|
|
444
|
+
export type EditorEvent = CreateEvent | UIEvent;
|
|
445
|
+
export interface CreateEvent {
|
|
446
|
+
type: 'create';
|
|
447
|
+
blockId: string;
|
|
448
|
+
}
|
|
449
|
+
export interface UIEvent {
|
|
450
|
+
type: 'ui';
|
|
451
|
+
action: 'groupHelpClicked';
|
|
452
|
+
data?: Record<string, string>;
|
|
453
|
+
}
|
|
454
|
+
export interface NativeHostMessage {
|
|
455
|
+
name?: string;
|
|
456
|
+
download?: string;
|
|
457
|
+
save?: string;
|
|
458
|
+
cmd?: string;
|
|
459
|
+
}
|
|
460
|
+
export interface ImportFileOptions {
|
|
461
|
+
filename: string;
|
|
462
|
+
parts: (string | ArrayBuffer)[];
|
|
463
|
+
}
|
|
464
|
+
export type LanguageRestriction = /* Standard */ '' | 'python-only' | 'javascript-only' | 'blocks-only' | 'no-blocks' | 'no-python' | 'no-javascript';
|
|
465
|
+
export interface ToolboxCategoryDefinition {
|
|
466
|
+
/**
|
|
467
|
+
* The display name for the category
|
|
468
|
+
*/
|
|
469
|
+
name?: string;
|
|
470
|
+
/**
|
|
471
|
+
* The icon of this category
|
|
472
|
+
*/
|
|
473
|
+
icon?: string;
|
|
474
|
+
/**
|
|
475
|
+
* The color of this category
|
|
476
|
+
*/
|
|
477
|
+
color?: string;
|
|
478
|
+
/**
|
|
479
|
+
* The weight of the category relative to other categories in the toolbox
|
|
480
|
+
*/
|
|
481
|
+
weight?: number;
|
|
482
|
+
/**
|
|
483
|
+
* Whether or not the category should be placed in the advanced category
|
|
484
|
+
*/
|
|
485
|
+
advanced?: boolean;
|
|
486
|
+
/**
|
|
487
|
+
* Blocks to appear in the category. Specifying this field will override
|
|
488
|
+
* all existing blocks in the category. The ordering of the blocks is
|
|
489
|
+
* determined by the ordering of this array.
|
|
490
|
+
*/
|
|
491
|
+
blocks?: ToolboxBlockDefinition[];
|
|
492
|
+
/**
|
|
493
|
+
* Ordering of category groups
|
|
494
|
+
*/
|
|
495
|
+
groups?: string[];
|
|
496
|
+
}
|
|
497
|
+
export interface ToolboxBlockDefinition {
|
|
498
|
+
/**
|
|
499
|
+
* Internal id used to refer to this block or snippet, must be unique
|
|
500
|
+
*/
|
|
501
|
+
name: string;
|
|
502
|
+
/**
|
|
503
|
+
* Group label used to categorize block. Blocks are arranged with other
|
|
504
|
+
* blocks that share the same group.
|
|
505
|
+
*/
|
|
506
|
+
group?: string;
|
|
507
|
+
/**
|
|
508
|
+
* Indicates an advanced API. Advanced APIs appear after basic ones in the
|
|
509
|
+
* toolbox
|
|
510
|
+
*/
|
|
511
|
+
advanced?: boolean;
|
|
512
|
+
/**
|
|
513
|
+
* The weight for the block. Blocks are arranged in order of they appear in the category
|
|
514
|
+
* definition's array but the weight can be specified in the case that other APIs are
|
|
515
|
+
* dynamically added to the category (eg. loops.forever())
|
|
516
|
+
*/
|
|
517
|
+
weight?: number;
|
|
518
|
+
/**
|
|
519
|
+
* Description of code to appear in the hover text
|
|
520
|
+
*/
|
|
521
|
+
jsDoc?: string;
|
|
522
|
+
/**
|
|
523
|
+
* TypeScript snippet of code to insert when dragged into editor
|
|
524
|
+
*/
|
|
525
|
+
snippet?: string;
|
|
526
|
+
/**
|
|
527
|
+
* Python snippet of code to insert when dragged into editor
|
|
528
|
+
*/
|
|
529
|
+
pySnippet?: string;
|
|
530
|
+
/**
|
|
531
|
+
* TypeScript name used for highlighting the snippet, uses name if not defined
|
|
532
|
+
*/
|
|
533
|
+
snippetName?: string;
|
|
534
|
+
/**
|
|
535
|
+
* Python name used for highlighting the snippet, uses name if not defined
|
|
536
|
+
*/
|
|
537
|
+
pySnippetName?: string;
|
|
538
|
+
/**
|
|
539
|
+
* Display just the snippet and nothing else. Should be set to true for
|
|
540
|
+
* language constructs (eg. for-loops) and to false for function
|
|
541
|
+
* calls (eg. Math.random())
|
|
542
|
+
*/
|
|
543
|
+
snippetOnly?: boolean;
|
|
544
|
+
/**
|
|
545
|
+
* The return type of the block. This is used to determine the shape of the block rendered.
|
|
546
|
+
*/
|
|
547
|
+
retType?: string;
|
|
548
|
+
/**
|
|
549
|
+
* The block definition in XML for the blockly toolbox.
|
|
550
|
+
*/
|
|
551
|
+
blockXml?: string;
|
|
552
|
+
/**
|
|
553
|
+
* The Blockly block id used to identify this block.
|
|
554
|
+
*/
|
|
555
|
+
blockId?: string;
|
|
556
|
+
}
|
|
557
|
+
export type CloudStatus = 'none' | 'synced' | 'justSynced' | 'offline' | 'syncing' | 'conflict' | 'localEdits';
|
|
558
|
+
interface TargetVersions {
|
|
559
|
+
target: string;
|
|
560
|
+
targetId?: string;
|
|
561
|
+
targetWebsite?: string;
|
|
562
|
+
pxt?: string;
|
|
563
|
+
tag?: string;
|
|
564
|
+
branch?: string;
|
|
565
|
+
commits?: string;
|
|
566
|
+
}
|
|
567
|
+
type CodeCardType = 'file' | 'example' | 'codeExample' | 'tutorial' | 'side' | 'template' | 'package' | 'hw' | 'forumUrl' | 'forumExample' | 'sharedExample' | 'link';
|
|
568
|
+
type CodeCardEditorType = 'blocks' | 'js' | 'py';
|
|
569
|
+
interface Map<T> {
|
|
570
|
+
[index: string]: T;
|
|
571
|
+
}
|
|
572
|
+
interface TargetVersions {
|
|
573
|
+
target: string;
|
|
574
|
+
targetId?: string;
|
|
575
|
+
targetWebsite?: string;
|
|
576
|
+
pxt?: string;
|
|
577
|
+
tag?: string;
|
|
578
|
+
branch?: string;
|
|
579
|
+
commits?: string;
|
|
580
|
+
}
|
|
581
|
+
interface Size {
|
|
582
|
+
width: number;
|
|
583
|
+
height: number;
|
|
584
|
+
}
|
|
585
|
+
interface CodeCardAction {
|
|
586
|
+
url: string;
|
|
587
|
+
editor?: CodeCardEditorType;
|
|
588
|
+
cardType?: CodeCardType;
|
|
589
|
+
}
|
|
590
|
+
/**
|
|
591
|
+
* The schema for the pxt.json package files
|
|
592
|
+
*/
|
|
593
|
+
interface PackageConfig {
|
|
594
|
+
name: string;
|
|
595
|
+
version?: string;
|
|
596
|
+
icon?: string;
|
|
597
|
+
documentation?: string;
|
|
598
|
+
targetVersions?: TargetVersions;
|
|
599
|
+
description?: string;
|
|
600
|
+
dependencies: Map<string>;
|
|
601
|
+
license?: string;
|
|
602
|
+
authors?: string[];
|
|
603
|
+
files: string[];
|
|
604
|
+
simFiles?: string[];
|
|
605
|
+
testFiles?: string[];
|
|
606
|
+
fileDependencies?: Map<string>;
|
|
607
|
+
preferredEditor?: string;
|
|
608
|
+
languageRestriction?: LanguageRestriction;
|
|
609
|
+
testDependencies?: Record<string, string>;
|
|
610
|
+
cppDependencies?: Record<string, string>;
|
|
611
|
+
public?: boolean;
|
|
612
|
+
partial?: boolean;
|
|
613
|
+
binaryonly?: boolean;
|
|
614
|
+
platformio?: PlatformIOConfig;
|
|
615
|
+
compileServiceVariant?: string;
|
|
616
|
+
palette?: string[];
|
|
617
|
+
paletteNames?: string[];
|
|
618
|
+
screenSize?: Size;
|
|
619
|
+
yotta?: YottaConfig;
|
|
620
|
+
codal?: CodalConfig;
|
|
621
|
+
npmDependencies?: Map<string>;
|
|
622
|
+
card?: CodeCard;
|
|
623
|
+
additionalFilePath?: string;
|
|
624
|
+
additionalFilePaths?: string[];
|
|
625
|
+
core?: boolean;
|
|
626
|
+
weight?: number;
|
|
627
|
+
gistId?: string;
|
|
628
|
+
extension?: PackageExtension;
|
|
629
|
+
isExtension?: boolean;
|
|
630
|
+
dalDTS?: {
|
|
631
|
+
corePackage?: string;
|
|
632
|
+
includeDirs?: string[];
|
|
633
|
+
excludePrefix?: string[];
|
|
634
|
+
compileServiceVariant?: string;
|
|
635
|
+
};
|
|
636
|
+
features?: string[];
|
|
637
|
+
hidden?: boolean;
|
|
638
|
+
searchOnly?: boolean;
|
|
639
|
+
skipLocalization?: boolean;
|
|
640
|
+
snippetBuilders?: SnippetConfig[];
|
|
641
|
+
experimentalHw?: boolean;
|
|
642
|
+
requiredCategories?: string[];
|
|
643
|
+
supportedTargets?: string[];
|
|
644
|
+
firmwareUrl?: string;
|
|
645
|
+
disablesVariants?: string[];
|
|
646
|
+
utf8?: boolean;
|
|
647
|
+
disableTargetTemplateFiles?: boolean;
|
|
648
|
+
theme?: string | Record<string, string>;
|
|
649
|
+
assetPack?: boolean;
|
|
650
|
+
assetPacks?: Map<boolean>;
|
|
651
|
+
}
|
|
652
|
+
interface PackageExtension {
|
|
653
|
+
namespace?: string;
|
|
654
|
+
group?: string;
|
|
655
|
+
label?: string;
|
|
656
|
+
color?: string;
|
|
657
|
+
advanced?: boolean;
|
|
658
|
+
url?: string;
|
|
659
|
+
localUrl?: string;
|
|
660
|
+
}
|
|
661
|
+
interface PlatformIOConfig {
|
|
662
|
+
dependencies?: Map<string>;
|
|
663
|
+
}
|
|
664
|
+
interface CompilationConfig {
|
|
665
|
+
description: string;
|
|
666
|
+
config: any;
|
|
667
|
+
}
|
|
668
|
+
interface CodalConfig {
|
|
669
|
+
libraries?: string[];
|
|
670
|
+
}
|
|
671
|
+
interface YottaConfig {
|
|
672
|
+
dependencies?: Map<string>;
|
|
673
|
+
config?: any;
|
|
674
|
+
/**
|
|
675
|
+
* Overridable config flags
|
|
676
|
+
*/
|
|
677
|
+
optionalConfig?: any;
|
|
678
|
+
userConfigs?: CompilationConfig[];
|
|
679
|
+
configIsJustDefaults?: boolean;
|
|
680
|
+
ignoreConflicts?: boolean;
|
|
681
|
+
}
|
|
682
|
+
interface CodeCard {
|
|
683
|
+
name?: string;
|
|
684
|
+
shortName?: string;
|
|
685
|
+
title?: string;
|
|
686
|
+
role?: string;
|
|
687
|
+
ariaLabel?: string;
|
|
688
|
+
label?: string;
|
|
689
|
+
labelIcon?: string;
|
|
690
|
+
labelClass?: string;
|
|
691
|
+
tags?: string[];
|
|
692
|
+
tabIndex?: number;
|
|
693
|
+
style?: string;
|
|
694
|
+
color?: string;
|
|
695
|
+
description?: string;
|
|
696
|
+
extracontent?: string;
|
|
697
|
+
blocksXml?: string;
|
|
698
|
+
typeScript?: string;
|
|
699
|
+
imageUrl?: string;
|
|
700
|
+
largeImageUrl?: string;
|
|
701
|
+
videoUrl?: string;
|
|
702
|
+
youTubeId?: string;
|
|
703
|
+
youTubePlaylistId?: string;
|
|
704
|
+
buttonLabel?: string;
|
|
705
|
+
actionIcon?: string;
|
|
706
|
+
time?: number;
|
|
707
|
+
url?: string;
|
|
708
|
+
learnMoreUrl?: string;
|
|
709
|
+
buyUrl?: string;
|
|
710
|
+
feedbackUrl?: string;
|
|
711
|
+
responsive?: boolean;
|
|
712
|
+
cardType?: CodeCardType;
|
|
713
|
+
editor?: CodeCardEditorType;
|
|
714
|
+
otherActions?: CodeCardAction[];
|
|
715
|
+
directOpen?: boolean;
|
|
716
|
+
projectId?: string;
|
|
717
|
+
header?: string;
|
|
718
|
+
tutorialStep?: number;
|
|
719
|
+
tutorialLength?: number;
|
|
720
|
+
icon?: string;
|
|
721
|
+
iconContent?: string;
|
|
722
|
+
iconColor?: string;
|
|
723
|
+
onClick?: (e: any) => void;
|
|
724
|
+
onLabelClicked?: (e: any) => void;
|
|
725
|
+
target?: string;
|
|
726
|
+
className?: string;
|
|
727
|
+
variant?: string;
|
|
728
|
+
}
|
|
729
|
+
type SnippetOutputType = 'blocks';
|
|
730
|
+
type SnippetOutputBehavior = /*assumed default*/ 'merge' | 'replace';
|
|
731
|
+
interface SnippetConfig {
|
|
732
|
+
name: string;
|
|
733
|
+
namespace: string;
|
|
734
|
+
group?: string;
|
|
735
|
+
label: string;
|
|
736
|
+
outputType: SnippetOutputType;
|
|
737
|
+
outputBehavior?: SnippetOutputBehavior;
|
|
738
|
+
initialOutput?: string;
|
|
739
|
+
questions: SnippetQuestions[];
|
|
740
|
+
}
|
|
741
|
+
type SnippetAnswerTypes = 'number' | 'text' | 'variableName' | 'dropdown' | 'spriteEditor' | 'yesno' | string;
|
|
742
|
+
interface SnippetGoToOptions {
|
|
743
|
+
question?: number;
|
|
744
|
+
validate?: SnippetValidate;
|
|
745
|
+
parameters?: SnippetParameters[];
|
|
746
|
+
}
|
|
747
|
+
interface SnippetParameters {
|
|
748
|
+
token?: string;
|
|
749
|
+
answer?: string;
|
|
750
|
+
question: number;
|
|
751
|
+
}
|
|
752
|
+
interface SnippetInputAnswerSingular {
|
|
753
|
+
answerToken: string;
|
|
754
|
+
defaultAnswer: SnippetAnswerTypes;
|
|
755
|
+
}
|
|
756
|
+
interface SnippetInputAnswerPlural {
|
|
757
|
+
answerTokens: string[];
|
|
758
|
+
defaultAnswers: SnippetAnswerTypes[];
|
|
759
|
+
}
|
|
760
|
+
interface SnippetInputOtherType {
|
|
761
|
+
type: string;
|
|
762
|
+
}
|
|
763
|
+
interface SnippetInputNumberType {
|
|
764
|
+
type: 'number' | 'positionPicker';
|
|
765
|
+
max?: number;
|
|
766
|
+
min?: number;
|
|
767
|
+
}
|
|
768
|
+
interface SnippetInputDropdownType {
|
|
769
|
+
type: 'dropdown';
|
|
770
|
+
options: Record<string, string>;
|
|
771
|
+
}
|
|
772
|
+
interface SnippetInputYesNoType {
|
|
773
|
+
type: 'yesno';
|
|
774
|
+
}
|
|
775
|
+
type SnippetQuestionInput = {
|
|
776
|
+
label?: string;
|
|
777
|
+
} & (SnippetInputAnswerSingular | SnippetInputAnswerPlural) & (SnippetInputOtherType | SnippetInputNumberType | SnippetInputDropdownType | SnippetInputYesNoType);
|
|
778
|
+
interface SnippetValidateRegex {
|
|
779
|
+
token: string;
|
|
780
|
+
regex: string;
|
|
781
|
+
match?: SnippetParameters;
|
|
782
|
+
noMatch?: SnippetParameters;
|
|
783
|
+
}
|
|
784
|
+
interface SnippetValidate {
|
|
785
|
+
regex?: SnippetValidateRegex;
|
|
786
|
+
}
|
|
787
|
+
interface SnippetQuestions {
|
|
788
|
+
title: string;
|
|
789
|
+
output?: string;
|
|
790
|
+
outputConditionalOnAnswer?: string;
|
|
791
|
+
errorMessage?: string;
|
|
792
|
+
goto?: SnippetGoToOptions;
|
|
793
|
+
inputs: SnippetQuestionInput[];
|
|
794
|
+
hint?: string;
|
|
795
|
+
}
|
|
796
|
+
interface TutorialOptions {
|
|
797
|
+
tutorial?: string;
|
|
798
|
+
tutorialName?: string;
|
|
799
|
+
tutorialReportId?: string;
|
|
800
|
+
tutorialStepInfo?: TutorialStepInfo[];
|
|
801
|
+
tutorialActivityInfo?: TutorialActivityInfo[];
|
|
802
|
+
tutorialStep?: number;
|
|
803
|
+
tutorialReady?: boolean;
|
|
804
|
+
tutorialHintCounter?: number;
|
|
805
|
+
tutorialStepExpanded?: boolean;
|
|
806
|
+
tutorialMd?: string;
|
|
807
|
+
tutorialCode?: string[];
|
|
808
|
+
tutorialRecipe?: boolean;
|
|
809
|
+
templateCode?: string;
|
|
810
|
+
mergeHeaderId?: string;
|
|
811
|
+
mergeCarryoverCode?: boolean;
|
|
812
|
+
autoexpandStep?: boolean;
|
|
813
|
+
metadata?: TutorialMetadata;
|
|
814
|
+
language?: string;
|
|
815
|
+
assetFiles?: Record<string, string>;
|
|
816
|
+
jres?: string;
|
|
817
|
+
customTs?: string;
|
|
818
|
+
templateLoaded?: boolean;
|
|
819
|
+
globalBlockConfig?: TutorialBlockConfig;
|
|
820
|
+
globalValidationConfig?: CodeValidationConfig;
|
|
821
|
+
simTheme?: Partial<PackageConfig>;
|
|
822
|
+
}
|
|
823
|
+
interface TutorialStepInfo {
|
|
824
|
+
showHint?: boolean;
|
|
825
|
+
showDialog?: boolean;
|
|
826
|
+
resetDiff?: boolean;
|
|
827
|
+
tutorialCompleted?: boolean;
|
|
828
|
+
title?: string;
|
|
829
|
+
activity?: number;
|
|
830
|
+
contentMd?: string;
|
|
831
|
+
headerContentMd?: string;
|
|
832
|
+
hintContentMd?: string;
|
|
833
|
+
localBlockConfig?: TutorialBlockConfig;
|
|
834
|
+
localValidationConfig?: CodeValidationConfig;
|
|
835
|
+
}
|
|
836
|
+
interface TutorialCompletionInfo {
|
|
837
|
+
id: string;
|
|
838
|
+
steps: number;
|
|
839
|
+
}
|
|
840
|
+
interface TutorialBlockConfigEntry {
|
|
841
|
+
blockId?: string;
|
|
842
|
+
xml?: string;
|
|
843
|
+
}
|
|
844
|
+
interface TutorialBlockConfig {
|
|
845
|
+
md?: string;
|
|
846
|
+
blocks?: TutorialBlockConfigEntry[];
|
|
847
|
+
}
|
|
848
|
+
interface TutorialMetadata {
|
|
849
|
+
activities?: boolean;
|
|
850
|
+
explicitHints?: boolean;
|
|
851
|
+
flyoutOnly?: boolean;
|
|
852
|
+
hideIteration?: boolean;
|
|
853
|
+
diffs?: boolean;
|
|
854
|
+
noDiffs?: boolean;
|
|
855
|
+
codeStart?: string;
|
|
856
|
+
codeStop?: string;
|
|
857
|
+
autoexpandOff?: boolean;
|
|
858
|
+
preferredEditor?: string;
|
|
859
|
+
}
|
|
860
|
+
interface TutorialActivityInfo {
|
|
861
|
+
name: string;
|
|
862
|
+
step: number;
|
|
863
|
+
}
|
|
864
|
+
interface CodeValidatorBaseProperties {
|
|
865
|
+
enabled?: string;
|
|
866
|
+
markers?: string;
|
|
867
|
+
}
|
|
868
|
+
interface CodeValidatorMetadata {
|
|
869
|
+
validatorType: string;
|
|
870
|
+
properties: CodeValidatorBaseProperties;
|
|
871
|
+
}
|
|
872
|
+
interface CodeValidationConfig {
|
|
873
|
+
validatorsMetadata: CodeValidatorMetadata[];
|
|
874
|
+
}
|
|
875
|
+
export {};
|