UNPKG

piecemeal

Version:

Effortless incrementally deliver your data

15 lines (10 loc) 537 B
type Dict<T> = Record<string, T>; type Headers = Dict<string | ReadonlyArray<string>>; type Payload<T> = { data: T; headers: Headers }; type Abortable = { aborted: boolean }; type Options = { boundary?: string; }; declare const message: (payload: any, headers: Headers) => string; declare const generate: <T extends unknown>(iterator: AsyncIterableIterator<T> | IterableIterator<T>, boundary: string, write: (chunk: string) => Promise<any> | any, abort?: Abortable) => Promise<void>; export { Options, Payload, generate, message };