import { Atom, AtomSource, ObservableSeed, Observer, Property, Scope, Subscribe, TypeBitfield, Desc, Unsub, AtomSeed } from "./abstractions"; import { ObservableBase, ObservableSeedImpl } from "./observable"; import * as L from "./lens"; import { StatefulProperty, PropertyBase } from "./property"; import { HKT } from "./hkt"; export declare class LensedAtom extends PropertyBase> implements Atom { [HKT]: Atom; observableType(): "Atom"; _L: TypeBitfield; private _root; private _lens; constructor(desc: Desc, root: Atom, view: L.Lens); get(): V; set(newValue: V): void; modify(fn: (old: V) => V): void; onChange(onValue: Observer, onEnd?: Observer): import("./abstractions").Callback; getScope(): Scope; applyScope(scope: Scope): Atom; } export declare class StatefulDependentAtom extends StatefulProperty> implements Atom { [HKT]: Atom; observableType(): "Atom"; _L: TypeBitfield; constructor(seed: ObservableSeed | Atom, Atom>, scope: Scope); set: (updatedValue: V) => void; modify(fn: (old: V) => V): void; applyScope(scope: Scope): Atom; } /** * Input source for a StatefulProperty. Returns initial value and supplies changes to observer. * Must skip duplicates! **/ export declare class AtomSeedImpl extends ObservableSeedImpl, Atom> { [HKT]: AtomSeed; observableType(): "AtomSeed"; _L: TypeBitfield; constructor(desc: Desc, get: () => V, subscribe: Subscribe, set: (updatedValue: V) => void); applyScope(scope: Scope): Atom; } /** * Input source for a StatefulProperty. Returns initial value and supplies changes to observer. * Must skip duplicates! **/ export declare class AtomSourceImpl extends ObservableBase> implements AtomSource { [HKT]: AtomSource; _L: TypeBitfield; observableType(): "AtomSource"; private _started; private _subscribed; private _get; onChange_: Subscribe; set: (updatedValue: V) => void; get(): V; constructor(desc: Desc, get: () => V, subscribe: Subscribe, set: (updatedValue: V) => void); onChange(onValue: Observer, onEnd?: Observer): Unsub; subscribe(onValue: Observer, onEnd?: Observer): Unsub; applyScope(scope: Scope): Atom; } export declare function atom(initial: A): Atom; /** * Create a dependent atom that reflects the value of the given Property. The `onChange` function * is supposed to eventually cause the `input` property to be updated to the new value. * * This constructor provides a bridge between atom-based components and "unidirectional data flow" * style state management. * * Note: unlike an independent atom, the dependent atom is lazy. This means that it will keep its * value up-to-date only if there is a subscriber to it or the underlying property. * * @param input Property to reflect * @param onChange Function to be called when `atom.set` is called */ export declare function atom(input: Property, onChange: (updatedValue: A) => void): Atom;