UNPKG

@typeheim/orm-on-fire

Version:
33 lines (32 loc) 1.65 kB
import * as types from '@firebase/firestore-types'; import { EntityMetadata, PropertyMetadata } from '../Contracts/EntityMetadata'; import { CollectionReference } from './CollectionReference'; import { Model } from '../Contracts/Model'; import DocumentSnapshot = types.DocumentSnapshot; import DocumentReference = types.DocumentReference; export declare class EntityManager<Entity> { protected metadata: EntityMetadata; protected entityConstructor: any; protected collectionReference: CollectionReference; constructor(metadata: EntityMetadata, entityConstructor: any, collectionReference: CollectionReference); fromSnapshot(docSnapshot: DocumentSnapshot): Entity; protected createTextIndex(text: string): string[]; protected createReverseTextIndex(text: string): string[]; createEntity(): any; protected attachSubCollectionsToEntity(entity: Entity, docReference: DocumentReference): void; protected attachRefsToEntity(entity: Entity, data: any): void; extractDataFromEntity(entity: Model): {}; refreshNewEntity(entity: Entity, docReference: DocumentReference): void; attachOrmMetadataToEntity(entity: Entity, docReference: DocumentReference): void; attachMetadataToNewEntity(entity: Entity): void; protected createMutationTracker(entity: Entity): MutationTracker; } export declare class MutationTracker { protected copy: {}; protected fields: PropertyMetadata[]; protected entity: any; constructor(entity: any, fields: PropertyMetadata[]); refreshEntity(): void; getChanges(entity: any): {}; protected deepCopy(inObject: any): any; }