Skip to content

Commit

Permalink
Merge branch 'more-typescript-types' into nodylink-build
Browse files Browse the repository at this point in the history
  • Loading branch information
hoodmane committed Oct 5, 2023
2 parents 5be8bfd + 027fb48 commit a57f84c
Show file tree
Hide file tree
Showing 6 changed files with 16 additions and 13 deletions.
2 changes: 1 addition & 1 deletion src/core/pyproxy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ declare var Tests: any;
declare var Module: any;
declare var Hiwire: any;

import "lib";
import {TypedArray} from "lib";
import { warnOnce } from "pyodide_util";

// pyodide-skip
Expand Down
1 change: 1 addition & 0 deletions src/js/api.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ import { version } from "./version";
import "./error_handling.gen.js";
import { setStdin, setStdout, setStderr } from "./streams";
import { makeWarnOnce } from "./pyodide_util";
import { TypedArray } from "./lib";

API.loadBinaryFile = loadBinaryFile;

Expand Down
2 changes: 1 addition & 1 deletion src/js/ffi.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ export type {
PyMutableSequence,
} from "./pyproxy.gen";

export type { TypedArray };
export type { TypedArray } from "./lib";

export type { PythonError } from "./error_handling.gen";

Expand Down
21 changes: 11 additions & 10 deletions src/js/lib.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,19 +5,20 @@ import { type ConfigType } from "./pyodide";
import { type InFuncType } from "./streams";
import { type PackageData } from "./load-package";

export type TypedArray =
| Int8Array
| Uint8Array
| Int16Array
| Uint16Array
| Int32Array
| Uint32Array
| Uint8ClampedArray
| Float32Array
| Float64Array;

declare global {
export var Module: Module;
export var API: API;
export type TypedArray =
| Int8Array
| Uint8Array
| Int16Array
| Uint16Array
| Int32Array
| Uint32Array
| Uint8ClampedArray
| Float32Array
| Float64Array;
}

// Emscripten runtime methods
Expand Down
1 change: 1 addition & 0 deletions src/js/pyodide.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ import { version } from "./version";

import type { PyodideInterface } from "./api.js";
import type { PyProxy, PyDict } from "./pyproxy.gen";
import type { TypedArray } from "./lib";
export type { PyodideInterface, TypedArray };

export type {
Expand Down
2 changes: 1 addition & 1 deletion src/tests/test_core_python.py
Original file line number Diff line number Diff line change
Expand Up @@ -95,6 +95,6 @@ def pytest_generate_tests(metafunc):
tests = get_tests()
metafunc.parametrize(
"main_test",
pytest.param(tests, marks=pytest.mark.requires_dynamic_linking),
[pytest.param(t, marks=pytest.mark.requires_dynamic_linking) for t in tests],
ids=[t[0] for t in tests],
)

0 comments on commit a57f84c

Please sign in to comment.