UNPKG

@realm/react

Version:

React specific hooks and implementation helpers for Realm

22 lines 1.06 kB
import Realm from "realm"; export declare function getObjectForPrimaryKey<T extends Realm.Object>(realm: Realm, type: string | { new (...args: any): T; }, primaryKey: T[keyof T]): T | null; export declare function getObjects<T extends Realm.Object>(realm: Realm, type: string | { new (...args: any): T; }): Realm.Results<T>; export type CollectionCallback = Parameters<typeof Realm.Results.prototype.addListener>[0]; export type AnyRealmObject = Realm.Object<any>; export type RealmClassType<T = any> = { new (...args: any): T; }; /** * Explicitly sets the unpicked properties of a type to never instead of dropping them like in Pick. * Useful for ensuring different prop types are mutually exclusive as React expects the union type * of different prop types to include all the fields. */ export type RestrictivePick<T, K extends keyof T> = Pick<T, K> & { [RestrictedKey in keyof Omit<T, K>]?: never; }; export declare function isClassModelConstructor(value: unknown): value is RealmClassType<unknown>; //# sourceMappingURL=helpers.d.ts.map