Skip to content

Commit

Permalink
Integrating multiple changes
Browse files Browse the repository at this point in the history
  • Loading branch information
pmalacho-mit committed Jun 18, 2024
2 parents f054523 + e66be8b commit 33e8641
Show file tree
Hide file tree
Showing 8 changed files with 31 additions and 10 deletions.
5 changes: 2 additions & 3 deletions extensions/src/common/extension/ExtensionBase.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
import Runtime from "$scratch-vm/engine/runtime";

import { AbstractConstructor, Environment, ExlcudeFirst } from "$common/types";
import { AbstractConstructor, Environment, ExlcudeFirst, } from "$common/types";
import { Runtime } from "$common/types/scratch/vm";

export type ExtensionConstructorParams = ConstructorParameters<typeof ConstructableExtension>;
export type AuxiliaryExtensionInfoParams = ExlcudeFirst<ExtensionConstructorParams>;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ import { ArgumentType, BlockType } from "$common/types/enums";
import { BlockOperation, ValueOf, Menu, ExtensionMetadata, ExtensionBlockMetadata, ExtensionMenuMetadata, DynamicMenu, BlockMetadata, BlockUtilityWithID, } from "$common/types";
import { registerButtonCallback } from "$common/ui";
import { isString, typesafeCall, } from "$common/utils";
import type BlockUtility from "$root/scratch-packages/scratch-vm/src/engine/block-utility";
import { menuProbe, asStaticMenu, getMenuName, convertMenuItemsToString } from "./menus";
import { Handler } from "./handlers";
import { BlockDefinition, getButtonID, isBlockGetter } from "./util";
Expand Down
6 changes: 4 additions & 2 deletions extensions/src/common/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,5 +11,7 @@
},
"author": "",
"license": "ISC",
"devDependencies": { }
}
"devDependencies": {
"@types/events": "^3.0.3"
}
}
15 changes: 14 additions & 1 deletion extensions/src/common/pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion extensions/src/common/types/framework/index.ts
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
import { Extension } from "$common/extension/GenericExtension";
import type ExtensionManager from "$scratch-vm/extension-support/extension-manager";
import type Runtime from "$scratch-vm/engine/runtime";
import type BlockUtility from "$scratch-vm/engine/block-utility";
import type { blockIDKey } from "../../globals";
import { ExtensionBlocks } from "./blocks";
import { Language } from "../enums";
import { MethodNames, ValueOf } from "../utils";
import { ExtensionInstance } from "$common/extension";
import { Tag } from "./tags";
import { Runtime } from "../scratch/vm";

export type BaseGenericExtension = Extension<ExtensionMenuDisplayDetails, ExtensionBlocks>;

Expand Down
3 changes: 2 additions & 1 deletion extensions/src/common/types/scratch/vm.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import type * as VmRuntime from "$scratch-vm/engine/runtime";
import { AudioEngine } from "./audio";
import type { EventEmitter } from "events";

export type Runtime = Omit<VmRuntime, "audioEngine"> & { audioEngine: AudioEngine };
export type Runtime = Omit<VmRuntime, "audioEngine"> & { audioEngine: AudioEngine } & EventEmitter;
6 changes: 6 additions & 0 deletions extensions/src/simple_example/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -139,4 +139,10 @@ export default class SimpleTypescript extends extension(details, "ui", "customSa
console.log(blockID);
return lhs + 5 - rhs;
}
@(scratch.reporter`Sample ${"string"} async`)
sampleAsync(x: number, y: number) {
//await new Promise((resolve) => setTimeout(resolve, 1000));
return 5;
}
}
3 changes: 2 additions & 1 deletion extensions/src/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,8 @@
"lib": [
"dom",
"es6",
"dom.iterable"
"dom.iterable",
"ESNext"
]
},
"include": [
Expand Down

0 comments on commit 33e8641

Please sign in to comment.