@turbowarp/types 0.0.9 → 0.0.10

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.10",
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
 
@@ -18,7 +18,6 @@ declare namespace Scratch {
18
18
  const COMMAND: 'command';
19
19
  /** @deprecated does not work in compiler */
20
20
  const CONDITIONAL: 'conditional';
21
- /** @deprecated use HAT instead */
22
21
  const EVENT: 'event';
23
22
  const HAT: 'hat';
24
23
  /** @deprecated does not work in compiler */
@@ -187,6 +186,8 @@ declare namespace Scratch {
187
186
  LoopBlock
188
187
  );
189
188
 
189
+ type Separator = '---';
190
+
190
191
  interface Menu {
191
192
  acceptReporters?: boolean;
192
193
  /**
@@ -233,7 +234,7 @@ declare namespace Scratch {
233
234
 
234
235
  docsURI?: string;
235
236
 
236
- blocks: (Block | string)[];
237
+ blocks: (Block | Separator)[];
237
238
  menus?: Record<string, Menu | string[]>;
238
239
  }
239
240
 
@@ -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
  /**