import cheerio from "cheerio"; type Cheerio = ReturnType; type Element = Cheerio[number]; /** * The minimal component of a form to be posted to the school server. * * Nobody knows what `name` stands for, but it is certain that `value` * stands for the score of a question in some occasions. */ export declare class InputTag { private readonly name; value: string; constructor(input: Element | string, value?: string); toPair: () => [string, string]; outOfRange: () => boolean; } /** * Corresponds to the questions on the teaching-evaluation form. * * **DO NOT** ask why it contains property `suggestion`. Foolish design * of the original website. */ export interface InputGroup { question: string; suggestion: InputTag; score: InputTag; others: InputTag[]; } export declare class Overall { private suggestionTag; score: InputTag; constructor(suggestionTag: InputTag, score: InputTag); get suggestion(): string; set suggestion(text: string); toPairs(): [string, string][]; } export declare class Person { name: string; inputGroups: InputGroup[]; constructor(name: string, inputGroups: InputGroup[]); autoScore(score?: number): void; outOfRange: () => boolean; get suggestion(): string; set suggestion(text: string); toPairs(): [string, string][]; } export declare class Form { private basics; overall: Overall; teachers: Person[]; assistants: Person[]; constructor(basics: InputTag[], overall: Overall, teachers: Person[], assistants: Person[]); /** * Check whether this form is valid to post. * * Returns a reason as a `string` if invalid, or `undefined` if else. */ invalid: () => "overallOutOfRange" | "teachersOutOfRange" | "assistantsOutOfRange" | "exceptionOccurred" | undefined; /** * The form has to be serialized in order to be posted. */ serialize: () => any; } /** * Read persons data from their corresponding html tables. */ export declare const toPersons: (tables: Cheerio) => Person[]; export {};