AppleSauce
    Preparing search index...

    Type Alias ChainableObservable<T>

    ChainableObservable: Observable<T> & Omit<
        {
            [K in keyof NonNullable<T> as K extends string ? K : never]: K extends `${infer _}$`
                ? NonNullable<T>[K] extends Observable<infer U>
                    ? ChainableObservable<U | NullableParts<T>>
                    : never
                : ChainableObservable<PropChain<T, K>>
        },
        "$first"
        | "$last",
    > & {
        $first(first?: number): Promise<NonNullable<T>>;
        $first<V>(first?: number, fallback?: V): Promise<NonNullable<T> | V>;
        $last(max?: number): Promise<NonNullable<T>>;
        $last<V>(max?: number, fallback?: V): Promise<NonNullable<T> | V>;
    }

    A chainable Observable type that allows property chaining. This type maps all properties to chainable observables:

    • Properties ending with $: extracts inner type from Observable → ChainableObservable
    • Other properties: uses property type directly → ChainableObservable

    Note: TypeScript has limitations inferring through Proxy types. For better type inference, you may need to explicitly type the result:

    Type Parameters

    • T

    Type Declaration

    • $first: function
      • Returns a promise that resolves with the first value or rejects with a timeout error

        Parameters

        • Optionalfirst: number

        Returns Promise<NonNullable<T>>

      • Type Parameters

        • V

        Parameters

        • Optionalfirst: number
        • Optionalfallback: V

        Returns Promise<NonNullable<T> | V>

    • $last: function
      • Returns a promise that resolves with the last value or rejects with a timeout error

        Parameters

        • Optionalmax: number

        Returns Promise<NonNullable<T>>

      • Type Parameters

        • V

        Parameters

        • Optionalmax: number
        • Optionalfallback: V

        Returns Promise<NonNullable<T> | V>