jtc-utils
Version:
Utilities for Japanese Traditional Companies
43 lines • 1.47 kB
text/typescript
import type { FileHandle } from "node:fs/promises";
import type { Readable } from "node:stream";
import type { Charset } from "./charset/charset.cjs";
export declare type FixlenReaderColumn = {
start: number;
length?: number;
shift?: boolean;
trim?: "left" | "right" | "both";
type?: "decimal" | "int-le" | "int-be" | "uint-le" | "uint-be" | "zoned" | "packed";
};
export interface FixlenLineDecoder {
decode(column: FixlenReaderColumn): string | number;
}
export declare class FixlenReader {
private reader;
private decoder;
private lineLength;
private columns;
private shift;
private fatal;
private buf;
private index;
constructor(src: string | Uint8Array | Blob | ReadableStream<Uint8Array> | FileHandle | Readable, config: {
lineLength: number;
columns: FixlenReaderColumn[] | ((line: FixlenLineDecoder) => FixlenReaderColumn[]);
charset?: Charset;
bom?: boolean;
shift?: boolean;
fatal?: boolean;
});
read(options?: {
lineLength: number;
columns: FixlenReaderColumn[] | ((line: FixlenLineDecoder) => FixlenReaderColumn[]);
shift?: boolean;
}): Promise<(string | number)[] | undefined>;
[Symbol.asyncIterator](): AsyncGenerator<(string | number)[]>;
get count(): number;
close(): Promise<void>;
private normalizeColumns;
private decode;
private concat;
}
//# sourceMappingURL=FixlenReader.d.cts.map