/** * A location in source text */ export interface Location { line: number; column: number; position: number; /** * The file, internal module, shared object, etc. */ unit?: string; length?: number; } export declare function locationText(loc: Location): string; export interface Issue { location?: Location; source?: string; message?: string; level: IssueLevel; stack?: string; toString?(): string; } export declare enum IssueLevel { Error = 0, Warning = 1, Note = 2, Debug = 5 } declare const issueTypes: readonly ["Error", "Warning", "Note", "Debug"]; type IssueHelperName = Lowercase<(typeof issueTypes)[number]>; export type IssueHelpers = Record Issue>; export declare function createIssueHelpers(parse: (input: I) => Pick): IssueHelpers; export declare function isIssue(i: unknown): i is Issue; export interface IssueFormatting { colors: boolean; trace: boolean; } /** * The entry point for the "current" file being processed. * Used for last-ditch attempt at getting an issue's source file name */ export declare let __entry: string | undefined; export declare function __setEntry(entry: string): void; export declare function getSource(path: string | undefined, offset: number): string | undefined; export declare function stringifyIssue(i: Issue, options: Partial): string; /** * Report an issue * @internal */ export declare function emitIssue(issue: Issue): void; export declare function onIssue(handler: (issue: Issue) => unknown): void; export {};