import { Progress } from "../Progress"; import { Timestamp } from "../Types"; import { JSONStream } from "../parse/JSONStream"; /** Our interface for input files. Environment agnostic */ export interface FileInput { name: string; size: number; lastModified: number; slice(start?: number, end?: number): Promise; } /** Wraps a string into our file abstraction. Useful for testing */ export declare const wrapStringAsFile: (content: string) => FileInput; /** Streams a file into a JSONStream in 2MB chunks, optionally providing progress */ export declare const streamJSONFromFile: (stream: JSONStream, file: FileInput, progress?: Progress) => AsyncGenerator; /** * Tries to find a timestamp at the end of a file, using the provided regex. The regex must have a capture group. * It can detect ISO 8601 dates and unix timestamps. * * This is useful to compute how up-to-date a file is before parsing it, so we can always keep the latest information (e.g. nicknames) */ export declare const tryToFindTimestampAtEnd: (regex: RegExp, file: FileInput) => Promise;