memory-orm
Version:
client side ORM + map reduce
33 lines (32 loc) • 1.5 kB
TypeScript
import { Query } from './query'
import { Finder } from './finder'
import { CLASS, DATA, NameBase, DEFAULT_RULE_TYPE } from './type'
export declare class Set<A extends DEFAULT_RULE_TYPE> {
static $name: NameBase
$name: NameBase
all: Query<A>
finder: Finder<A>
model: CLASS<A[0]>
constructor({ $name, all, model }: { $name: any; all: any; model: any })
set: (this: Set<A>, list: DATA<A[0]>, parent?: Object | undefined) => void
reset: (this: Set<A>, list: DATA<A[0]>, parent?: Object | undefined) => void
merge: (this: Set<A>, list: DATA<A[0]>, parent?: Object | undefined) => void
add: (this: Set<A>, item: Partial<A[0]>, parent?: Object | undefined) => void
append: (this: Set<A>, item: Partial<A[0]>, parent?: Object | undefined) => void
reject: (this: Set<A>, list: DATA<A[0]>, parent?: Object | undefined) => void
del: (this: Set<A>, item: Partial<A[0]>, parent?: Object | undefined) => void
remove: (this: Set<A>, item: Partial<A[0]>, parent?: Object | undefined) => void
updates: typeof f_update
update: (this: Set<A>, item: Partial<A[0]>, parent?: Object | undefined) => void
clear_cache: typeof f_clear
refresh: typeof f_clear
rehash: typeof f_clear
find(...ids: string[]): import('./model').Model | import('./struct').Struct | null
}
declare function f_update<A extends DEFAULT_RULE_TYPE>(
this: Set<A>,
list: DATA<A[0]>,
parent: Object
): void
declare function f_clear<A extends DEFAULT_RULE_TYPE>(this: Set<A>, is_hit?: boolean): void
export {}