Add TargetType enum for use by/with extensions
This commit is contained in:
1 parent
de9e2be265
commit
defdd42c47
2 files changed
+19
No files matched your search
@@ -3,6 +3,7 @@
|
||||
const ArgumentType = require('../extension-support/argument-type');
|
||||
const BlockType = require('../extension-support/block-type');
|
||||
const dispatch = require('../dispatch/worker-dispatch');
|
||||
const TargetType = require('../extension-support/target-type');
|
||||
|
||||
class ExtensionWorker {
|
||||
constructor () {
|
||||
@@ -47,6 +48,7 @@ class ExtensionWorker {
|
||||
global.Scratch = global.Scratch || {};
|
||||
global.Scratch.ArgumentType = ArgumentType;
|
||||
global.Scratch.BlockType = BlockType;
|
||||
global.Scratch.TargetType = TargetType;
|
||||
|
||||
/**
|
||||
* Expose only specific parts of the worker to extensions.
|
||||
|
||||
@@ -0,0 +1,17 @@
|
||||
/**
|
||||
* Default types of Target supported by the VM
|
||||
* @enum {string}
|
||||
*/
|
||||
const TargetType = {
|
||||
/**
|
||||
* Rendered target which can move, change costumes, etc.
|
||||
*/
|
||||
SPRITE: 'sprite',
|
||||
|
||||
/**
|
||||
* Rendered target which cannot move but can change backdrops
|
||||
*/
|
||||
STAGE: 'stage'
|
||||
};
|
||||
|
||||
module.exports = TargetType;
|
||||
Reference in new issue
Block a user