@turbowarp/types 0.0.3 → 0.0.4

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.
@@ -0,0 +1,9 @@
1
+ # Contributing
2
+
3
+ Our goal is to document all the APIs exposed by Scratch. We accept any contributions that work towards that goal.
4
+
5
+ Even if you aren't able to write types, please open issues to report missing or incorrect types.
6
+
7
+ In terms of code style, we aren't super picky. Just keep it consistent with whatever is already there.
8
+
9
+ For very complex types, please add a small test case in the `tests` directory. Presumably you already wrote some test code while writing the types, so just don't delete that once you're done.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@turbowarp/types",
3
- "version": "0.0.3",
3
+ "version": "0.0.4",
4
4
  "description": "Type definitions for the Scratch VM and editor",
5
5
  "keywords": [
6
6
  "scratch"
package/types/paper.d.ts CHANGED
@@ -9,4 +9,9 @@ declare namespace Paper {
9
9
  interface Matrix {
10
10
  // TODO
11
11
  }
12
+
13
+ interface Tool {
14
+ // TODO
15
+ activate(): void;
16
+ }
12
17
  }
@@ -452,73 +452,73 @@ declare namespace ScratchGUI {
452
452
  {
453
453
  type: 'scratch-gui/project-state/DONE_CREATING_COPY';
454
454
  projectId: string;
455
- } |
455
+ } |
456
456
  {
457
457
  type: 'scratch-gui/project-state/DONE_CREATING_NEW';
458
458
  projectId: string;
459
- } |
459
+ } |
460
460
  {
461
461
  type: 'scratch-gui/project-state/DONE_FETCHING_DEFAULT';
462
462
  projectData: ProjectData;
463
- } |
463
+ } |
464
464
  {
465
465
  type: 'scratch-gui/project-state/DONE_FETCHING_WITH_ID';
466
466
  projectData: ProjectData;
467
- } |
467
+ } |
468
468
  {
469
469
  type: 'scratch-gui/project-state/DONE_LOADING_VM_TO_SAVE';
470
- } |
470
+ } |
471
471
  {
472
472
  type: 'scratch-gui/project-state/DONE_LOADING_VM_WITH_ID';
473
- } |
473
+ } |
474
474
  {
475
475
  type: 'scratch-gui/project-state/DONE_LOADING_VM_WITHOUT_ID';
476
- } |
476
+ } |
477
477
  {
478
478
  type: 'scratch-gui/project-state/DONE_REMIXING';
479
479
  projectId: string;
480
- } |
480
+ } |
481
481
  {
482
482
  type: 'scratch-gui/project-state/DONE_UPDATING';
483
- } |
483
+ } |
484
484
  {
485
485
  type: 'scratch-gui/project-state/DONE_UPDATING_BEFORE_COPY';
486
- } |
486
+ } |
487
487
  {
488
488
  type: 'scratch-gui/project-state/DONE_UPDATING_BEFORE_NEW';
489
- } |
489
+ } |
490
490
  {
491
491
  type: 'scratch-gui/project-state/RETURN_TO_SHOWING';
492
- } |
492
+ } |
493
493
  {
494
494
  type: 'scratch-gui/project-state/SET_PROJECT_ID';
495
495
  projectId: string;
496
- } |
496
+ } |
497
497
  {
498
498
  type: 'scratch-gui/project-state/START_AUTO_UPDATING';
499
- } |
499
+ } |
500
500
  {
501
501
  type: 'scratch-gui/project-state/START_CREATING_NEW';
502
- } |
502
+ } |
503
503
  {
504
504
  type: 'scratch-gui/project-state/START_ERROR';
505
505
  error: unknown;
506
- } |
506
+ } |
507
507
  {
508
508
  type: 'scratch-gui/project-state/START_FETCHING_NEW';
509
- } |
509
+ } |
510
510
  {
511
511
  type: 'scratch-gui/project-state/START_LOADING_VM_FILE_UPLOAD';
512
- } |
512
+ } |
513
513
  {
514
514
  type: 'scratch-gui/project-state/START_MANUAL_UPDATING';
515
- } |
515
+ } |
516
516
  {
517
517
  type: 'scratch-gui/project-state/START_REMIXING';
518
- } |
518
+ } |
519
519
  {
520
520
  type: 'scratch-gui/project-state/START_UPDATING_BEFORE_CREATING_COPY';
521
- } |
521
+ } |
522
522
  {
523
523
  type: 'scratch-gui/project-state/START_UPDATING_BEFORE_CREATING_NEW';
524
524
  } |
@@ -171,7 +171,7 @@ declare namespace ScratchPaint {
171
171
  {
172
172
  type: 'scratch-paint/eye-dropper/ACTIVATE_COLOR_PICKER';
173
173
  callback: ScratchPaintState['color']['eyeDropper']['callback'];
174
- previousMode: Mode;
174
+ previousMode: Paper.Tool;
175
175
  } |
176
176
  {
177
177
  type: 'scratch-paint/eye-dropper/DEACTIVATE_COLOR_PICKER';
@@ -76,6 +76,8 @@ declare namespace VM {
76
76
  name: string;
77
77
  costumes: Costume[];
78
78
  sounds: Sound[];
79
+ clones: RenderedTarget[];
80
+ soundBank: AudioEngine.SoundBank | null;
79
81
  }
80
82
 
81
83
  interface Field {
@@ -297,6 +299,8 @@ declare namespace VM {
297
299
 
298
300
  comments: Record<string, Comment>;
299
301
 
302
+ createComment(id: string, blockId: string, text: string, x: number, y: number, width: number, height: number, minimized?: boolean): void;
303
+
300
304
  /**
301
305
  * Called by runtime when the green flag is pressed.
302
306
  */
@@ -990,6 +994,11 @@ declare namespace VM {
990
994
  */
991
995
  start(): void;
992
996
 
997
+ /**
998
+ * Stop all timers.
999
+ */
1000
+ quit(): void;
1001
+
993
1002
  /**
994
1003
  * Start "when green flag pressed" scripts.
995
1004
  */
@@ -1297,6 +1306,11 @@ declare class VM extends EventEmitter<VM.VirtualMachineEventMap> {
1297
1306
  */
1298
1307
  start(): void;
1299
1308
 
1309
+ /**
1310
+ * @see {VM.Runtime.quit}
1311
+ */
1312
+ quit(): void;
1313
+
1300
1314
  /**
1301
1315
  * @see {VM.Runtime.greenFlag}
1302
1316
  */