forked from fridgerator/PyNode
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathindex.d.ts
More file actions
24 lines (21 loc) · 1.09 KB
/
index.d.ts
File metadata and controls
24 lines (21 loc) · 1.09 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
declare module "@lmagder/pynode" {
export type PyNodeWrappedPythonObject = {
readonly __call__: (...args: PyNodeValue[]) => PyNodeValue;
readonly __callasync__: (...args: [...PyNodeValue[], (error: string | null, result?: PyNodeValue) => void]) => void;
readonly __callasync_promise__: (...args: PyNodeValue[]) => Promise<PyNodeValue>;
readonly __getattr__: (field: string) => PyNodeValue;
readonly __setattr__: (field: string, value: PyNodeValue) => void;
readonly __repr__: (field: string) => string;
readonly __pytype__: string;
};
export type PyNodeValue = null | number | string | boolean | PyNodeWrappedPythonObject | PyNodeValue[] | { [key: string]: PyNodeValue };
export type PyNode = {
readonly startInterpreter: (venvPython?: string) => void;
readonly appendSysPath: (path: string) => void;
readonly openFile: (filename: string) => PyNodeWrappedPythonObject;
readonly import: (name: string) => PyNodeWrappedPythonObject;
readonly eval: (expr: string) => number;
};
export const pynode: PyNode;
export default pynode;
}