@turbowarp/types 0.0.9 → 0.0.11

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@turbowarp/types",
3
- "version": "0.0.9",
3
+ "version": "0.0.11",
4
4
  "description": "Type definitions for the Scratch VM and editor",
5
5
  "keywords": [
6
6
  "scratch"
@@ -19,6 +19,7 @@
19
19
  }
20
20
  }
21
21
  },
22
+ '---',
22
23
  {
23
24
  opcode: 'test',
24
25
  text: 'test [STRING] [IMAGE] [BOOLEAN] [NUMBER] [MATRIX] [NOTE] [ANGLE] [COLOR]',
@@ -21,7 +21,7 @@ if (target) {
21
21
  const variable = target.lookupVariableByNameAndType('test', 'list');
22
22
  if (variable) {
23
23
  const name: string = variable.name;
24
- const upToDate: boolean | undefined = variable.value._monitorUpToDate;
24
+ const upToDate: boolean | undefined = variable._monitorUpToDate;
25
25
  variable.value.filter(i => i.toString());
26
26
  }
27
27
 
@@ -16,12 +16,9 @@ declare namespace Scratch {
16
16
  const BOOLEAN: 'Boolean';
17
17
  const BUTTON: 'button';
18
18
  const COMMAND: 'command';
19
- /** @deprecated does not work in compiler */
20
19
  const CONDITIONAL: 'conditional';
21
- /** @deprecated use HAT instead */
22
20
  const EVENT: 'event';
23
21
  const HAT: 'hat';
24
- /** @deprecated does not work in compiler */
25
22
  const LOOP: 'loop';
26
23
  const REPORTER: 'reporter';
27
24
  }
@@ -187,6 +184,8 @@ declare namespace Scratch {
187
184
  LoopBlock
188
185
  );
189
186
 
187
+ type Separator = '---';
188
+
190
189
  interface Menu {
191
190
  acceptReporters?: boolean;
192
191
  /**
@@ -233,7 +232,7 @@ declare namespace Scratch {
233
232
 
234
233
  docsURI?: string;
235
234
 
236
- blocks: (Block | string)[];
235
+ blocks: (Block | Separator)[];
237
236
  menus?: Record<string, Menu | string[]>;
238
237
  }
239
238
 
@@ -31,11 +31,7 @@ declare namespace VM {
31
31
  type IfGui<HasGui, NoGui> = HasGui;
32
32
 
33
33
  type ScratchCompatibleValue = string | boolean | number;
34
-
35
- interface ScratchList extends Array<ScratchCompatibleValue> {
36
- _monitorUpToDate?: boolean;
37
- }
38
-
34
+ type ScratchList = ScratchCompatibleValue[];
39
35
  type VariableValue = ScratchCompatibleValue | ScratchList;
40
36
 
41
37
  interface BaseAsset {
@@ -205,6 +201,7 @@ declare namespace VM {
205
201
  interface ListVariable extends BaseVariable {
206
202
  type: 'list';
207
203
  value: ScratchList;
204
+ _monitorUpToDate?: boolean;
208
205
  }
209
206
 
210
207
  interface BroadcastVariable extends BaseVariable {
@@ -762,6 +759,8 @@ declare namespace VM {
762
759
  interface ExtensionManager {
763
760
  runtime: Runtime;
764
761
 
762
+ refreshBlocks(): Promise<void[]>;
763
+
765
764
  isExtensionLoaded(extensionID: string): boolean;
766
765
 
767
766
  /**