/** * This class provides an observable that tracks attributes at the top level. Similar to the meteor mini mongo: * When a new value is assigned, it changes only the attributes that are structurally different from the current * value. * * For example, if your value is * `{ title: 'foo', numbers:[1,2,3]}` * and you assign a new value * `{ title: 'bar', numbers:[1,2,3]}` * then only `title` will trigger a change. * * Why is this different from `@observable.shallow`? Observable shallow is used when we assign new values to the * top level attributes. But when we assign a new `value` to `@observable.shallow` then all attributes change. * * This wrapper checks for the structurally (not deep equal) changed attributes ond only modifies them. * * *Note*: The only supported way to change the object is by assigning new values using the `set` method! If a top level * value is assigned then it would also work. But modifying a child object or array has no effect in reactivity. * * So, the typical use is: when you get a new version of the object from the server, and you want to minimize the * reactions to attributes that have really changed. * * Given the following code where `data` gets new versions from a rest call or form a meteor subscription: * * class MyClass { * @observable // or @observable.struct * data: Data; * } * * When new data arrives you would make a call like `myObject.data = newData`, where `newData` is a full object with * all attributes. * * In this case the code can be replaced with this: * * class MyClass { * private _data = createShallowStructObservable(); * get data() { * return this._data; * } * set data(value) { * this._data.set(value) * } * } * */ interface ShallowStructObservable> { set(value: T | undefined): void; get(): T | undefined; } export declare function createShallowStructObservable(): ShallowStructObservable; export {};