import type { Fetcher, Key, SWRConfiguration } from 'swr'; import type { MutableRefObject } from 'react'; import type { Unsubscribe } from '@lemasc/firebase-wrapper/firestore'; import type { Document, FetchHookOptions } from '../types'; declare type FetcherResponse = Data | Promise; declare type ObjectAsRefs = { [P in keyof T]: MutableRefObject; }; declare type InternalState> = { unsubscribeRef: Unsubscribe | null; shouldListen: FetchHookOptions['listen']; datesToParse: FetchHookOptions['parseDates']; shouldIgnoreSnapshot: FetchHookOptions['ignoreFirestoreDocumentSnapshotField']; validate: FetchHookOptions['validator']; }; export declare const useFirestoreInternal: = Record, Doc extends Document> = Document, SWRKey extends Key = null, SWRReturn extends Doc | Doc[] = Doc>(key: SWRKey, fetcher: (state: ObjectAsRefs>, ...args: Parameters>) => FetcherResponse, options: { listen?: boolean | undefined; } & import("../types").FetchStaticOptions & Partial>>) => { /** * A function that, when called, unsubscribes the Firestore listener. * * The function can be null, so make sure to check that it exists before calling it. * * **Note**: This is not necessary to use. The hook already unmounts the listener for you. This is only intended if you want to unsubscribe on your own. */ unsubscribe: Unsubscribe | null; data?: SWRReturn | null | undefined; error?: any; mutate: import("swr").KeyedMutator; isValidating: boolean; }; export {};