@typeheim/orm-on-fire
Version:
Firestore ORM
28 lines (27 loc) • 897 B
TypeScript
import { TextTriggerConfig } from './Contracts';
export declare class TextIndexGenerator {
buildMetadata(config: TextTriggerConfig, change: Change<DocumentSnapshot>): {};
generateIndex(data: any, fields: string[]): {};
protected createTextIndex(text: string): string[];
protected createReverseTextIndex(text: string): string[];
}
interface Change<T> {
before: T;
after: T;
}
interface DocumentSnapshot<T = any> {
/** True if the document exists. */
readonly exists: boolean;
/**
* The ID of the document for which this `DocumentSnapshot` contains data.
*/
readonly id: string;
/**
* Retrieves all fields in the document as an Object. Returns 'undefined' if
* the document doesn't exist.
*
* @return An Object containing all fields in the document.
*/
data(): T | undefined;
}
export {};