Skip to content

Commit a4fc956

Browse files
committed
type updates
1 parent 9edbe50 commit a4fc956

File tree

1 file changed

+13
-16
lines changed

1 file changed

+13
-16
lines changed

index.d.ts

Lines changed: 13 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -462,12 +462,12 @@ export function firebaseConnect<ProfileType, TInner = {}>(
462462
*/
463463
export function firebaseReducer<UserType>(
464464
...args: any[]
465-
): firebaseReducer.Reducer<UserType>
465+
): FirebaseReducer.Reducer<UserType>
466466

467467
/**
468468
* Reducer for Firebase state
469469
*/
470-
export function firebaseStateReducer(...args: any[]): firestoreReducer.Reducer
470+
export function firebaseStateReducer(...args: any[]): FirestoreReducer.Reducer
471471

472472
/**
473473
* React HOC that attaches/detaches Cloud Firestore listeners on mount/unmount
@@ -485,7 +485,7 @@ export function firestoreConnect<TInner = {}>(
485485
/**
486486
* Reducer for Firestore state
487487
*/
488-
export function firestoreReducer(...args: any[]): any
488+
export function firestoreReducer(...args: any[]): FirestoreReducer.Reducer
489489

490490
export function fixPath(path: string): string
491491

@@ -605,7 +605,7 @@ export namespace createWithFirestore {
605605

606606
// Your Firebase/Firestore user profile object type
607607
// http://docs.react-redux-firebase.com/history/v3.0.0/docs/recipes/profile.html
608-
export type ProfileType = object
608+
export type ProfileType = {}
609609

610610
export interface Listeners {
611611
allIds: string[]
@@ -626,11 +626,10 @@ export interface Data {
626626
}
627627
}
628628

629-
export namespace firebaseReducer {
630-
export interface Reducer<ProfileType> {
629+
export namespace FirebaseReducer {
630+
export interface Reducer<ProfileType = {}> {
631631
auth: Auth
632-
profile: ProfileType
633-
// profile: Profile
632+
profile: Profile<ProfileType>
634633
authError: any
635634
data: Data
636635
errors: any[]
@@ -663,19 +662,17 @@ export namespace firebaseReducer {
663662
}
664663

665664
// can be extended for optional properties from your database
666-
export interface Profile {
665+
export type Profile<ProfileType> = {
667666
isLoaded: boolean
668667
isEmpty: boolean
669-
}
670-
671-
const prototype: {}
672-
}
668+
} & ProfileType
673669

674-
export namespace firebaseStateReducer {
675-
const prototype: {}
670+
export namespace firebaseStateReducer {
671+
const prototype: {}
672+
}
676673
}
677674

678-
export namespace firestoreReducer {
675+
export namespace FirestoreReducer {
679676
export interface Reducer {
680677
composite: any
681678
data: {}

0 commit comments

Comments
 (0)