-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathfiresql.d.ts
35 lines (35 loc) · 1.31 KB
/
firesql.d.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
import firebase from 'firebase/app';
import 'firebase/firestore';
import { FireSQLOptions, QueryOptions } from './shared';
import { DocumentData } from './utils';
export declare class FireSQL {
private _options;
private _ref;
constructor(ref: FirestoreOrDocument, _options?: FireSQLOptions);
get ref(): firebase.firestore.DocumentReference;
get firestore(): firebase.firestore.Firestore;
get options(): FireSQLOptions;
query(sql: string, options?: QueryOptions): Promise<DocumentData[]>;
query<T>(sql: string, options?: QueryOptions): Promise<T[]>;
toJSON(): object;
}
export declare type FirestoreOrDocument = firebase.firestore.Firestore | firebase.firestore.DocumentReference | AdminFirestore | AdminDocumentReference;
/**
* An interface representing the basics we need from the
* admin.firestore.Firestore class.
* We use it like this to avoid having to require "firebase-admin".
*/
interface AdminFirestore {
collection(collectionPath: string): any;
doc(documentPath: string): any;
}
/**
* An interface representing the basics we need from the
* admin.firestore.DocumentReference class.
* We use it like this to avoid having to require "firebase-admin".
*/
interface AdminDocumentReference {
collection(collectionPath: string): any;
get(options?: any): Promise<any>;
}
export {};