import type { StoredIssue } from '../job/types.js'; import type { Say } from '../say.js'; /** What a message is made from: the code and the parameters, with the English fallback. */ export type RenderableIssue = Pick; /** * Turns an issue into the sentence the admin reads, in the admin's language * (§ 8.4, Issues: the page and the `_errors` column render the code and the * parameters when they are read). The real one calls the server-side `translate`; * without one the stored English `message` is used. */ export type RenderMessage = (issue: RenderableIssue) => string; /** Says one of the sentences around the problems (`row:`, `warning:`, `(and 3 more)`) in the admin's language. */ export type RenderSentence = (sentence: Say) => string; export declare const MORE_NOT_LISTED = "(more problems not listed)"; /** More than this many problems on one row: the rest are counted, not written. */ export declare const MAX_PROBLEMS_PER_ROW = 10; export interface ErrorsCellOptions { /** The header's column names, to put the problems in the order of the columns. */ columns: readonly string[]; render?: RenderMessage; /** Says the words around the problems; English without it. */ sentence?: RenderSentence; /** The row may have problems that were over the cap and are not stored (§ 8.4). */ unlisted?: boolean; } /** * The text of the `_errors` cell of one row (§ 7.3): its problems on one line, * separated by ` | `. Errors come first, those of the whole row before those of * a column, columns left to right; then the warnings in the same order. Each * problem starts with the name of its column, `row:` or `warning:`, and the * name is quoted when a spreadsheet would read it as a formula, so the text * never starts with `=`, `+`, `-` or `@`. The cell value of a problem is not * part of it: it is shown in the problems table only, which keeps a password * out of the file. * * At most `MAX_PROBLEMS_PER_ROW` are written, so a row with many problems does * not grow past the limits of the reader when the file is uploaded again. */ export declare function errorsCell(issues: readonly StoredIssue[], options: ErrorsCellOptions): string;