diff --git a/extensions/documentation/src/porting/example.ts b/extensions/documentation/src/porting/example.ts index 1398b10da..0a70de99f 100644 --- a/extensions/documentation/src/porting/example.ts +++ b/extensions/documentation/src/porting/example.ts @@ -1,5 +1,4 @@ -import { ArgumentType, BlockType, Environment, extension, scratch } from "$common"; -import BlockUtility from "$root/scratch-packages/scratch-vm/src/engine/block-utility"; +import { ArgumentType, BlockType, BlockUtilityWithID, Environment, extension, scratch } from "$common"; import formatMessage from './format-message'; // This should actually be an npm package and thus be 'format-message' const details = { @@ -20,7 +19,7 @@ export default class SomeBlocks extends extension(details) { options: [{ text: 'Item One', value: 'itemId1' },'itemId2'] } } of ${{ type: "number", defaultValue: 1 }}`) - myReporter(text: string, letterNum: number) { + myReporter(text: string, letterNum: number, util: BlockUtilityWithID) { const message = formatMessage({ id: 'myReporter.result', default: 'Letter {letterNum} of {text} is {result}.', diff --git a/extensions/src/.templates/default.ts b/extensions/src/.templates/default.ts index 272490155..8b6294c05 100644 --- a/extensions/src/.templates/default.ts +++ b/extensions/src/.templates/default.ts @@ -62,7 +62,7 @@ export default class ExtensionNameGoesHere extends extension(details) { /** @see {ExplanationOfHatBlock} */ @(scratch.hat`Should the below block execute: ${"Boolean"}`) - /** @see {ExplanationOfBlockUtility} */ + /** @see {ExplanationOfBlockUtilityWithID} */ async exampleHat(condition: boolean, util: BlockUtilityWithID) { return util.stackFrame.isLoop === condition; } diff --git a/extensions/src/common/templateDocs.ts b/extensions/src/common/templateDocs.ts index e469d6d8d..5aad4c213 100644 --- a/extensions/src/common/templateDocs.ts +++ b/extensions/src/common/templateDocs.ts @@ -166,16 +166,16 @@ type ExplanationOfHatBlock = Documentation; type ExplanationOfBlockArg = Documentation; /** - * You should notice that the final argument of our method is of type `BlockUtility`. + * You should notice that the final argument of our method is of type `BlockUtilityWithID`. * - * For every Block method, you can optionally add a final parameter of type `BlockUtility` + * For every Block method, you can optionally add a final parameter of type `BlockUtilityWithID` * which can be used to accomplish more [advanced behaviours](https://github.com/mitmedialab/prg-extension-boilerplate/tree/dev/extensions#making-use-of-the-block-utility). * No need to worry too much about when you're first starting out, though! * - * As is the case here, note that the inclusion of a `BlockUtility` argument does not "count" + * As is the case here, note that the inclusion of a `BlockUtilityWithID` argument does not "count" * as an Argument for your Block. * - * Thus, if your method **_only_** accepts a `BlockUtility` argument, then the `block` function will **not** + * Thus, if your method **_only_** accepts a `BlockUtilityWithID` argument, then the `block` function will **not** * require (or allow) you to add a placeholder in the template literal -- similiar to the `exampleReporter` method / Block above. */ -type ExplanationOfBlockUtility = Documentation; \ No newline at end of file +type ExplanationOfBlockUtilityWithID = Documentation; \ No newline at end of file