UNPKG

un-oj

Version:

Unified Online Judge information collector.

42 lines (40 loc) 1.54 kB
import { Contest, Platform, PlatformOptions, Problem, ProblemDescriptionObject, TagInfo } from "../platform-DVQwRMI1.js"; //#region src/platforms/luogu.d.ts type ProblemType = 'traditional' | 'interactive' | 'communication' | 'submission'; type Difficulty = 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7; /** Maps {@link Difficulty} to a string label in Chinese. */ declare const DifficultyLabel: Record<Difficulty, string>; /** * Luogu-specific problem type. * * Description is Markdown. */ type Problem$1 = Problem<ProblemDescriptionObject, number[], Difficulty, TagInfo[], ProblemType>; type ProblemIdPrefix = 'B' | 'P' | 'T' | 'U'; type ContestFormat = 1 | 2 | 3 | 4 | 5; declare const ContestFormatLabel: Record<ContestFormat, string>; interface ContestProblem { score: number; problem: { pid: string; title: string; difficulty: Difficulty; fullScore: number; type: ProblemIdPrefix; }; } type Contest$1 = Contest<ContestProblem, ContestFormat>; declare const DEFAULT_BASE_URL = "https://www.luogu.com.cn"; /** * Luogu platform. * * I18n is supported. */ declare class Luogu extends Platform<string> { constructor(options?: PlatformOptions<string>); /** Fetches a problem from Luogu using internal API. */ getProblem(id: string): Promise<Problem$1>; getContest(id: string): Promise<Contest$1>; } //#endregion export { Contest$1 as Contest, ContestFormat, ContestFormatLabel, ContestProblem, DEFAULT_BASE_URL, Difficulty, DifficultyLabel, Problem$1 as Problem, ProblemIdPrefix, ProblemType, Luogu as default };