tanaid-tcl 0.1.0 → 0.3.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.
Binary file
package/dist/index.d.mts CHANGED
@@ -1,37 +1,25 @@
1
1
  //#region ../../crates/tanaid-wasm/pkg/bundler/tanaid_wasm.d.ts
2
2
  /* tslint:disable */
3
3
  /* eslint-disable */
4
- interface InterpreterOptions {
4
+ interface RunOptions {
5
+ handleEventLoopStatus?: (countPending: number) => void;
6
+ }
7
+ interface TclOptions {
5
8
  handleStdout: (output: string) => void;
6
9
  setTimeout: (callback: () => void, delayMs: number) => unknown;
7
10
  clearTimeout: (timeoutId: unknown) => void;
8
- handleEventLoopStatus: (pendingTimers: number) => void;
9
- /**
10
- * Where Tk draws. A worker can only be handed an `OffscreenCanvas`, so the
11
- * page transfers one before running anything that might draw.
12
- */
13
- canvas?: OffscreenCanvas | undefined;
14
11
  }
15
- declare class Interpreter {
12
+ declare class Tcl {
16
13
  private constructor();
17
14
  free(): void;
18
15
  [Symbol.dispose](): void;
19
- static create(options: InterpreterOptions): Interpreter;
20
- run(src: string): Promise<any>;
21
- /**
22
- * The size of the widget the script mapped, if it opened a window.
23
- */
24
- windowSize(): Uint32Array | undefined;
16
+ static create(options: TclOptions): Tcl;
17
+ run(src: string, options?: RunOptions | null): Promise<any>;
25
18
  }
26
19
  //#endregion
27
20
  //#region src/index.d.ts
28
- type CreateInterpreterOptions = Omit<InterpreterOptions, "handleStdout" | "handleEventLoopStatus" | "setTimeout" | "clearTimeout"> & {
29
- handleStdout?: InterpreterOptions["handleStdout"];
30
- handleEventLoopStatus?: InterpreterOptions["handleEventLoopStatus"];
31
- setTimeout?: InterpreterOptions["setTimeout"];
32
- clearTimeout?: InterpreterOptions["clearTimeout"];
33
- };
34
- /** Interpreter.create with default options for convenience */
35
- declare function createInterpreter(options: CreateInterpreterOptions): Interpreter;
21
+ type CreateTclOptions = Partial<TclOptions>;
22
+ /** Tcl.create with default options for convenience */
23
+ declare function createTcl(options?: CreateTclOptions): Tcl;
36
24
  //#endregion
37
- export { CreateInterpreterOptions, Interpreter, InterpreterOptions, createInterpreter };
25
+ export { CreateTclOptions, RunOptions, Tcl, TclOptions, createTcl };