/** * Whether two controller configurations say the same thing. * * A widget controller is built from a configuration object, and a host that rebuilds the controller * whenever that object's *identity* changes rebuilds it on every render — because writing the * configuration at the call is what an argument that is an object literal invites. The controller * then resubscribes, the subscription publishes, and the render that follows writes another literal. * * So identity is the wrong question and contents are the right one. The comparison is deliberately * shallow, with one step inside a list: an option list written at the call carries fresh option * objects every render, and those are the lists this exists for. Deeper than that a configuration * does not go, and a comparison that walked an arbitrary value would cost more than the rebuild it * saves. * * Functions compare by identity, which is right: a handler written at the call is a different * handler, and treating two of them as one would keep a controller wired to the render that made it. */ /** * True when `next` describes the same controller as `held`. * * `undefined` on either side is a configuration a host has not built yet, and two of those are the * same one. */ export declare function sameControllerOptions(held: unknown, next: unknown): boolean; /** * The configuration's members that can be compared at all. * * A handler written at the call is a new function every render, so comparing one by identity defeats * the comparison entirely — the functions are answered by {@link stableControllerOptions} instead, * and what is compared is everything else. */ export declare function comparableControllerOptions(options: unknown): unknown; /** * The same configuration with one stable function per handler, each calling the latest one given. * * A controller keeps the handler it was built with, and a host that rebuilt the controller whenever * a handler's identity changed rebuilt it on every render. `latest` is read at call time, so the * handler the controller holds is never the one from a render that has passed. */ export declare function stableControllerOptions(options: T, latest: () => T): T;