import Realm from "realm"; import { AnyRealmObject } from "./helpers"; import { UseRealmHook } from "./useRealm"; type RealmClassType = { new (...args: any): T; }; export type ObjectHookOptions = { type: string; primaryKey: T[keyof T]; keyPaths?: string | string[]; }; export type ObjectHookClassBasedOptions = { type: RealmClassType; primaryKey: T[keyof T]; keyPaths?: string | string[]; }; export type UseObjectHook = { (options: ObjectHookOptions): (T & Realm.Object) | null; (options: ObjectHookClassBasedOptions): T | null; (type: string, primaryKey: T[keyof T], keyPaths?: string | string[]): (T & Realm.Object) | null; (type: RealmClassType, primaryKey: T[keyof T], keyPaths?: string | string[]): T | null; }; /** * Generates the `useObject` hook from a given `useRealm` hook. * @param useRealm - Hook that returns an open Realm instance * @returns useObject - Hook that is used to gain access to a single Realm object from a primary key */ export declare function createUseObject(useRealm: UseRealmHook): UseObjectHook; export {}; //# sourceMappingURL=useObject.d.ts.map