@@ -89,8 +89,9 @@ Most of the user-defined fields for `pxttarget.json` are described by the interf
8989
9090### corepkg: string
9191
92- A target must have a package under the libs/ directory where the core APIs for the target reside.
93- Also, the core should always be bundled with the web app, as shown below:
92+ A target must have a core [ package] ( /packages ) under the libs/ directory
93+ where the core APIs for the target reside.
94+ The core package should always be bundled with the web app, as shown below:
9495``` typescript
9596 " corepkg" : " core" ,
9697 " bundleddirs" : [
@@ -177,13 +178,13 @@ the `cloud` field in pxttarget.json, defined by the `AppCloud` interface:
177178 packages? : boolean ; // enabled loading of packages (from github)
178179 preferredPackages? : string []; // list of company/project(#tag) of packages on github
179180 githubPackages? : boolean ; // enable user-specified term for searching github for packages
180-
181- // not currently supported
182- workspaces? : boolean ;
183181
184182 // to be retired soon
185183 publishing? : boolean ; // must set true for importing? to work; no other purpose evident
186184 embedding? : boolean ;
185+
186+ // not currently supported
187+ workspaces? : boolean ;
187188 }
188189```
189190
@@ -203,42 +204,73 @@ For example in the pxttarget.json for http://github.com/microsoft/pxt-microbit,
203204
204205### simulator?: AppSimulator;
205206
207+ PXT provides a JavaScript-based simulation environment on the left side of the web
208+ app (typically for physical computing devices like the micro: bit ). PXT uses the
209+ term [ board] ( /targets/board ) to refer to the main physical computing device shown in the simulator.
210+ Each target has one board (plus optional parts).
211+
206212``` typescript
207213 interface AppSimulator {
208- autoRun? : boolean ;
209- stopOnChange? : boolean ;
210- hideRestart? : boolean ;
211- enableTrace? : boolean ;
212- hideFullscreen? : boolean ;
213- streams? : boolean ;
214- aspectRatio? : number ; // width / height
215- boardDefinition? : pxsim .BoardDefinition ;
216- parts? : boolean ; // parts enabled?
217- instructions? : boolean ;
218- partsAspectRatio? : number ; // aspect ratio of the simulator when parts are displayed
219- headless? : boolean ; // whether simulator should still run while collapsed
220- trustedUrls? : string []; // URLs that are allowed in simulator modal messages
214+ // define aspects of physical computing device
215+ boardDefinition? : BoardDefinition ;
216+
217+ // running and code changes
218+ autoRun? : boolean ; // automatically run program after a change to its code
219+ stopOnChange? : boolean ; // stop execution when user changes code
220+ headless? : boolean ; // whether simulator should still run while collapsed
221+
222+ // buttons and parts
223+ hideRestart? : boolean ; // hide the restart button
224+ hideFullscreen? : boolean ; // hide the fullscreen button
225+ enableTrace? : boolean ; // enable the slow-mode (snail) button
226+ parts? : boolean ; // parts enabled?
227+ instructions? : boolean ; // generate step-by-step wiring instructions (Make button)
228+
229+ // appearance
230+ aspectRatio? : number ; // width / height
231+ partsAspectRatio? : number ; // aspect ratio of the simulator when parts are displayed
232+
233+ // miscellaneous
234+ trustedUrls? : string []; // URLs that are allowed in simulator modal messages
221235 }
222236```
223237
238+
224239### runtime?: RuntimeOptions;
225240
241+ This severely misnamed option controls the available blocks in the Blockly editor:
242+
226243``` typescript
227244 interface RuntimeOptions {
228- mathBlocks? : boolean ;
245+ // control whether or not Blockly built-in categories appear
246+ mathBlocks? : boolean ;
229247 textBlocks? : boolean ;
230248 listsBlocks? : boolean ;
231249 variablesBlocks? : boolean ;
232250 logicBlocks? : boolean ;
233251 loopsBlocks? : boolean ;
252+
253+ // ???
234254 extraBlocks? : BlockToolboxDefinition [];
255+
256+ // options specific to the special "on start" block
235257 onStartNamespace? : string ; // default = loops
236258 onStartColor? : string ;
237259 onStartWeight? : number ;
238260 onStartUnDeletable? : boolean ;
239261 }
240262```
241263
264+ ``` typescript
265+ interface BlockToolboxDefinition {
266+ namespace: string ;
267+ type: string ;
268+ gap? : number ;
269+ weight? : number ;
270+ fields? : Map <string >;
271+ }
272+ ```
273+
242274### serial?: AppSerial;
243275
244276``` typescript
@@ -274,4 +306,5 @@ For example in the pxttarget.json for http://github.com/microsoft/pxt-microbit,
274306 userVoiceApiKey? : string ;
275307 userVoiceForumId? : number ;
276308 }
277- ```
309+ ```
310+
0 commit comments