@kubohiroya/turbowarp-aframe 0.2.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,25 @@
1
+ interface TurboWarpExtension {
2
+ getInfo(): Record<string, unknown>;
3
+ }
4
+
5
+ interface ScratchTranslate {
6
+ (text: string): string;
7
+ (message: {default: string; description?: string}, placeholders?: Record<string, string | number>): string;
8
+ }
9
+
10
+ interface ScratchApi {
11
+ extensions: {
12
+ unsandboxed: boolean;
13
+ register(extension: TurboWarpExtension): void;
14
+ };
15
+ BlockType: Record<'COMMAND' | 'REPORTER' | 'BOOLEAN' | 'HAT', string>;
16
+ ArgumentType: Record<'STRING' | 'NUMBER' | 'BOOLEAN', string>;
17
+ Cast: {
18
+ toString(value: unknown): string;
19
+ toNumber(value: unknown): number;
20
+ toBoolean(value: unknown): boolean;
21
+ };
22
+ translate: ScratchTranslate;
23
+ }
24
+
25
+ declare const Scratch: ScratchApi;
package/src/index.ts ADDED
@@ -0,0 +1,8 @@
1
+ import {extensionConfig} from './config.js';
2
+ import {TurboWarpAFrameExtension} from './extension.js';
3
+
4
+ if (extensionConfig.unsandboxed && !Scratch.extensions.unsandboxed) {
5
+ throw new Error(`${extensionConfig.name} must run unsandboxed.`);
6
+ }
7
+
8
+ Scratch.extensions.register(new TurboWarpAFrameExtension());