UNPKG

559 BPlain TextView Raw
1import {makeOptionsDecorator, IModel,MetadataPropertyDecoratorFactory} from 'typestore'
2import {IndexedDBFinderKey} from "./IndexedDBConstants";
3import {IndexedDBRepoPlugin} from './IndexedDBRepoPlugin'
4
5export type IndexedDBFinderFn = <M extends IModel>(repo:IndexedDBRepoPlugin<M>, ...args:any[]) => Promise<M[]>
6
7export interface IIndexedDBFinderOptions {
8 fn?:IndexedDBFinderFn
9 singleResult?:boolean
10 filter?: (o:any,...args:any[]) => boolean
11}
12
13export const IndexedDBFinderDescriptor =
14 makeOptionsDecorator<IIndexedDBFinderOptions>(IndexedDBFinderKey)