Skip to content

Commit

Permalink
TW: add XML block type
Browse files Browse the repository at this point in the history
  • Loading branch information
GarboMuffin committed May 10, 2024
1 parent 9ca4b4c commit df8a14e
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 0 deletions.
4 changes: 4 additions & 0 deletions tests/test-scratch-vm-extension-tw.js
Original file line number Diff line number Diff line change
Expand Up @@ -97,6 +97,10 @@
type: Scratch.ArgumentType.COSTUME
}
}
},
{
blockType: Scratch.BlockType.XML,
xml: '<></>'
}
]
};
Expand Down
6 changes: 6 additions & 0 deletions types/scratch-vm-extension.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -114,6 +114,7 @@ declare namespace Scratch {
namespace BlockType {
// TW
const LABEL: 'label';
const XML: 'xml';

const BOOLEAN: 'Boolean';
const BUTTON: 'button';
Expand Down Expand Up @@ -214,6 +215,10 @@ declare namespace Scratch {
interface LabelBlock extends AbstractBlock {
blockType: 'label';
}
interface XMLBlock extends AbstractBlock {
blockType: 'xml';
xml: string;
}

interface AbstractBlock {
text: string | string[];
Expand Down Expand Up @@ -295,6 +300,7 @@ declare namespace Scratch {
type Block = (
// TW
LabelBlock |
XMLBlock |

BooleanBlock |
ButtonBlock |
Expand Down

0 comments on commit df8a14e

Please sign in to comment.