Skip to content

Commit

Permalink
v3.0.0-alpha.10
Browse files Browse the repository at this point in the history
* fix(createFirebaseInstance): merge internals on instance recreation - #174 - @gotdibbs
* fix(typings): updated TypeScript typings including use of Dictionary - @rscotten
  • Loading branch information
prescottprue authored Feb 24, 2019
2 parents 664cc8e + a851897 commit 331e9d8
Show file tree
Hide file tree
Showing 4 changed files with 84 additions and 228 deletions.
28 changes: 14 additions & 14 deletions index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -617,31 +617,33 @@ export interface Listeners {
}
}

export type TypeWithId<T> = T & { id: string }

export interface Ordered<T extends FirestoreTypes.DocumentData> {
[collection: string]: (T & { id: string })[]
[collection: string]: TypeWithId<T>[]
}

export interface Dictionary<T> {
[documentId: string]: T
}

export interface Data<T extends FirestoreTypes.DocumentData> {
[collection: string]: Dictionary<T>
[collection: string]: T
}

export namespace FirebaseReducer {
export interface Reducer<ProfileType = {}> {
auth: Auth
profile: Profile<ProfileType>
authError: any
data: Data<any>
data: Data<any | Dictionary<any>>
ordered: Ordered<any>
errors: any[]
isInitializing: boolean
listeners: Listeners
requested: {}
requesting: {}
timestamps: {}
requested: Dictionary<boolean>
requesting: Dictionary<boolean>
timestamps: Dictionary<number>
}

export interface Auth extends AuthTypes.UserInfo {
Expand Down Expand Up @@ -677,21 +679,19 @@ export namespace FirebaseReducer {

export namespace FirestoreReducer {
export interface Reducer {
composite?: Data<any>
data: {
[collection: string]: any | Dictionary<any>
}
composite?: Data<any | Dictionary<any>>
data: Data<any | Dictionary<any>>
errors: {
allIds: string[]
byQuery: any[]
}
listeners: Listeners
ordered: Ordered<any>
queries: any
queries: Data<FirestoreQueryOptions & (Dictionary<any> | any)>
status: {
requested: {}
requesting: {}
timestamps: {}
requested: Dictionary<boolean>
requesting: Dictionary<boolean>
timestamps: Dictionary<number>
}
}

Expand Down
Loading

0 comments on commit 331e9d8

Please sign in to comment.