declare module '@rikishi/watermelondb/Model' { import { Collection, CollectionMap, ColumnName, Database, RawRecord, TableName, } from '@rikishi/watermelondb' import { Observable } from 'rxjs' export type RecordId = string export type SyncStatus = 'synced' | 'created' | 'updated' | 'deleted' export interface BelongsToAssociation { type: 'belongs_to' key: ColumnName } export interface HasManyAssociation { type: 'has_many' foreignKey: ColumnName } export type AssociationInfo = BelongsToAssociation | HasManyAssociation export interface Associations { [tableName: string]: AssociationInfo } export function associations( ...associationList: Array<[TableName, AssociationInfo]> ): Associations export default class Model { // FIXME: How to correctly point to a static this? public static table: TableName public static associations: Associations public _raw: RawRecord public id: RecordId public syncStatus: SyncStatus public update(recordUpdater?: (record: this) => void): Promise public prepareUpdate(recordUpdater?: (record: this) => void): this public markAsDeleted(): Promise public destroyPermanently(): Promise public experimentalMarkAsDeleted(): Promise public experimentalDestroyPermanently(): Promise public prepareMarkAsDeleted(): this public prepareDestroyPermanently(): this public observe(): Observable public batch(...records: Readonly): Promise public subAction(action: () => Promise): Promise public callReader(action: () => Promise): Promise public callWriter(action: () => Promise): Promise public collection: Collection public collections: CollectionMap public database: Database public asModel: this } }