Skip to content

Commit

Permalink
fix: typing of RecordState
Browse files Browse the repository at this point in the history
  • Loading branch information
pranjal-jain committed Feb 1, 2020
1 parent 7eaabf0 commit 8786d99
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 6 deletions.
4 changes: 2 additions & 2 deletions src/Query/index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -22,13 +22,13 @@ declare module '@nozbe/watermelondb/Query' {

public fetch(): Promise<Record[]>

public experimentalFetchColumns(rawFields: ColumnName[]): Promise<RecordState[]>
public experimentalFetchColumns<T>(rawFields: Array<keyof T>): Promise<RecordState<T>[]>

public observe(): Observable<Record[]>

public observeWithColumns(rawFields: ColumnName[]): Observable<Record[]>

public experimentalObserveColumns(rawFields: ColumnName[]): Observable<RecordState[]>
public experimentalObserveColumns<T>(rawFields: Array<keyof T>): Observable<RecordState<T>[]>

public fetchCount(): Promise<number>

Expand Down
5 changes: 1 addition & 4 deletions src/RawRecord/index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,7 @@ declare module '@nozbe/watermelondb/RawRecord' {
last_modified: number | null
}

export interface RecordState {
id: string
[k: string]: any
}
export type RecordState<T> = T & Record<"id", string>

export function sanitizedRaw(dirtyRaw: DirtyRaw, tableSchema: TableSchema): RawRecord

Expand Down

0 comments on commit 8786d99

Please sign in to comment.