/** * @since 2.0.0 */ import * as internal from "./internal/channel/upstreamPullStrategy.js" import type * as Option from "./Option.js" import type * as Types from "./Types.js" /** * @since 2.0.0 * @category symbols */ export const UpstreamPullStrategyTypeId: unique symbol = internal.UpstreamPullStrategyTypeId /** * @since 2.0.0 * @category symbols */ export type UpstreamPullStrategyTypeId = typeof UpstreamPullStrategyTypeId /** * @since 2.0.0 * @category models */ export type UpstreamPullStrategy = PullAfterNext | PullAfterAllEnqueued /** * @since 2.0.0 */ export declare namespace UpstreamPullStrategy { /** * @since 2.0.0 * @category models */ export interface Variance { readonly [UpstreamPullStrategyTypeId]: { readonly _A: Types.Covariant } } } /** * @since 2.0.0 * @category models */ export interface PullAfterNext extends UpstreamPullStrategy.Variance { readonly _tag: "PullAfterNext" readonly emitSeparator: Option.Option } /** * @since 2.0.0 * @category models */ export interface PullAfterAllEnqueued extends UpstreamPullStrategy.Variance { readonly _tag: "PullAfterAllEnqueued" readonly emitSeparator: Option.Option } /** * @since 2.0.0 * @category constructors */ export const PullAfterNext: (emitSeparator: Option.Option) => UpstreamPullStrategy = internal.PullAfterNext /** * @since 2.0.0 * @category constructors */ export const PullAfterAllEnqueued: (emitSeparator: Option.Option) => UpstreamPullStrategy = internal.PullAfterAllEnqueued /** * Returns `true` if the specified value is an `UpstreamPullStrategy`, `false` * otherwise. * * @since 2.0.0 * @category refinements */ export const isUpstreamPullStrategy: (u: unknown) => u is UpstreamPullStrategy = internal.isUpstreamPullStrategy /** * Returns `true` if the specified `UpstreamPullStrategy` is a `PullAfterNext`, * `false` otherwise. * * @since 2.0.0 * @category refinements */ export const isPullAfterNext: (self: UpstreamPullStrategy) => self is PullAfterNext = internal.isPullAfterNext /** * Returns `true` if the specified `UpstreamPullStrategy` is a * `PullAfterAllEnqueued`, `false` otherwise. * * @since 2.0.0 * @category refinements */ export const isPullAfterAllEnqueued: (self: UpstreamPullStrategy) => self is PullAfterAllEnqueued = internal.isPullAfterAllEnqueued /** * Folds an `UpstreamPullStrategy` into a value of type `Z`. * * @since 2.0.0 * @category folding */ export const match: { /** * Folds an `UpstreamPullStrategy` into a value of type `Z`. * * @since 2.0.0 * @category folding */ ( options: { readonly onNext: (emitSeparator: Option.Option) => Z readonly onAllEnqueued: (emitSeparator: Option.Option) => Z } ): (self: UpstreamPullStrategy) => Z /** * Folds an `UpstreamPullStrategy` into a value of type `Z`. * * @since 2.0.0 * @category folding */ ( self: UpstreamPullStrategy, options: { readonly onNext: (emitSeparator: Option.Option) => Z readonly onAllEnqueued: (emitSeparator: Option.Option) => Z } ): Z } = internal.match