import * as core from '../core'; import { Diff } from '../core'; export declare type Property = { set: (target?: object, key?: string, value?: any, description?: core.Descriptor, root?: object, parentObservable?: object, path?: string[]) => { didChange: boolean; result: boolean; }; get: (target?: object, key?: string, description?: core.Descriptor, root?: object, proxy?: object) => any; }; export interface IVirtualMethodFactoryArgs { proxy: object; root: object; key: string; } export declare const virtualCollectionMethods: { getSnapshot({proxy}: IVirtualMethodFactoryArgs): (options?: { asString?: boolean; asJSON?: boolean; }) => any; applySnapshot({root, proxy, key}: { root: any; proxy: any; key: any; }): (...args: any[]) => any; applyDiffs({root, proxy, key}: { root: any; proxy: any; key: any; }): (...args: any[]) => any; use({proxy}: { proxy: any; }): (middleware: (next: () => { diff: Diff[]; returnValue: any; }, action: { args: any[]; path: string[]; }) => void) => { remove: () => void; }; }; export declare const virtualObjectMethods: { getSnapshot({proxy}: IVirtualMethodFactoryArgs): (options?: { asString?: boolean; asJSON?: boolean; }) => any; applySnapshot({root, proxy, key}: { root: any; proxy: any; key: any; }): (...args: any[]) => any; applyDiffs({root, proxy, key}: { root: any; proxy: any; key: any; }): (...args: any[]) => any; use({proxy}: { proxy: any; }): (middleware: (next: () => { diff: Diff[]; returnValue: any; }, action: { args: any[]; path: string[]; }) => void) => { remove: () => void; }; getRoot({root}: IVirtualMethodFactoryArgs): () => object; }; /** * Test an object to see if it's an observable * @param object The object in question */ export declare function isObservable(object: any): any; /** * Returns whether or not this key is the special OBSERVABLE_DESIGNATOR key * @param key The key that you are testing */ export declare function isObservableDesignatorKey(key: any): boolean; export declare function isParentDesignatorKey(key: any): boolean; export declare function isPathDesignatorKey(key: any): boolean; export declare function getParent(observable: any): any; export declare function getPath(observable: any): any; /** * Sets a property on an object * @param target The target you are setting the property on * @param key The key of the property you are setting * @param value The value you are setting * @param description A description of this property key * @param root The root of the state tree */ export declare function setProperty(target: any, key: any, value: any, description: core.Descriptor, root: any, parentObservable: any, path: string[]): boolean; /** * Mark this computation and all of it's parent computations as stale and setup the reactions to * trigger */ export declare function markObservablesComputationsAsStale(target: any, key: any): void; /** * Get property */ export declare function getProperty(target: any, key: any, description: core.Descriptor, root: any, proxy: any): any; /** * Registers a reaction with an observable so when the observable is mutated it * can know to trigger this reaction. */ export declare function addReactionToObservable(object: any, key: string, reactionId: symbol, roundAdded: number): void; export declare function addComputationToObservable(object: any, key: string, computation: core.Computation): void; /** * Returns all reactions attached to specified observable. */ export declare function getReactionsOfObservable(object: any, key: string): { reactionId: symbol; roundAdded: number; }[]; /** * Removes the reaction from the observable's collections of reactions. */ export declare function removeReactionFromObservable(object: object, key: string, reactionId: symbol): void; export declare function removeComputationFromObservable(object: object, key: string, computationId: symbol): void;