UNPKG

@web-atoms/core

Version:
29 lines 1.48 kB
import { IDisposable } from "./types"; export declare const symbolHandlers: unique symbol; export declare const symbolBindable: unique symbol; export type WatchFunction = (target: any, key: string, index?: number, item?: any, oldItem?: any) => void; export interface IWatchFunctionCollection { [key: string]: WatchFunction[]; } export interface IWatchableObject { [symbolHandlers]?: IWatchFunctionCollection; [symbolBindable]?: { [key: string]: 0 | 1; }; } export declare class AtomBinder { static refreshValue(target: any, key: any): void; static add_WatchHandler(target: any, key: any, handler: WatchFunction): void; static getPropertyDescriptor(target: any, key: string): PropertyDescriptor; static get_WatchHandler(target: IWatchableObject, key: string): WatchFunction[]; static remove_WatchHandler(target: IWatchableObject, key: string, handler: WatchFunction): void; static invokeItemsEvent(target: any[], mode: string, index: number, item: any, oldItem?: any): void; static refreshItems(ary: any): void; static add_CollectionChanged(target: any[], handler: WatchFunction): IDisposable; static remove_CollectionChanged(t: any[], handler: WatchFunction): void; static watch(item: any, property: string, f: WatchFunction): IDisposable; static clear(a: any[]): any; static addItem(a: any[], item: any): any; static removeItem(a: any[], item: any): boolean; } //# sourceMappingURL=AtomBinder.d.ts.map