import { Binding } from "./Binding"; import { AccessorChain } from "./createAccessorModelProxy"; import { Ref } from "./Ref"; type Path = string | Binding; export interface ViewConfig { store?: View; immutable?: boolean; sealed?: boolean; } export interface ViewMethods> { getData(): D; init(path: Path, value: unknown): boolean; init(path: AccessorChain, value: V): boolean; init>(initObject: T): boolean; set(path: Path, value: any): boolean; set>(changes: T): boolean; set(path: AccessorChain, value: V): boolean; get(path: Path): any; get(paths: Path[]): any[]; get(...paths: Path[]): any[]; get(path: AccessorChain): V; get(...paths: { [K in keyof T]: AccessorChain; }): T; get(paths: { [K in keyof T]: AccessorChain; }): T; /** * Removes data from the Store. * @param paths - One or more paths to be deleted. * @return {boolean} */ delete(path: Path): boolean; delete(paths: Path[]): boolean; delete(...paths: Path[]): boolean; delete(path: AccessorChain): boolean; delete(...paths: { [K in keyof T]: AccessorChain; }): boolean; delete(paths: { [K in keyof T]: AccessorChain; }): boolean; toggle(path: Path): boolean; toggle(path: AccessorChain): boolean; update(path: AccessorChain, updateFn: (currentValue: V) => V): boolean; update(path: AccessorChain, updateFn: (currentValue: V, ...args: A) => V, ...args: A): boolean; update(updateFn: (currentValue: D, ...args: A) => D, ...args: any): boolean; update(path: Path, updateFn: (currentValue: any, ...args: A) => any, ...args: A): boolean; /** * Mutates the content of the store using Immer */ mutate(updateFn: (currentValue: D, ...args: any[]) => void, ...args: any[]): boolean; mutate(path: Path, updateFn: (currentValue: any, ...args: A) => void, ...args: A): boolean; mutate(path: AccessorChain, updateFn: (currentValue: V, ...args: A) => void, ...args: A): boolean; ref(path: string | AccessorChain, defaultValue?: T): Ref; } export declare class View implements ViewMethods { store?: View; meta: any; sealed: boolean; cache: { version: number; data?: any; result?: any; itemIndex?: number; key?: string; }; notificationsSuspended: number; dirty: boolean; constructor(config?: ViewConfig); getData(): D; init(path: Path, value: unknown): boolean; init(path: AccessorChain, value: V): boolean; init>(initObject: T): boolean; set(path: Path, value: any): boolean; set>(changes: T): boolean; set(path: AccessorChain, value: V): boolean; copy(from: Path, to: Path): boolean; copy(from: AccessorChain, to: AccessorChain): boolean; move(from: Path, to: Path): boolean; move(from: AccessorChain, to: AccessorChain): boolean; setItem(path: string, value: any): boolean; delete(path: Path): boolean; delete(paths: Path[]): boolean; delete(...paths: Path[]): boolean; delete(path: AccessorChain): boolean; delete(...paths: { [K in keyof T]: AccessorChain; }): boolean; delete(paths: { [K in keyof T]: AccessorChain; }): boolean; deleteItem(path: string): boolean; clear(): void; get(path: Path): any; get(paths: Path[]): any[]; get(...paths: Path[]): any[]; get(path: AccessorChain): V; get(...paths: { [K in keyof T]: AccessorChain; }): T; get(paths: { [K in keyof T]: AccessorChain; }): T; toggle(path: Path): boolean; toggle(path: AccessorChain): boolean; update(path: AccessorChain, updateFn: (currentValue: V) => V): boolean; update(path: AccessorChain, updateFn: (currentValue: V, ...args: A) => V, ...args: A): boolean; update(updateFn: (currentValue: D, ...args: any[]) => any, ...args: any): boolean; update(path: Path, updateFn: (currentValue: any, ...args: A) => any, ...args: A): boolean; mutate(updateFn: (currentValue: D, ...args: any[]) => void, ...args: any[]): boolean; mutate(path: Path, updateFn: (currentValue: any, ...args: A) => void, ...args: A): boolean; mutate(path: AccessorChain, updateFn: (currentValue: V, ...args: A) => void, ...args: A): boolean; batch(callback: (store?: View) => void): boolean; silently(callback: (store?: View) => void): boolean; notify(path?: string): void; doNotify(path?: string): void; subscribe(callback: (changes?: any) => void): () => void; load(data: Record): boolean; dispatch(action: any): void; getMeta(): any; setStore(store: View): void; ref(path: string | AccessorChain, defaultValue?: T): Ref; getMethods(): ViewMethods; } export {}; //# sourceMappingURL=View.d.ts.map