diff --git a/extensions/src/samarExample/index.test.ts b/extensions/src/samarExample/index.test.ts new file mode 100644 index 000000000..e468de757 --- /dev/null +++ b/extensions/src/samarExample/index.test.ts @@ -0,0 +1,9 @@ +import { createTestSuite } from "$testing"; +import Extension from '.'; + +createTestSuite({ Extension, __dirname }, + { + unitTests: undefined, + integrationTests: undefined + } +); \ No newline at end of file diff --git a/extensions/src/samarExample/index.ts b/extensions/src/samarExample/index.ts new file mode 100644 index 000000000..59156dd98 --- /dev/null +++ b/extensions/src/samarExample/index.ts @@ -0,0 +1,70 @@ +import { ArgumentType, BlockType, Environment, ExtensionMenuDisplayDetails, extension, block } from "$common"; +import BlockUtility from "$scratch-vm/engine/block-utility"; + + +/** @see {ExplanationOfDetails} */ +const details: ExtensionMenuDisplayDetails = { + name: "Replace me with name of your extension", + description: "Replace me with a description of your extension", + iconURL: "Replace with the name of your icon image file (which should be placed in the same directory as this file)", + insetIconURL: "Replace with the name of your inset icon image file (which should be placed in the same directory as this file)" +}; + +/** @see {ExplanationOfClass} */ +/** @see {ExplanationOfInitMethod} */ +export default class ExtensionNameGoesHere extends extension(details) { + + init(env: Environment) { + } + + + @block({ + type: "reporter", + text: (row) => `row: ${row}`, + arg: { + type: "string", + options: [ + "my row [example table]", + ] + } + }) + getRowIndex(rowName: string) { + return 0; + } + + @block({ + type: "reporter", + text: (row) => `col: ${row}`, + arg: { + type: "string", + options: [ + "my col [example table]", + ] + } + }) + getColIndex(colName: string) { + return 0; + } + + @block({ + type: "command", + text: (row, col, table) => `Set ${row} row and col ${col} of ${table} table`, + args: [ + { + type: "number", + defaultValue: 0, + }, + { + type: "number", + defaultValue: 0 + }, + { + type: "string", + defaultValue: "default" + } + ] + }) + setTable(row: number, col: number, table: string) { + + } +} \ No newline at end of file diff --git a/extensions/src/samarExample/package.json b/extensions/src/samarExample/package.json new file mode 100644 index 000000000..233f2e8d4 --- /dev/null +++ b/extensions/src/samarExample/package.json @@ -0,0 +1,15 @@ +{ + "name": "samar-example-extension", + "version": "1.0.0", + "description": "An extension created using the PRG AI Blocks framework", + "main": "index.ts", + "scripts": { + "directory": "echo samarExample", + "test": "npm run test --prefix ../../ -- samarExample/index.test.ts", + "dev": "npm run dev --prefix ../../../ -- --include samarExample", + "add:ui": "npm run add:ui --prefix ../../../ -- samarExample", + "add:arg": "npm run --prefix ../../../-- samarExample" + }, + "author": "", + "license": "ISC" +} \ No newline at end of file