import { i as flattenVariants, n as UnionSchema, r as UnionVariants, t as UnionMember } from "./union-schema-B-Lsy588.mjs"; import { i as useSlowLoading, n as LOADING_MIN_DURATION_MS, r as SlowLoadingOptions, t as LOADING_DELAY_MS } from "./use-slow-loading-D5q4M47N.mjs"; import { t as WeakRefMap } from "./weak-ref-map-DVc6VbJ3.mjs"; import { IAutorunOptions, IEqualsComparer, IObservableValue, IReactionPublic } from "mobx"; import { ClassAccessorDecorator } from "mobx/dist/types/decorator_fills"; //#region src/util/mutable.d.ts declare const mutable: ClassAccessorDecorator; //#endregion //#region src/util/use-autorun.d.ts declare function useAutorun(func: (r: IReactionPublic) => unknown, options?: IAutorunOptions): void; //#endregion //#region src/util/use-observable-box.d.ts interface UseObservableBoxOptions { /** * How a new value is judged against the one held. Defaults to `comparer.shallow`, which is what * makes an object rebuilt on every render — `{ orgId, query }` — count as unchanged while its * fields are. Pass `comparer.structural` for values nested deeper than a field, or * `comparer.default` to write on every render that isn't referentially equal. */ equals?: IEqualsComparer; } /** * Mirror a plain React value into an observable box, so mobx code can react to it. * * React state isn't observable, which leaves a gap wherever the two meet: a `reaction`, an * `autorun`, a `computed`, or a lazy observable's `trackDependencies` can't see a value that lives * in `useState` or arrives as a prop. This closes it — `useState` stays where it is, and mobx gets * something to watch: * * ```tsx * const [query, setQuery] = useState(""); * const params = useObservableBox({ orgId, query }); * * // ...anywhere mobx is watching: * useAutorun(() => console.log(params.get().query)); * ``` * * The flow is one-way: the box mirrors the value, so writing to it from mobx's side holds only * until the next render whose value disagrees. Keep the value where React already keeps it. * * The box is created once and kept for the component's lifetime, so a reaction holding it stays * valid across renders. Two details it settles that are easy to get wrong by hand: the write * happens in an effect rather than during render, so the render itself stays free of side effects; * and values are compared rather than assigned blindly, so the object literal you rebuild every * render doesn't retrigger every reaction that reads it. */ declare function useObservableBox(value: T, options?: UseObservableBoxOptions): IObservableValue; //#endregion export { LOADING_DELAY_MS, LOADING_MIN_DURATION_MS, SlowLoadingOptions, UnionMember, UnionSchema, UnionVariants, UseObservableBoxOptions, WeakRefMap, flattenVariants, mutable, useAutorun, useObservableBox, useSlowLoading }; //# sourceMappingURL=util.d.mts.map