Add TargetType enum for use by/with extensions

This commit is contained in:
Christopher Willis-Ford 2018-03-29 16:21:01 -07:00
parent de9e2be265
commit defdd42c47
2 changed files with 19 additions and 0 deletions

View file

@ -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.

View file

@ -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;