Files
freeCodeCamp/tools/client-plugins/browser-scripts/index.d.ts
Oliver Eyton-Williams 69d6ee32bf feat: python in the browser (#50913)
Co-authored-by: Beau Carnes <1513130+beaucarnes@users.noreply.github.com>
2023-07-28 07:36:25 +02:00

34 lines
839 B
TypeScript

/* eslint-disable @typescript-eslint/naming-convention */
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;
transformedPython?: string;
}
export type FrameWindow = Window &
typeof globalThis & {
$: typeof $;
};