UNPKG

@mathrunet/masamune

Version:

Manages packages for the server portion (NodeJS) of the Masamune framework.

115 lines (114 loc) 3.54 kB
import * as admin from "firebase-admin"; /** * Create a filter for loading Firestore collections. * * Firestoreのコレクションをロードする際のフィルターを作成します。 * * @param query * Specifies a reference to a Firestore collection. * * Firestoreのコレクションのリファレンスを指定します。 * * @param wheres * Specifies the filter to be applied to the collection. * * コレクションに適用するフィルターを指定します。 * * @returns * Returns a Firestore query with the specified filter. * * 指定されたフィルターを持つFirestoreのクエリを返します。 */ export declare function where({ query, wheres, }: { query: admin.firestore.Query<admin.firestore.DocumentData, admin.firestore.DocumentData>; wheres: { [key: string]: any; }[] | undefined; }): admin.firestore.Query<admin.firestore.DocumentData, admin.firestore.DocumentData>; /** * Judges whether all the conditions in [conditons] match the document data in [data]. * * If a reference is included in [data], the document is retrieved recursively and the condition is determined. * * [data]のドキュメントデータに対して、[conditions]の条件が全て一致するかどうかを判定します。 * * [data]の中にリファレンスが含まれている場合、再帰的にドキュメントを取得し条件を判定します。 * * @param data * Target document data. * * 対象となるドキュメントデータ。 * * @param conditions * Conditions to be matched. * * 一致させる条件。 * * @returns * Returns true if all conditions match, false otherwise. * * 全ての条件が一致する場合はtrue、それ以外はfalseを返します。 */ export declare function hasMatch({ data, conditions, }: { data: { [key: string]: any; }; conditions: { [key: string]: any; }[] | undefined; }): Promise<boolean>; /** * Get the value of the specified field from the document data. * * ドキュメントデータから指定されたフィールドの値を取得します。 * * @param data * Target document data. * * 対象となるドキュメントデータ。 * * @param field * Specifies the field to be retrieved. * * 取得するフィールドを指定します。 * * @returns * Returns the value of the specified field. * * 指定されたフィールドの値を返します。 */ export declare function get({ data, field, }: { data: { [key: string]: any; }; field: { [key: string]: any; } | string; }): Promise<any>; /** * Get [limit] documents from [cursor]. * * [cursor]から[limit]個のドキュメントを取得します。 * * @param query * Specifies a reference to a Firestore collection. * * Firestoreのコレクションのリファレンスを指定します。 * * @param limit * Specifies the number of documents to be retrieved. * * 取得するドキュメントの数を指定します。 * * @param cursor * Specifies the document to start retrieving from. * * 取得を開始するドキュメントを指定します。 * * @returns */ export declare function cursor({ query, limit, cursor, }: { query: admin.firestore.Query<admin.firestore.DocumentData, admin.firestore.DocumentData>; limit: number; cursor: FirebaseFirestore.QueryDocumentSnapshot | undefined | null; }): admin.firestore.Query<admin.firestore.DocumentData, admin.firestore.DocumentData>;