File tree Expand file tree Collapse file tree 4 files changed +45
-35
lines changed Expand file tree Collapse file tree 4 files changed +45
-35
lines changed Original file line number Diff line number Diff line change 1
1
// @flow
2
- import type { Auth, User } from 'firebase';
2
+ import type { FirebaseUser as User } from 'firebase';
3
+ import type { Auth } from 'firebase/auth';
3
4
export type AuthStateHook = {
4
- user?: User;
5
- initialising: boolean;
5
+ user?: User,
6
+ initialising: boolean,
6
7
};
7
8
declare export function useAuthState(auth: Auth): AuthStateHook;
Original file line number Diff line number Diff line change 2
2
import type { DataSnapshot, Query } from 'firebase/database';
3
3
4
4
export type ListHook = {
5
- error?: Object;
6
- loading: boolean;
7
- value: DataSnapshot[];
5
+ error?: Object,
6
+ loading: boolean,
7
+ value: DataSnapshot[],
8
8
};
9
9
export type ListKeysHook = {
10
- error?: Object;
11
- loading: boolean;
12
- value: string[];
10
+ error?: Object,
11
+ loading: boolean,
12
+ value: string[],
13
13
};
14
14
export type ListValsHook<T> = {
15
- error?: Object;
16
- loading: boolean;
17
- value: T[];
15
+ error?: Object,
16
+ loading: boolean,
17
+ value: T[],
18
18
};
19
19
export type ObjectHook = {
20
- error?: Object;
21
- loading: boolean;
22
- value?: DataSnapshot;
20
+ error?: Object,
21
+ loading: boolean,
22
+ value?: DataSnapshot,
23
23
};
24
24
export type ObjectValHook<T> = {
25
- error?: Object;
26
- loading: boolean;
27
- value?: T;
25
+ error?: Object,
26
+ loading: boolean,
27
+ value?: T,
28
28
};
29
29
30
- declare export function useList(query: Query): ListHook;
31
- declare export function useListKeys(query: Query): ListKeysHook;
32
- declare export function useListVals<T>(query: Query, keyField?: string): ListValsHook<T>;
33
- declare export function useObject(query: Query): ObjectHook;
34
- declare export function useObjectVal<T>(query: Query): ObjectValHook<T>;
30
+ declare export function useList(query?: Query | null): ListHook;
31
+ declare export function useListKeys(query?: Query | null): ListKeysHook;
32
+ declare export function useListVals<T>(
33
+ query?: Query | null,
34
+ keyField?: string
35
+ ): ListValsHook<T>;
36
+ declare export function useObject(query?: Query | null): ObjectHook;
37
+ declare export function useObjectVal<T>(query?: Query | null): ObjectValHook<T>;
Original file line number Diff line number Diff line change @@ -8,15 +8,21 @@ import type {
8
8
} from 'firebase/firestore';
9
9
10
10
export type CollectionHook = {
11
- error?: Object;
12
- loading: boolean;
13
- value?: firestore.QuerySnapshot;
11
+ error?: Object,
12
+ loading: boolean,
13
+ value?: firestore.QuerySnapshot,
14
14
};
15
15
export type DocumentHook = {
16
- error?: Object;
17
- loading: boolean;
18
- value?: firestore.DocumentSnapshot;
16
+ error?: Object,
17
+ loading: boolean,
18
+ value?: firestore.DocumentSnapshot,
19
19
};
20
20
21
- declare export function useCollection(query: Query, options?: SnapshotListenOptions): CollectionHook;
22
- declare export function useDocument(ref: firestore.DocumentReference, options?: SnapshotListenOptions): DocumentHook;
21
+ declare export function useCollection(
22
+ query?: Query | null,
23
+ options?: SnapshotListenOptions
24
+ ): CollectionHook;
25
+ declare export function useDocument(
26
+ ref?: DocumentReference | null,
27
+ options?: SnapshotListenOptions
28
+ ): DocumentHook;
Original file line number Diff line number Diff line change 2
2
import type { Reference } from 'firebase/storage';
3
3
4
4
export type DownloadURLHook = {
5
- error?: Object;
6
- loading: boolean;
7
- value?: string;
5
+ error?: Object,
6
+ loading: boolean,
7
+ value?: string,
8
8
};
9
- declare export function useDownloadURL(ref: Reference): DownloadURLHook;
9
+ declare export function useDownloadURL(ref? : Reference | null ): DownloadURLHook;
You can’t perform that action at this time.
0 commit comments