UNPKG

tupleson

Version:

A hackable JSON serializer/deserializer

25 lines (22 loc) 1.19 kB
import { TsonAsyncOptions, TsonAsyncStringifierIterable, TsonAsyncStringifier, BrandSerialized } from './asyncTypes.js'; import { TsonParseAsyncOptions } from './deserializeAsync.js'; import { createTsonSerializeJsonStreamResponse } from './serializeAsync.js'; import '../internals/esque.js'; import '../sync/syncTypes.js'; import './asyncErrors.js'; import '../errors.js'; /** * Only used for testing - when using the async you gotta pick which one you want * @internal */ declare const createTsonAsync: (opts: TsonAsyncOptions) => { createEventSource: <TValue = unknown>(url: string, parseOpts?: TsonParseAsyncOptions & { signal?: AbortSignal; }) => Promise<TValue>; fromJsonStreamResponse: <TValue_1 = unknown>(response: Response) => Promise<TValue_1>; parseJsonStream: <TValue_2>(string: AsyncIterable<string> | TsonAsyncStringifierIterable<TValue_2>, opts?: TsonParseAsyncOptions | undefined) => Promise<TValue_2>; stringifyJsonStream: TsonAsyncStringifier; toJsonStreamResponse: typeof createTsonSerializeJsonStreamResponse; toSSEResponse: <TValue_3>(value: TValue_3) => BrandSerialized<Response, TValue_3>; }; export { createTsonAsync };