import { Say } from './say.js'; import type { ImportIssue, ImportSeverity } from './types.js'; /** * The problems of the file as a whole that stop the reader before the end of * the file. A job with one of them has no file with errors to give: the page * shows the problem, and the admin fixes the file. */ export declare const READING_STOPPED_CODES: readonly ["FILE_ENCODING", "WRONG_DELIMITER", "UNCLOSED_QUOTE", "ROW_TOO_LARGE", "FILE_TOO_LARGE"]; /** * The stable issue codes. A code is never renamed or reused, because reports * and translations refer to it. The API's own error codes are separate. */ export declare const IMPORT_ISSUE_CODES: readonly ["FILE_ENCODING", "FILE_EMPTY", "FILE_TOO_LARGE", "WRONG_DELIMITER", "DUPLICATE_COLUMN", "UNCLOSED_QUOTE", "ROW_TOO_LARGE", "ROW_WIDTH", "MISSING_COLUMN", "UNKNOWN_COLUMN", "COLUMNS_IGNORED", "MISSING_REQUIRED", "INVALID_VALUE", "INVALID_JSON", "DUPLICATE_KEY_IN_FILE", "REFERENCE_NOT_FOUND", "REFERENCE_AMBIGUOUS", "ALREADY_EXISTS", "NOT_FOUND", "OPTION_NOT_FOUND", "PARENT_CYCLE", "VARIANT_INCONSISTENT", "VARIANT_CONFLICT", "VARIANT_NOT_ADJACENT", "ATTRIBUTE_NOT_IN_GROUP", "VARIANT_DUPLICATE_COMBINATION", "VALUES_WILL_BE_REMOVED", "CONFLICT", "URL_KEY_RESERVED", "IGNORED_VALUE", "DUPLICATE_VALUE", "TEMPLATE_EXAMPLE_ROW", "IMAGE_UNREADABLE", "ADDRESS_INVALID", "METAFIELD_INVALID", "DEPENDENCY_FAILED", "WRITE_FAILED"]; export type ImportIssueCode = (typeof IMPORT_ISSUE_CODES)[number]; export declare function defaultSeverity(code: ImportIssueCode): ImportSeverity; export interface IssueInput { code: ImportIssueCode; /** A `say` sentence can be said in the admin's language; a plain text stays as it is. */ message: string | Say; params?: Record; /** Default: the code's own severity. */ severity?: ImportSeverity; rowNumber?: number; column?: string; value?: string; } /** * The one way to make an issue. It makes the issue safe to store and to show: * no U+0000, a cell, a column name and a message are truncated, and the cell of * a password column is dropped. */ export declare function createIssue(input: IssueInput): ImportIssue;