Skip to content

Commit

Permalink
fix: typescript declarations
Browse files Browse the repository at this point in the history
  • Loading branch information
pranjal-jain committed Jan 30, 2020
1 parent a8fd663 commit 97460e4
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 4 deletions.
6 changes: 3 additions & 3 deletions src/Query/index.d.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
declare module '@nozbe/watermelondb/Query' {
import { Collection, ColumnName, Model, TableName, RawRecord } from '@nozbe/watermelondb'
import { Collection, ColumnName, Model, TableName, RecordState } from '@nozbe/watermelondb'
import { AssociationInfo } from '@nozbe/watermelondb/Model'
import { Condition, QueryDescription } from '@nozbe/watermelondb/QueryDescription'
import { Observable } from 'rxjs'
Expand All @@ -22,13 +22,13 @@ declare module '@nozbe/watermelondb/Query' {

public fetch(): Promise<Record[]>

public experimentalFetchColumns(rawFields: ColumnName[]): Promise<RawRecord[]>
public experimentalFetchColumns(rawFields: ColumnName[]): Promise<RecordState[]>

public observe(): Observable<Record[]>

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

public experimentalObserveColumns(rawFields: ColumnName[]): Observable<RawRecord[]>
public experimentalObserveColumns(rawFields: ColumnName[]): Observable<RecordState[]>

public fetchCount(): Promise<number>

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

export interface RecordState {
id: string
[k: string]: any
}

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

export function setRawSanitized(
Expand Down
2 changes: 1 addition & 1 deletion src/index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ declare module '@nozbe/watermelondb' {
export { tableName, columnName, appSchema, tableSchema } from '@nozbe/watermelondb/Schema'

export { DatabaseAdapter } from '@nozbe/watermelondb/adapters/type'
export { RawRecord, DirtyRaw } from '@nozbe/watermelondb/RawRecord'
export { RawRecord, DirtyRaw, RecordState } from '@nozbe/watermelondb/RawRecord'
export { RecordId } from '@nozbe/watermelondb/Model'
export {
TableName,
Expand Down

0 comments on commit 97460e4

Please sign in to comment.