UNPKG

un-oj

Version:

Unified Online Judge information collector.

52 lines (50 loc) 1.74 kB
import { Platform, PlatformOptions, Problem } from "../platform-DVQwRMI1.js"; //#region src/platforms/lyrio.d.ts type ProblemType = 'Traditional' | 'SubmitAnswer' | 'Interaction'; /** * Lyrio-specific problem type. * * Description is JSON-encoded Markdown. * * @example * ```ts * ({ * description: `[{"sectionTitle":"题目描述","type":"Text","text":"输入 $ a $ 和 $ b $,输出 $ a + b $ 的结果。"},{"sectionTitle":"输入格式","type":"Text","text":"一行两个正整数 $ a $ 和 $ b $。"},{"sectionTitle":"输出格式","type":"Text","text":"一行一个正整数 $ a + b $。"},{"sectionTitle":"样例","type":"Sample","sampleId":0,"text":"根据数学知识有 $ 1 + 2 = 3 $。"},{"sectionTitle":"数据范围","type":"Text","text":"对于 $ 100\\% $ 的数据,$ 1 \\leq a, b \\leq 10 ^ 6 $。"}]`, * difficulty: undefined, * id: '1', * link: 'https://loj.ac/p/1', * memoryLimit: 536870912, * samples: [{ * input: '1 2', * output: '3', * }], * tags: [{ * color: 'black', * id: 1, * name: '系统测试', * nameLocale: 'zh_CN', * }], * timeLimit: 2000, * title: 'A + B 问题', * type: 'Traditional', * }) * ``` */ type Problem$1 = Problem<string, number, undefined, Array<{ id: number; name: string; color: string; }>, ProblemType>; declare const DEFAULT_BASE_URL = "https://api.loj.ac"; /** * Lyrio platform. * * I18n is supported. */ declare class Lyrio extends Platform<string> { constructor(options?: PlatformOptions<string>); /** Fetches a problem from LibreOJ using API. */ getProblem(id: string): Promise<Problem$1>; } //#endregion export { DEFAULT_BASE_URL, Problem$1 as Problem, ProblemType, Lyrio as default };