@turbowarp/types 0.0.6 → 0.0.7

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.6",
3
+ "version": "0.0.7",
4
4
  "description": "Type definitions for the Scratch VM and editor",
5
5
  "keywords": [
6
6
  "scratch"
@@ -46,6 +46,16 @@ if (target) {
46
46
  bubbleState.text.charAt(0);
47
47
  target.setCustomState('Scratch.looks', bubbleState);
48
48
  }
49
+
50
+ target.on('TARGET_MOVED', (target, fromX, fromY, forced) => {
51
+ const id: string = target.id;
52
+ const x: number = fromX;
53
+ const y: number = fromY;
54
+ const f: boolean | undefined = forced;
55
+ })
56
+ target.on('EVENT_TARGET_VISUAL_CHANGE', (target) => {
57
+ const id: string = target.id;
58
+ });
49
59
  } else {
50
60
  const doesNotExist: undefined = target;
51
61
  }
@@ -112,6 +112,7 @@ declare namespace AudioEngine {
112
112
  finished(): Promise<void>;
113
113
  setPlaybackRate(playbackRate: number): void;
114
114
  take(): SoundPlayer;
115
+ connect(connectable: AudioEngine | Effect | EffectChain): void;
115
116
  }
116
117
 
117
118
  interface SoundBank {
@@ -289,7 +289,7 @@ declare namespace VM {
289
289
  };
290
290
  }
291
291
 
292
- interface BaseTarget extends EventEmitter<{}> {
292
+ interface BaseTarget extends EventEmitter<RenderedTargetEventMap> {
293
293
  runtime: Runtime;
294
294
 
295
295
  id: string;
@@ -356,7 +356,9 @@ declare namespace VM {
356
356
  }
357
357
 
358
358
  interface RenderedTargetEventMap {
359
- // TODO
359
+ TARGET_MOVED: [RenderedTarget, number, number, boolean?];
360
+
361
+ EVENT_TARGET_VISUAL_CHANGE: [RenderedTarget];
360
362
  }
361
363
 
362
364
  const enum Effect {
@@ -1574,7 +1576,7 @@ declare class VM extends EventEmitter<VM.VirtualMachineEventMap> {
1574
1576
  * Emit a workspaceUpdate event.
1575
1577
  */
1576
1578
  emitWorkspaceUpdate(): void;
1577
-
1579
+
1578
1580
  /**
1579
1581
  * Post sprite info to the target that's being dragged, otherwise the editing target.
1580
1582
  * @see {VM.Target.postSpriteInfo}