/** * Effect `Stream` utilities for Frida. * * @since 1.0.0 */ import type * as Cause from "effect/Cause"; import type * as Duration from "effect/Duration"; import type * as Effect from "effect/Effect"; import type * as Function from "effect/Function"; import type * as Scope from "effect/Scope"; import type * as Stream from "effect/Stream"; /** * @since 1.0.0 * @category Types */ export interface FromInputStreamOptions { /** Size passed to each `InputStream.read` call, defaults to 64 KiB. */ readonly chunkSize?: number | undefined; } /** * Receives the messages posted by the host, shared with `Stream.share` using * the given options. * * Frida's `recv` registrations are shared module wide, so every message is * delivered once across all `receiveStream`s: two of them split the messages * between each other instead of both seeing every message. Call it once and * share the resulting stream. * * @since 1.0.0 * @category IPC */ export declare const receiveStream: (shareOptions: { readonly capacity: "unbounded"; readonly replay?: number | undefined; readonly idleTimeToLive?: Duration.Input | undefined; } | { readonly capacity: number; readonly strategy?: "sliding" | "dropping" | "suspend" | undefined; readonly replay?: number | undefined; readonly idleTimeToLive?: Duration.Input | undefined; }) => Effect.Effect, never, Scope.Scope>; /** * Reads from a Frida `InputStream`, which is closed when the stream finishes. * Errors are mapped with `onError`, defaulting to `Cause.UnknownError`. * * @since 1.0.0 * @category Constructors * @see https://frida.re/docs/javascript-api/#inputstream */ export declare const fromInputStream: (options: FromInputStreamOptions & { readonly evaluate: Function.LazyArg; readonly onError?: ((error: unknown) => E) | undefined; }) => Stream.Stream; /** * @since 1.0.0 * @category Constructors * @see https://frida.re/docs/javascript-api/#unixinputstream */ export declare const makeUnixInputStream: (options: FromInputStreamOptions & UnixStreamOptions & { readonly fileDescriptor: number; readonly onError?: ((error: unknown) => E) | undefined; }) => Stream.Stream; /** * @since 1.0.0 * @category Constructors * @see https://frida.re/docs/javascript-api/#win32inputstream */ export declare const makeWin32InputStream: (options: FromInputStreamOptions & WindowsStreamOptions & { readonly handle: NativePointerValue; readonly onError?: ((error: unknown) => E) | undefined; }) => Stream.Stream; /** * @since 1.0.0 * @category Destructors * @see https://frida.re/docs/javascript-api/#inputstream */ export declare const toInputStream: (stream: Stream.Stream) => Effect.Effect; /** * Like {@link toInputStream} but with `R` fixed to `never`. * * @since 1.0.0 * @category Destructors */ export declare const toInputStreamNever: (stream: Stream.Stream) => InputStream; //# sourceMappingURL=Stream.d.ts.map