litlaunch-library-api-debug 0.0.0-stage → 0.2.7-tweak.4

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.
package/index.d.mts ADDED
@@ -0,0 +1,49 @@
1
+ /*
2
+ * Copyright (C) 2019-2026 Angelina Michalek (Codetoil)
3
+ *
4
+ * This program is free software; you can redistribute it and/or
5
+ * modify it under the terms of the GNU General Public
6
+ * License as published by the Free Software Foundation; either
7
+ * version 3 of the License, or (at your option) any later version.
8
+ *
9
+ * This program is distributed in the hope that it will be useful,
10
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
11
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12
+ * General Public License for more details.
13
+ *
14
+ * You should have received a copy of the GNU General Public License
15
+ * along with this program; if not, write to the Free Software Foundation,
16
+ * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
17
+ */
18
+
19
+ /** A pointer into the module's linear memory. */
20
+ export type Pointer = number;
21
+
22
+ export type CType = "number" | "string" | "boolean" | "array" | null;
23
+
24
+ export interface LitLaunchLibraryApiModule {
25
+ /**
26
+ * Every extern function in the public C headers, exported with a leading
27
+ * underscore (e.g. `_initLibraryApi`), plus `_malloc` and `_free`.
28
+ */
29
+ [exported: `_${string}`]: (...args: number[]) => number;
30
+
31
+ ccall(ident: string, returnType: CType, argTypes: CType[], args: unknown[]): any;
32
+ cwrap(ident: string, returnType: CType, argTypes: CType[]): (...args: any[]) => any;
33
+ UTF8ToString(ptr: Pointer, maxBytesToRead?: number): string;
34
+ stringToNewUTF8(str: string): Pointer;
35
+ }
36
+
37
+ export interface LitLaunchLibraryApiOptions {
38
+ /** Resolve the path or URL of the `.wasm` file (e.g. when a bundler moves it). */
39
+ locateFile?(path: string, scriptDirectory: string): string;
40
+ /** Supply the `.wasm` bytes directly instead of fetching them. */
41
+ wasmBinary?: ArrayBuffer | Uint8Array;
42
+ print?(text: string): void;
43
+ printErr?(text: string): void;
44
+ [key: string]: unknown;
45
+ }
46
+
47
+ export default function LitLaunchLibraryApi(
48
+ options?: LitLaunchLibraryApiOptions
49
+ ): Promise<LitLaunchLibraryApiModule>;