@pyscript/core 0.0.3 → 0.0.5
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/README.md +14 -2
- package/cjs/custom/pyscript.js +5 -9
- package/cjs/custom-types.js +0 -2
- package/cjs/custom.js +6 -6
- package/cjs/interpreter/_python.js +4 -2
- package/cjs/interpreter/micropython.js +10 -12
- package/cjs/interpreter/webr.js +48 -0
- package/cjs/plugins.js +89 -0
- package/cjs/runtime/_python.js +34 -0
- package/cjs/runtime/_utils.js +141 -0
- package/cjs/runtime/micropython.js +40 -0
- package/cjs/runtime/pyodide.js +40 -0
- package/cjs/runtime/ruby.js +50 -0
- package/cjs/runtime/wasmoon.js +46 -0
- package/cjs/runtimes.js +63 -0
- package/cjs/worker/class.js +11 -2
- package/cjs/worker/hooks.js +11 -3
- package/cjs/worker/xworker.js +1 -1
- package/core.js +2 -2
- package/docs/README.md +481 -0
- package/esm/custom/pyscript.js +5 -9
- package/esm/custom.js +6 -6
- package/esm/interpreter/_python.js +4 -2
- package/esm/interpreter/micropython.js +10 -12
- package/esm/worker/class.js +11 -2
- package/esm/worker/hooks.js +11 -2
- package/esm/worker/xworker.js +1 -1
- package/package.json +12 -4
- package/pyscript.js +2 -2
- package/types/coincident/window.d.ts +4 -4
- package/types/custom.d.ts +54 -0
- package/types/index.d.ts +1 -1
- package/types/interpreter/_python.d.ts +7 -0
- package/types/interpreter/_utils.d.ts +11 -0
- package/types/interpreter/micropython.d.ts +18 -0
- package/types/interpreter/pyodide.d.ts +19 -0
- package/types/interpreter/ruby-wasm-wasi.d.ts +15 -0
- package/types/interpreter/wasmoon.d.ts +21 -0
- package/types/interpreters.d.ts +9 -0
- package/types/listeners.d.ts +2 -0
- package/types/pyscript/pyscript.core/esm/custom.d.ts +3 -3
- package/types/pyscript/pyscript.core/esm/interpreter/_python.d.ts +2 -2
- package/types/pyscript/pyscript.core/esm/interpreter/micropython.d.ts +1 -2
- package/types/pyscript/pyscript.core/esm/interpreter/webr.d.ts +14 -0
- package/types/pyscript/pyscript.core/esm/plugins.d.ts +21 -14
- package/types/pyscript/pyscript.core/esm/worker/hooks.d.ts +4 -1
- package/types/script-handler.d.ts +2 -1
- package/types/worker/class.d.ts +4 -4
- package/types/worker/hooks.d.ts +6 -2
@@ -0,0 +1,14 @@
|
|
1
|
+
declare namespace _default {
|
2
|
+
export { type };
|
3
|
+
export function module(version?: string): string;
|
4
|
+
export function engine({ WebR }: {
|
5
|
+
WebR: any;
|
6
|
+
}, config: any): Promise<any>;
|
7
|
+
export function setGlobal(): void;
|
8
|
+
export function deleteGlobal(): void;
|
9
|
+
export function run(interpreter: any, code: any): Promise<any>;
|
10
|
+
export function runAsync(interpreter: any, code: any): Promise<any>;
|
11
|
+
export function writeFile(interpreter: any, path: any, buffer: any): any;
|
12
|
+
}
|
13
|
+
export default _default;
|
14
|
+
declare const type: "webr";
|
@@ -1,29 +1,32 @@
|
|
1
|
-
export const
|
1
|
+
export const PLUGINS_SELECTORS: any[];
|
2
2
|
export function handlePlugin(node: Element): void;
|
3
|
-
export function
|
4
|
-
export function whenDefined(type: string): Promise<object>;
|
3
|
+
export function registerPlugin(name: string, options: PluginOptions): void;
|
5
4
|
/**
|
6
5
|
* plugin configuration
|
7
6
|
*/
|
8
7
|
export type Runtime = {
|
9
8
|
/**
|
10
|
-
* the
|
9
|
+
* the runtime type
|
11
10
|
*/
|
12
|
-
|
11
|
+
type: string;
|
13
12
|
/**
|
14
|
-
*
|
13
|
+
* the bootstrapped runtime
|
14
|
+
*/
|
15
|
+
runtime: object;
|
16
|
+
/**
|
17
|
+
* an XWorker constructor that defaults to same runtime on the Worker.
|
15
18
|
*/
|
16
19
|
XWorker: (url: string, options?: object) => Worker;
|
17
20
|
/**
|
18
|
-
* a cloned config used to bootstrap the
|
21
|
+
* a cloned config used to bootstrap the runtime
|
19
22
|
*/
|
20
23
|
config: object;
|
21
24
|
/**
|
22
|
-
* an utility to run code within the
|
25
|
+
* an utility to run code within the runtime
|
23
26
|
*/
|
24
27
|
run: (code: string) => any;
|
25
28
|
/**
|
26
|
-
* an utility to run code asynchronously within the
|
29
|
+
* an utility to run code asynchronously within the runtime
|
27
30
|
*/
|
28
31
|
runAsync: (code: string) => Promise<any>;
|
29
32
|
/**
|
@@ -36,19 +39,23 @@ export type Runtime = {
|
|
36
39
|
*/
|
37
40
|
export type PluginOptions = {
|
38
41
|
/**
|
39
|
-
* the interpreter to
|
42
|
+
* the runtime/interpreter type to receive
|
40
43
|
*/
|
41
|
-
|
44
|
+
type: string;
|
42
45
|
/**
|
43
|
-
* the optional
|
46
|
+
* the optional runtime version to use
|
44
47
|
*/
|
45
48
|
version?: string;
|
46
49
|
/**
|
47
|
-
* the optional config to use within such
|
50
|
+
* the optional config to use within such runtime
|
48
51
|
*/
|
49
52
|
config?: string;
|
53
|
+
/**
|
54
|
+
* the optional environment to use
|
55
|
+
*/
|
56
|
+
env?: string;
|
50
57
|
/**
|
51
58
|
* the callback that will be invoked once
|
52
59
|
*/
|
53
|
-
onRuntimeReady
|
60
|
+
onRuntimeReady: (node: Element, runtime: Runtime) => void;
|
54
61
|
};
|
@@ -1,3 +1,4 @@
|
|
1
|
-
export
|
1
|
+
export function queryTarget(script: any, idOrSelector: any): any;
|
2
|
+
export const interpreters: Map<any, any>;
|
2
3
|
export function getDetails(type: any, id: any, name: any, version: any, config: any): any;
|
3
4
|
export function handle(script: HTMLScriptElement): Promise<void>;
|
package/types/worker/class.d.ts
CHANGED
@@ -1,19 +1,19 @@
|
|
1
1
|
declare function _default(...args: any[]): (url: string, options?: WorkerOptions) => Worker;
|
2
2
|
export default _default;
|
3
3
|
/**
|
4
|
-
*
|
4
|
+
* custom configuration
|
5
5
|
*/
|
6
6
|
export type WorkerOptions = {
|
7
7
|
/**
|
8
|
-
* the
|
8
|
+
* the interpreter type to use
|
9
9
|
*/
|
10
10
|
type: string;
|
11
11
|
/**
|
12
|
-
* the optional
|
12
|
+
* the optional interpreter version to use
|
13
13
|
*/
|
14
14
|
version?: string;
|
15
15
|
/**
|
16
|
-
* the optional config to use within such
|
16
|
+
* the optional config to use within such interpreter
|
17
17
|
*/
|
18
18
|
config?: string;
|
19
19
|
};
|
package/types/worker/hooks.d.ts
CHANGED