mirror of
https://github.com/renbaoshuo/S2OJ.git
synced 2025-03-13 14:47:02 +00:00
37 lines
860 B
TypeScript
37 lines
860 B
TypeScript
export interface RemoteAccount {
|
|
type: string;
|
|
cookie?: string[];
|
|
handle?: string;
|
|
password?: string;
|
|
endpoint?: string;
|
|
proxy?: string;
|
|
}
|
|
|
|
export type NextFunction = (body: Partial<any>) => void;
|
|
|
|
export interface IBasicProvider {
|
|
ensureLogin(): Promise<boolean | string>;
|
|
submitProblem(
|
|
id: string,
|
|
lang: string,
|
|
code: string,
|
|
submissionId: number,
|
|
next: NextFunction,
|
|
end: NextFunction
|
|
): Promise<string | void>;
|
|
waitForSubmission(
|
|
id: string,
|
|
next: NextFunction,
|
|
end: NextFunction,
|
|
problem_id: string,
|
|
result_show_source?: boolean
|
|
): Promise<void>;
|
|
}
|
|
|
|
export interface BasicProvider {
|
|
new (account: RemoteAccount): IBasicProvider;
|
|
}
|
|
|
|
export const USER_AGENT =
|
|
'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/100.0.0.0 Safari/537.36 S2OJ/3.1.0';
|