Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 9 additions & 0 deletions extensions/src/samarExample/index.test.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
import { createTestSuite } from "$testing";
import Extension from '.';

createTestSuite({ Extension, __dirname },
{
unitTests: undefined,
integrationTests: undefined
}
);
70 changes: 70 additions & 0 deletions extensions/src/samarExample/index.ts
Original file line number Diff line number Diff line change
@@ -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) {

}
}
15 changes: 15 additions & 0 deletions extensions/src/samarExample/package.json
Original file line number Diff line number Diff line change
@@ -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"
}