import { z } from 'zod';
/**
 * `deviceState` — generic, cap-agnostic surface for cross-process
 * access to per-device runtime state. Read pendant for every cap's
 * runtime-state slice + the canonical write entrypoint. Mirrors the
 * in-process `BaseDevice.runtimeState` API:
 *
 *   - `getSnapshot({deviceId})` → full `Record<capName, slice>`.
 *   - `getCapSlice({deviceId, capName})` → one slice.
 *   - `setCapSlice({deviceId, capName, slice})` → unified single-slice
 *     write. Hub validates (when a cap schema is registered),
 *     persists to disk (debounced), updates the mirror, and emits
 *     `onChanged` for that cap.
 *   - `onChanged` event → fires on every slice change.
 *
 * Drivers don't implement this cap directly — the kernel auto-mounts
 * a singleton provider against `device-manager`'s in-hub mirror.
 * Every `setCapState` call on a `BaseDevice.runtimeState` ultimately
 * routes through `setCapSlice` (single cross-layer entrypoint) so
 * UIs / addons subscribe to a single event channel for every
 * cap-state change; per-cap events (`battery.onStatusChanged`, …)
 * remain available for typed consumers but no longer have to be
 * defined on every new cap with runtime state.
 */
export declare const deviceStateCapability: {
    readonly name: "device-state";
    readonly scope: "system";
    readonly mode: "singleton";
    readonly methods: {
        /** Full state snapshot for one device. Empty object if no
         *  cap-keyed slice has been written yet. */
        readonly getSnapshot: import("./capability-definition.js").CapabilityMethodSchema<z.ZodObject<{
            deviceId: z.ZodNumber;
        }, z.core.$strip>, z.ZodRecord<z.ZodString, z.ZodRecord<z.ZodString, z.ZodUnknown>>, import("./capability-definition.js").CapabilityMethodKind>;
        /** Single cap slice. Returns null when the slice hasn't been
         *  written or the device isn't registered. */
        readonly getCapSlice: import("./capability-definition.js").CapabilityMethodSchema<z.ZodObject<{
            deviceId: z.ZodNumber;
            capName: z.ZodString;
        }, z.core.$strip>, z.ZodNullable<z.ZodRecord<z.ZodString, z.ZodUnknown>>, import("./capability-definition.js").CapabilityMethodKind>;
        /**
         * Whole-system snapshot — every device's full state in one
         * payload. Used by `SystemManager` for warm-boot: a single
         * round-trip populates the client mirror so every subsequent
         * `sm.getDeviceById(id).state.<cap>.value` is sync. Empty inner
         * record for devices that haven't emitted any slice yet.
         */
        readonly getAllSnapshots: import("./capability-definition.js").CapabilityMethodSchema<z.ZodObject<{}, z.core.$strip>, z.ZodRecord<z.ZodString, z.ZodRecord<z.ZodString, z.ZodRecord<z.ZodString, z.ZodUnknown>>>, import("./capability-definition.js").CapabilityMethodKind>;
        /**
         * Canonical cross-layer WRITE for one cap-keyed slice. Used by
         * everyone who needs to publish runtime state for a device:
         * device providers (via `BaseDevice.runtimeState.setCapState`
         * which delegates here), system-scope addons (e.g. the pipeline
         * runner writing the `motion` slice on phase transitions), and
         * direct cap-router callers in tests.
         *
         * Behavior on the hub:
         *   1. Resolve the device — throws if unknown.
         *   2. Diff the slice against the current mirror (no-op on
         *      identical writes — saves disk and event churn).
         *   3. Update the mirror in place.
         *   4. Persist the full per-device blob to disk (debounced).
         *   5. Emit `onChanged` for this cap so subscribers (UI mirror,
         *      SystemManager, per-cap typed listeners) refresh.
         *
         * Schema validation is the caller's responsibility — callers
         * going through `BaseDevice.runtimeState.setCapState` get the
         * cap's `runtimeState` schema enforced in-process before the
         * write reaches here. Direct callers should validate against
         * the cap's schema themselves.
         *
         * No `patch` variant — for shallow merges read the slice via
         * `getCapSlice` first, merge, and write. The single-writer
         * conventions on each cap make atomic-merge semantics
         * unnecessary in practice.
         */
        readonly setCapSlice: import("./capability-definition.js").CapabilityMethodSchema<z.ZodObject<{
            deviceId: z.ZodNumber;
            capName: z.ZodString;
            slice: z.ZodRecord<z.ZodString, z.ZodUnknown>;
        }, z.core.$strip>, z.ZodVoid, "mutation">;
    };
    readonly events: {
        /**
         * Fires whenever a cap-keyed slice changes. Per-event payload
         * carries the slice that changed — subscribers can render off
         * the payload alone without re-querying. Filterable by `deviceId`
         * via the standard `EventFilter` helpers.
         */
        readonly onChanged: import("./capability-definition.js").CapabilityEventSchema<z.ZodObject<{
            deviceId: z.ZodNumber;
            capName: z.ZodString;
            slice: z.ZodRecord<z.ZodString, z.ZodUnknown>;
        }, z.core.$strip>>;
    };
};
//# sourceMappingURL=device-state.cap.d.ts.map