Options
All
  • Public
  • Public/Protected
  • All
Menu

firebase-firestorm

Index

Type aliases

EndAtQuery

EndAtQuery<T>: T | any

Type parameters

EndBeforeQuery

EndBeforeQuery<T>: T | any

Type parameters

OrderByQuery

OrderByQuery<T>: [keyof T, undefined | "desc" | "asc"]

Type parameters

StartAfterQuery

StartAfterQuery<T>: T | any

Type parameters

StartAtQuery

StartAtQuery<T>: T | any

Type parameters

WhereQuery

WhereQuery<T>: [keyof T, firestore.WhereFilterOp, any]

Type parameters

Functions

default

Const deserialize

  • Deserializes firestore document ref(s) into our representation. Deserializes a firestore timestamp into a firestorm timestamp. Deserializes a firestore geopoint into a firestorm geopoint. Deserializes an object to a firestorm object.

    Parameters

    • isArray: boolean

      Is the field an array.

    • entity: object

      The entity of the document.

    • value: DocumentReference | DocumentReference[]

      The firestore document ref(s).

    Returns IDocumentRef<IEntity> | IDocumentRef<IEntity>[]

  • Deserializes firestore document ref(s) into our representation. Deserializes a firestore timestamp into a firestorm timestamp. Deserializes a firestore geopoint into a firestorm geopoint. Deserializes an object to a firestorm object.

    Parameters

    • isArray: boolean

      Is the field an array.

    • value: Timestamp | Timestamp[]

      The firestore document ref(s).

    Returns Timestamp | Timestamp[]

  • Deserializes firestore document ref(s) into our representation. Deserializes a firestore timestamp into a firestorm timestamp. Deserializes a firestore geopoint into a firestorm geopoint. Deserializes an object to a firestorm object.

    Parameters

    • isArray: boolean

      Is the field an array.

    • value: GeoPoint | GeoPoint[]

      The firestore document ref(s).

    Returns IGeoPoint | IGeoPoint[]

  • Deserializes firestore document ref(s) into our representation. Deserializes a firestore timestamp into a firestorm timestamp. Deserializes a firestore geopoint into a firestorm geopoint. Deserializes an object to a firestorm object.

    Parameters

    • isArray: boolean

      Is the field an array.

    • value: Record<string, any> | Record<string, any>[]

      The firestore document ref(s).

    • fields: Map<string, IFieldMeta>
    • Entity: object

    Returns IEntity | IEntity[]

Const destroy

  • destroy(): void

Const getOrCreateRepository

  • Creates a repository with a given name if it doesn't exist, and returns the repository.

    Parameters

    • key: string

      The name of the Entity class

    Returns IRepository

Const getRepository

Const initialize

  • Initializes firestorm with an instance of firestore.

    Parameters

    • firestore: Firestore

      A firestore instance.

    • Optional config: IFireormConfig

      Configuration options for firestorm.

    Returns void

Const serialize

  • serialize(isArray: boolean, value: IDocumentRef<IEntity> | IDocumentRef<IEntity>[]): DocumentReference
  • serialize(isArray: boolean, updateOnWrite: boolean, updateOnCreate: boolean, updateOnUpdate: boolean, writeType: WriteTypes, value: Timestamp | Timestamp[]): Timestamp | Timestamp[] | FieldValue | FieldValue[]
  • serialize(isArray: boolean, value: IGeoPoint | IGeoPoint[]): GeoPoint | GeoPoint[]
  • serialize(isArray: boolean, value: Record<string, any> | Record<string, any>[], fields: Map<string, IFieldMeta>, writeType: WriteTypes): Record<string, any> | Record<string, any>
  • Deserializes a firestore document reference into a firestorm document reference. Serializes our representation of a timestamp to firestores. Serializes our representation of a geopoint into a firestorm geopoint; Serializes an firestorm object into a firestore object;

    Parameters

    Returns DocumentReference

  • Deserializes a firestore document reference into a firestorm document reference. Serializes our representation of a timestamp to firestores. Serializes our representation of a geopoint into a firestorm geopoint; Serializes an firestorm object into a firestore object;

    Parameters

    • isArray: boolean

      Is the field an array.

    • updateOnWrite: boolean

      Should the value be auto-updated on creation & updates.

    • updateOnCreate: boolean

      Should the value be auto-updated on creation.

    • updateOnUpdate: boolean

      Should the value be auto-updated on updates.

    • writeType: WriteTypes

      Whether the write is a create or update.

    • value: Timestamp | Timestamp[]

      The firestore geopoint(s) representation.

    Returns Timestamp | Timestamp[] | FieldValue | FieldValue[]

  • Deserializes a firestore document reference into a firestorm document reference. Serializes our representation of a timestamp to firestores. Serializes our representation of a geopoint into a firestorm geopoint; Serializes an firestorm object into a firestore object;

    Parameters

    • isArray: boolean

      Is the field an array.

    • value: IGeoPoint | IGeoPoint[]

      The firestore geopoint(s) representation.

    Returns GeoPoint | GeoPoint[]

  • Deserializes a firestore document reference into a firestorm document reference. Serializes our representation of a timestamp to firestores. Serializes our representation of a geopoint into a firestorm geopoint; Serializes an firestorm object into a firestore object;

    Parameters

    • isArray: boolean

      Is the field an array.

    • value: Record<string, any> | Record<string, any>[]

      The firestore geopoint(s) representation.

    • fields: Map<string, IFieldMeta>

      The registered fields of the object.

    • writeType: WriteTypes

      Whether the write is a create or update.

    Returns Record<string, any> | Record<string, any>

Const toData

  • Converts a document reference into a human-readable format. If the document ref's data has been fetched, include the data, otherwise skip it. Converts a firestorm timestamp into a string representation. Converts our firestorm representation of geopoint to human-readable format. Converts our object to human-readable format.

    Parameters

    Returns Record<string, any> | Record<string, any>[] | undefined

  • Converts a document reference into a human-readable format. If the document ref's data has been fetched, include the data, otherwise skip it. Converts a firestorm timestamp into a string representation. Converts our firestorm representation of geopoint to human-readable format. Converts our object to human-readable format.

    Parameters

    • isArray: boolean

      Is the field an array.

    • format: function

      A custom formatter for the date value.

        • (date: Date): string
        • Parameters

          • date: Date

          Returns string

    • value: Timestamp | Timestamp[]

      Our document ref(s) to convert.

    Returns string | string[]

  • Converts a document reference into a human-readable format. If the document ref's data has been fetched, include the data, otherwise skip it. Converts a firestorm timestamp into a string representation. Converts our firestorm representation of geopoint to human-readable format. Converts our object to human-readable format.

    Parameters

    • isArray: boolean

      Is the field an array.

    • value: IGeoPoint | IGeoPoint[]

      Our document ref(s) to convert.

    Returns GeoPointData | GeoPointData[]

  • Converts a document reference into a human-readable format. If the document ref's data has been fetched, include the data, otherwise skip it. Converts a firestorm timestamp into a string representation. Converts our firestorm representation of geopoint to human-readable format. Converts our object to human-readable format.

    Parameters

    • isArray: boolean

      Is the field an array.

    • value: Record<string, any> | Record<string, any>[]

      Our document ref(s) to convert.

    • fields: Map<string, IFieldMeta>

      The registered fields of the object.

    Returns FirestormData | FirestormData[]

Object literals

Let store

store: object

repositories

repositories: Map<string, IRepository> = new Map<string, IRepository>()

config

config: object

fieldConversion

fieldConversion: NoConversion = FieldConversionType.NoConversion

Generated using TypeDoc