import { Observable } from "rxjs"; /** * Wraps an Observable in a Proxy that enables property chaining. * When accessing a property ending with `$`, it uses switchMap to chain * to that property's observable value. * When accessing a non-observable property, it returns an Observable of that property's value. */ export declare function chainable(observable: Observable): ChainableObservable; /** * Helper type to extract nullable parts (undefined/null) from a type */ type NullableParts = Extract; /** * Helper type to get the property type, preserving nullable parts from the parent type */ type PropChain> = NonNullable[K] | NullableParts; /** * 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: */ export type ChainableObservable = Observable & Omit<{ [K in keyof NonNullable as K extends string ? K : never]: K extends `${infer _}$` ? NonNullable[K] extends Observable ? ChainableObservable> : never : ChainableObservable>; }, "$first" | "$last"> & { /** Returns a promise that resolves with the first value or rejects with a timeout error */ $first(first?: number): Promise>; $first(first?: number, fallback?: V): Promise | V>; /** Returns a promise that resolves with the last value or rejects with a timeout error */ $last(max?: number): Promise>; $last(max?: number, fallback?: V): Promise | V>; }; export {};