firebase-tools-extra
Version:
Extra functionality for firebase-tools with support for emulators and auth through service account.
46 lines (45 loc) • 1.43 kB
TypeScript
export declare type RTDBWriteAction = 'set' | 'push' | 'update';
/**
* Methods that are applicable on an RTDB ref for a get action
*/
export interface RTDBQueryMethods {
orderBy?: string;
orderByKey?: string;
orderByValue?: string;
equalTo?: any;
startAt?: any;
endAt?: any;
limitToFirst?: number;
limitToLast?: number;
}
/**
* Options for RTDB get action
*/
export interface RTDBGetOptions extends RTDBQueryMethods {
shallow?: boolean;
pretty?: boolean;
output?: boolean;
emulator?: boolean;
debug?: boolean;
}
/**
* Write data to path of Real Time Database
* @param actionPath - Pat of get
* @param options - Get options object
*/
export declare function rtdbGet(actionPath: string, options?: RTDBGetOptions): Promise<any>;
/**
* Write data to path of Real Time Database. Also works with server timestamps
* passed as {.sv: "timestamp"}.
* @param action - Write action to run
* @param actionPath - Path of action
* @param filePath - Path of file to write to RTDB
* @param options - Options
*/
export declare function rtdbWrite(action: "push" | "update" | "set" | undefined, actionPath: string, filePath?: string, options?: any): Promise<any>;
/**
* Remove data from path of Real Time Database
* @param actionPath - Path to remove from database
* @param options - Options
*/
export declare function rtdbRemove(actionPath: string, options?: any): Promise<void>;