/** * @since 1.0.0 */ import type * as Cause from "effect/Cause"; import * as Channel from "effect/Channel"; import * as Chunk from "effect/Chunk"; import type { ParseError } from "effect/ParseResult"; import type * as Schema from "effect/Schema"; /** * @since 1.0.0 * @category type ids */ export declare const ErrorTypeId: unique symbol; /** * @since 1.0.0 * @category type ids */ export type NdjsonErrorTypeId = typeof ErrorTypeId; declare const NdjsonError_base: new >(args: import("effect/Types").Simplify) => Cause.YieldableError & Record & { readonly _tag: "NdjsonError"; } & Readonly; /** * @since 1.0.0 * @category errors */ export declare class NdjsonError extends NdjsonError_base<{ readonly reason: "Pack" | "Unpack"; readonly cause: unknown; }> { get message(): "Pack" | "Unpack"; } /** * Represents a set of options which can be used to control how the newline * delimited JSON is handled. * * @since 1.0.0 * @category models */ export interface NdjsonOptions { /** * Whether or not the newline delimited JSON parser should ignore empty lines. * * Defaults to `false`. * * From the [newline delimited JSON spec](https://github.com/ndjson/ndjson-spec): * ```text * The parser MAY silently ignore empty lines, e.g. \n\n. This behavior MUST * be documented and SHOULD be configurable by the user of the parser. * ``` * * @since 1.0.0 */ readonly ignoreEmptyLines?: boolean; } /** * @since 1.0.0 * @category constructors */ export declare const packString: () => Channel.Channel, Chunk.Chunk, IE | NdjsonError, IE, Done, Done>; /** * @since 1.0.0 * @category constructors */ export declare const pack: () => Channel.Channel, Chunk.Chunk, IE | NdjsonError, IE, Done, Done>; /** * @since 1.0.0 * @category constructors */ export declare const packSchema: (schema: Schema.Schema) => () => Channel.Channel, Chunk.Chunk, IE | NdjsonError | ParseError, IE, Done, Done, R>; /** * @since 1.0.0 * @category constructors */ export declare const packSchemaString: (schema: Schema.Schema) => () => Channel.Channel, Chunk.Chunk, IE | NdjsonError | ParseError, IE, Done, Done, R>; /** * @since 1.0.0 * @category constructors */ export declare const unpackString: (options?: NdjsonOptions) => Channel.Channel, Chunk.Chunk, IE | NdjsonError, IE, Done, Done>; /** * @since 1.0.0 * @category constructors */ export declare const unpack: (options?: NdjsonOptions) => Channel.Channel, Chunk.Chunk, IE | NdjsonError, IE, Done, Done>; /** * @since 1.0.0 * @category constructors */ export declare const unpackSchema: (schema: Schema.Schema) => (options?: NdjsonOptions) => Channel.Channel, Chunk.Chunk, NdjsonError | ParseError | IE, IE, Done, Done, R>; /** * @since 1.0.0 * @category constructors */ export declare const unpackSchemaString: (schema: Schema.Schema) => (options?: NdjsonOptions) => Channel.Channel, Chunk.Chunk, NdjsonError | ParseError | IE, IE, Done, Done, R>; /** * @since 1.0.0 * @category combinators */ export declare const duplex: { /** * @since 1.0.0 * @category combinators */ (options?: NdjsonOptions): (self: Channel.Channel, Chunk.Chunk, OE, IE | NdjsonError, OutDone, InDone, R>) => Channel.Channel, Chunk.Chunk, NdjsonError | OE, IE, OutDone, InDone, R>; /** * @since 1.0.0 * @category combinators */ (self: Channel.Channel, Chunk.Chunk, OE, IE | NdjsonError, OutDone, InDone, R>, options?: NdjsonOptions): Channel.Channel, Chunk.Chunk, NdjsonError | OE, IE, OutDone, InDone, R>; }; /** * @since 1.0.0 * @category combinators */ export declare const duplexString: { /** * @since 1.0.0 * @category combinators */ (options?: NdjsonOptions): (self: Channel.Channel, Chunk.Chunk, OE, IE | NdjsonError, OutDone, InDone, R>) => Channel.Channel, Chunk.Chunk, NdjsonError | OE, IE, OutDone, InDone, R>; /** * @since 1.0.0 * @category combinators */ (self: Channel.Channel, Chunk.Chunk, OE, IE | NdjsonError, OutDone, InDone, R>, options?: NdjsonOptions): Channel.Channel, Chunk.Chunk, NdjsonError | OE, IE, OutDone, InDone, R>; }; /** * @since 1.0.0 * @category combinators */ export declare const duplexSchema: { /** * @since 1.0.0 * @category combinators */ (options: Partial & { readonly inputSchema: Schema.Schema; readonly outputSchema: Schema.Schema; }): (self: Channel.Channel, Chunk.Chunk, OutErr, NdjsonError | ParseError | InErr, OutDone, InDone, R>) => Channel.Channel, Chunk.Chunk, NdjsonError | ParseError | OutErr, InErr, OutDone, InDone, R | IR | OR>; /** * @since 1.0.0 * @category combinators */ (self: Channel.Channel, Chunk.Chunk, OutErr, NdjsonError | ParseError | InErr, OutDone, InDone, R>, options: Partial & { readonly inputSchema: Schema.Schema; readonly outputSchema: Schema.Schema; }): Channel.Channel, Chunk.Chunk, NdjsonError | ParseError | OutErr, InErr, OutDone, InDone, R | IR | OR>; }; /** * @since 1.0.0 * @category combinators */ export declare const duplexSchemaString: { /** * @since 1.0.0 * @category combinators */ (options: Partial & { readonly inputSchema: Schema.Schema; readonly outputSchema: Schema.Schema; }): (self: Channel.Channel, Chunk.Chunk, OutErr, NdjsonError | ParseError | InErr, OutDone, InDone, R>) => Channel.Channel, Chunk.Chunk, NdjsonError | ParseError | OutErr, InErr, OutDone, InDone, R | IR | OR>; /** * @since 1.0.0 * @category combinators */ (self: Channel.Channel, Chunk.Chunk, OutErr, NdjsonError | ParseError | InErr, OutDone, InDone, R>, options: Partial & { readonly inputSchema: Schema.Schema; readonly outputSchema: Schema.Schema; }): Channel.Channel, Chunk.Chunk, NdjsonError | ParseError | OutErr, InErr, OutDone, InDone, R | IR | OR>; }; export {}; //# sourceMappingURL=Ndjson.d.ts.map