Files
freeCodeCamp/tools/client-plugins/browser-scripts/index.d.ts
Oliver Eyton-Williams 583745e6ca feat: handle python input synchronously (#52526)
Co-authored-by: Shaun Hamilton <shauhami020@gmail.com>
2023-12-18 11:22:26 -08:00

31 lines
750 B
TypeScript

import { PyodideInterface } from 'pyodide';
export interface FrameDocument extends Document {
__initTestFrame: (e: InitTestFrameArg) => Promise<void>;
__runTest: (
testString: string
) => Promise<
{ pass: boolean } | { err: { message: string; stack?: string } }
>;
}
export interface PythonDocument extends FrameDocument {
__initPythonFrame: () => Promise<void>;
__runPython: (code: string) => Promise<PyodideInterface>;
}
export interface InitTestFrameArg {
code: {
contents?: string;
editableContents?: string;
original?: { [id: string]: string };
};
getUserInput?: (fileName: string) => string;
loadEnzyme?: () => void;
}
export type FrameWindow = Window &
typeof globalThis & {
$: typeof $;
};