-
Notifications
You must be signed in to change notification settings - Fork 23
/
index.d.ts
63 lines (51 loc) · 2.03 KB
/
index.d.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
import type { AudioConnectables } from 'src/patchNetwork';
import type { Renderable, ToastOptions } from 'svelte-french-toast';
declare module 'litegraph.js' {
import type {
LiteGraphNode,
LiteGraph as LiteGraphInstance,
LiteGraphLink,
} from 'src/graphEditor/LiteGraphTypes';
namespace LiteGraph {
export const createNode: ((type: string, options?: { [key: string]: any }) => LiteGraphNode) &
((type: string, title: string, opts?: { [key: string]: any }) => LiteGraphNode);
const registerNodeType: (type: string, nodeClass: any) => void;
const registered_node_types: { [nodeType: string]: any };
export class LGraphCanvas {
constructor(id: string, graph: LiteGraphInstance);
onNodeSelected?: (node: any) => void | undefined;
onNodeDeselected?: (node: any) => void | undefined;
}
export class LGraph implements LiteGraphInstance {
list_of_graphcanvas: any[];
links: { [id: string]: LiteGraphLink };
_nodes: LiteGraphNode[];
_nodes_by_id: { [id: string]: LiteGraphNode };
add: (node: LiteGraphNode) => void;
remove: (node: LiteGraphNode) => void;
arrange: () => void;
start: () => void;
onNodeRemoved?: ((node: any) => void | undefined) | undefined;
serialize(): { [key: string]: any };
setDirtyCanvas: (foreground: boolean, background: boolean) => void;
}
}
export namespace LGAudio {
export const getAudioContext: () => AudioContext;
export const createAudioNodeWrapper: (node: any) => void;
}
}
declare const process: {
env: {
NODE_ENV: string;
[key: string]: string;
};
};
declare global {
declare function dbg<T>(arg: T): T;
declare function toast(msg: Renderable, options?: ToastOptions): void;
declare function toastSuccess(msg: Renderable, options?: ToastOptions): void;
declare function toastError(msg: Renderable, options?: ToastOptions): void;
declare function updateConnectables(vcId: string, newConnectables: AudioConnectables): void;
declare function genRandomStringID(): string;
}