import type { ReadStatMetadata } from "./types.js"; import type { Variable } from "./variable.js"; import type { ReadStatValue } from "./value.js"; import type { IoContext } from "./io.js"; import { Codec } from "./codec.js"; import { HandlerStatus } from "./types.js"; export type HandlerResult = HandlerStatus | number | void; export type MetadataHandler = (metadata: ReadStatMetadata, ctx: unknown) => HandlerResult; export type NoteHandler = (noteIndex: number, note: string, ctx: unknown) => HandlerResult; export type VariableHandler = (index: number, variable: Variable, valLabels: string | null, ctx: unknown) => HandlerResult; export type FweightHandler = (variable: Variable, ctx: unknown) => HandlerResult; export type ValueHandler = (obsIndex: number, variable: Variable, value: ReadStatValue, ctx: unknown) => HandlerResult; export type ValueLabelHandler = (valLabels: string, value: ReadStatValue, label: string, ctx: unknown) => HandlerResult; export type ErrorHandler = (message: string, ctx: unknown) => void; export type ProgressHandler = (progress: number, ctx: unknown) => HandlerResult; export interface Handlers { metadata?: MetadataHandler; note?: NoteHandler; variable?: VariableHandler; fweight?: FweightHandler; value?: ValueHandler; valueLabel?: ValueLabelHandler; error?: ErrorHandler; progress?: ProgressHandler; } export declare class ReadStatParser { handlers: Handlers; io: IoContext | null; inputEncoding: string | null; outputEncoding: string | null; rowLimit: number; rowOffset: number; codec: Codec; setMetadataHandler(h: MetadataHandler): this; setNoteHandler(h: NoteHandler): this; setVariableHandler(h: VariableHandler): this; setFweightHandler(h: FweightHandler): this; setValueHandler(h: ValueHandler): this; setValueLabelHandler(h: ValueLabelHandler): this; setErrorHandler(h: ErrorHandler): this; setProgressHandler(h: ProgressHandler): this; setFileCharacterEncoding(encoding: string | null): this; setHandlerCharacterEncoding(encoding: string | null): this; setRowLimit(limit: number): this; setRowOffset(offset: number): this; setCodec(codec: Codec): this; }