import { BehaviorSubject, NextObserver, Observable, ObservableInput, Subject, Unsubscribable } from "rxjs"; import { DeepReadonly, MaybeRef, MultiWatchSources, Ref, ShallowRef, WatchHandle, WatchOptions, WatchSource } from "vue"; import { MapOldSources, MapSources } from "@vueuse/shared"; //#region from/index.d.ts declare function from(value: ObservableInput | Ref, watchOptions?: WatchOptions): Observable; declare function fromEvent(value: MaybeRef, event: string): Observable; //#endregion //#region toObserver/index.d.ts declare function toObserver(value: Ref): NextObserver; //#endregion //#region useObservable/index.d.ts interface UseObservableOptions { onError?: (err: any) => void; /** * The value that should be set if the observable has not emitted. */ initialValue?: I | undefined; } declare function useObservable(observable: Observable, options?: UseObservableOptions): Readonly>; //#endregion //#region watchExtractedObservable/index.d.ts type OnCleanup = (cleanupFn: () => void) => void; type WatchExtractedObservableCallback = (value: NonNullable, oldValue: OldValue, onCleanup: OnCleanup) => Observable; interface WatchExtractedObservableOptions { onError?: (err: unknown) => void; onComplete?: () => void; } declare function watchExtractedObservable = false>(sources: [...T], extractor: WatchExtractedObservableCallback, MapOldSources, E>, callback: (snapshot: E) => void, subscriptionOptions?: WatchExtractedObservableOptions, watchOptions?: WatchOptions): WatchHandle; declare function watchExtractedObservable, E, Immediate extends Readonly = false>(source: T, extractor: WatchExtractedObservableCallback, MapOldSources, E>, callback: (snapshot: E) => void, subscriptionOptions?: WatchExtractedObservableOptions, watchOptions?: WatchOptions): WatchHandle; declare function watchExtractedObservable = false>(source: WatchSource, extractor: WatchExtractedObservableCallback, callback: (snapshot: E) => void, subscriptionOptions?: WatchExtractedObservableOptions, watchOptions?: WatchOptions): WatchHandle; declare function watchExtractedObservable = false>(source: T, extractor: WatchExtractedObservableCallback, callback: (snapshot: E) => void, subscriptionOptions?: WatchExtractedObservableOptions, watchOptions?: WatchOptions): WatchHandle; //#endregion //#region useExtractedObservable/index.d.ts interface UseExtractedObservableOptions extends UseObservableOptions { onComplete?: () => void; } declare function useExtractedObservable = false>(sources: [...T], extractor: WatchExtractedObservableCallback, MapOldSources, E>, options?: UseExtractedObservableOptions, watchOptions?: WatchOptions): DeepReadonly>; declare function useExtractedObservable, E, Immediate extends Readonly = false>(sources: T, extractor: WatchExtractedObservableCallback, MapOldSources, E>, options?: UseExtractedObservableOptions, watchOptions?: WatchOptions): DeepReadonly>; declare function useExtractedObservable = false>(sources: WatchSource, extractor: WatchExtractedObservableCallback, options?: UseExtractedObservableOptions, watchOptions?: WatchOptions): DeepReadonly>; declare function useExtractedObservable = false>(sources: T, extractor: WatchExtractedObservableCallback, options?: UseExtractedObservableOptions, watchOptions?: WatchOptions): DeepReadonly>; //#endregion //#region useSubject/index.d.ts interface UseSubjectOptions extends Omit, 'initialValue'> {} declare function useSubject(subject: BehaviorSubject, options?: UseSubjectOptions): Ref; declare function useSubject(subject: Subject, options?: UseSubjectOptions): Ref; //#endregion //#region useSubscription/index.d.ts declare function useSubscription(subscription: Unsubscribable): void; //#endregion export { OnCleanup, UseExtractedObservableOptions, UseObservableOptions, UseSubjectOptions, WatchExtractedObservableCallback, WatchExtractedObservableOptions, from, fromEvent, toObserver, useExtractedObservable, useObservable, useSubject, useSubscription, watchExtractedObservable };