import { z } from 'zod';
import { type InferProvider, type InferNativeProvider } from './capability-definition.js';
import { DeviceType } from '../device/device-type.js';
/**
 * device-discovery — device-scoped capability for parents that host /
 * enumerate child devices (Reolink Hub / NVR, ONVIF gateway, future
 * integrations). Mirrors Scrypted's `DeviceDiscovery` interface
 * (`scrypted-reolink-native/src/nvr.ts:42-44`): the parent advertises
 * a list of discoverable children, and the operator promotes a subset
 * to real devices via `adoptDevice`. Child lifecycle (kernel device
 * create/remove, parent reference) is owned by the framework so a
 * single shared `<DiscoveryPanel />` can drive any integration.
 *
 * Boundaries:
 *   - The cap exposes ENUMERATION + ADOPT/RELEASE only. The protocol
 *     used to discover children (CGI poll, mDNS, push from hub, ...)
 *     is the integration's business; results land in `runtimeState`
 *     so the panel can render without a fresh round-trip.
 *   - `childNativeId` is integration-defined and must be stable across
 *     reboots so re-discovery doesn't duplicate adopted children.
 *   - `adoptDevice` returns the new `deviceId` so the UI can navigate
 *     directly to the freshly-created child's settings page.
 */
/**
 * Status enum for a discovered device. Mirrors the Reolink simpleEvent
 * lifecycle (`online` / `sleeping` / `offline`) — generic enough for
 * battery cams, awake cams, and unreachable cams alike.
 */
export declare const DiscoveredChildStatusSchema: z.ZodEnum<{
    unknown: "unknown";
    sleeping: "sleeping";
    offline: "offline";
    online: "online";
}>;
export type DiscoveredChildStatus = z.infer<typeof DiscoveredChildStatusSchema>;
/**
 * Single discovered child entry. `metadata` is integration-defined
 * but intentionally typed as a closed shape with the most-common
 * camera knobs — keeps the panel renderer dumb without forcing every
 * integration to invent a custom UI.
 */
export declare const DiscoveredChildDeviceSchema: z.ZodObject<{
    childNativeId: z.ZodString;
    name: z.ZodString;
    type: z.ZodEnum<typeof DeviceType>;
    status: z.ZodEnum<{
        unknown: "unknown";
        sleeping: "sleeping";
        offline: "offline";
        online: "online";
    }>;
    metadata: z.ZodDefault<z.ZodObject<{
        model: z.ZodOptional<z.ZodString>;
        serialNumber: z.ZodOptional<z.ZodString>;
        uid: z.ZodOptional<z.ZodString>;
        rtspChannel: z.ZodOptional<z.ZodNumber>;
        isBattery: z.ZodOptional<z.ZodBoolean>;
        isDoorbell: z.ZodOptional<z.ZodBoolean>;
        isMultifocal: z.ZodOptional<z.ZodBoolean>;
    }, z.core.$strip>>;
    alreadyAdopted: z.ZodBoolean;
    adoptedDeviceId: z.ZodNullable<z.ZodNumber>;
}, z.core.$strip>;
export type DiscoveredChildDevice = z.infer<typeof DiscoveredChildDeviceSchema>;
/**
 * Status block — populated by the integration after each
 * `refreshDiscovery` (or push-driven update). The runtime-state slice
 * is what the panel reads via the per-device proxy; `getStatus`
 * returns the same payload via the codegen'd auto-injection.
 */
export declare const DeviceDiscoveryStatusSchema: z.ZodObject<{
    discovered: z.ZodArray<z.ZodObject<{
        childNativeId: z.ZodString;
        name: z.ZodString;
        type: z.ZodEnum<typeof DeviceType>;
        status: z.ZodEnum<{
            unknown: "unknown";
            sleeping: "sleeping";
            offline: "offline";
            online: "online";
        }>;
        metadata: z.ZodDefault<z.ZodObject<{
            model: z.ZodOptional<z.ZodString>;
            serialNumber: z.ZodOptional<z.ZodString>;
            uid: z.ZodOptional<z.ZodString>;
            rtspChannel: z.ZodOptional<z.ZodNumber>;
            isBattery: z.ZodOptional<z.ZodBoolean>;
            isDoorbell: z.ZodOptional<z.ZodBoolean>;
            isMultifocal: z.ZodOptional<z.ZodBoolean>;
        }, z.core.$strip>>;
        alreadyAdopted: z.ZodBoolean;
        adoptedDeviceId: z.ZodNullable<z.ZodNumber>;
    }, z.core.$strip>>;
    lastDiscoveryAt: z.ZodNullable<z.ZodNumber>;
    lastError: z.ZodNullable<z.ZodString>;
}, z.core.$strip>;
export type DeviceDiscoveryStatus = z.infer<typeof DeviceDiscoveryStatusSchema>;
export declare const deviceDiscoveryCapability: {
    readonly name: "device-discovery";
    readonly scope: "device";
    readonly mode: "singleton";
    readonly deviceTypes: readonly [DeviceType.Hub];
    readonly status: {
        readonly schema: z.ZodObject<{
            discovered: z.ZodArray<z.ZodObject<{
                childNativeId: z.ZodString;
                name: z.ZodString;
                type: z.ZodEnum<typeof DeviceType>;
                status: z.ZodEnum<{
                    unknown: "unknown";
                    sleeping: "sleeping";
                    offline: "offline";
                    online: "online";
                }>;
                metadata: z.ZodDefault<z.ZodObject<{
                    model: z.ZodOptional<z.ZodString>;
                    serialNumber: z.ZodOptional<z.ZodString>;
                    uid: z.ZodOptional<z.ZodString>;
                    rtspChannel: z.ZodOptional<z.ZodNumber>;
                    isBattery: z.ZodOptional<z.ZodBoolean>;
                    isDoorbell: z.ZodOptional<z.ZodBoolean>;
                    isMultifocal: z.ZodOptional<z.ZodBoolean>;
                }, z.core.$strip>>;
                alreadyAdopted: z.ZodBoolean;
                adoptedDeviceId: z.ZodNullable<z.ZodNumber>;
            }, z.core.$strip>>;
            lastDiscoveryAt: z.ZodNullable<z.ZodNumber>;
            lastError: z.ZodNullable<z.ZodString>;
        }, z.core.$strip>;
        readonly kind: "poll";
    };
    readonly runtimeState: z.ZodObject<{
        discovered: z.ZodArray<z.ZodObject<{
            childNativeId: z.ZodString;
            name: z.ZodString;
            type: z.ZodEnum<typeof DeviceType>;
            status: z.ZodEnum<{
                unknown: "unknown";
                sleeping: "sleeping";
                offline: "offline";
                online: "online";
            }>;
            metadata: z.ZodDefault<z.ZodObject<{
                model: z.ZodOptional<z.ZodString>;
                serialNumber: z.ZodOptional<z.ZodString>;
                uid: z.ZodOptional<z.ZodString>;
                rtspChannel: z.ZodOptional<z.ZodNumber>;
                isBattery: z.ZodOptional<z.ZodBoolean>;
                isDoorbell: z.ZodOptional<z.ZodBoolean>;
                isMultifocal: z.ZodOptional<z.ZodBoolean>;
            }, z.core.$strip>>;
            alreadyAdopted: z.ZodBoolean;
            adoptedDeviceId: z.ZodNullable<z.ZodNumber>;
        }, z.core.$strip>>;
        lastDiscoveryAt: z.ZodNullable<z.ZodNumber>;
        lastError: z.ZodNullable<z.ZodString>;
        lastFetchedAt: z.ZodNumber;
    }, z.core.$strip>;
    readonly methods: {
        /**
         * Snapshot of the current `discovered` list. Returns the
         * runtime-state cache — call `refreshDiscovery` first if a
         * fresh round-trip to the source is required.
         */
        readonly listDiscovered: import("./capability-definition.js").CapabilityMethodSchema<z.ZodObject<{
            deviceId: z.ZodNumber;
        }, z.core.$strip>, z.ZodReadonly<z.ZodArray<z.ZodObject<{
            childNativeId: z.ZodString;
            name: z.ZodString;
            type: z.ZodEnum<typeof DeviceType>;
            status: z.ZodEnum<{
                unknown: "unknown";
                sleeping: "sleeping";
                offline: "offline";
                online: "online";
            }>;
            metadata: z.ZodDefault<z.ZodObject<{
                model: z.ZodOptional<z.ZodString>;
                serialNumber: z.ZodOptional<z.ZodString>;
                uid: z.ZodOptional<z.ZodString>;
                rtspChannel: z.ZodOptional<z.ZodNumber>;
                isBattery: z.ZodOptional<z.ZodBoolean>;
                isDoorbell: z.ZodOptional<z.ZodBoolean>;
                isMultifocal: z.ZodOptional<z.ZodBoolean>;
            }, z.core.$strip>>;
            alreadyAdopted: z.ZodBoolean;
            adoptedDeviceId: z.ZodNullable<z.ZodNumber>;
        }, z.core.$strip>>>, import("./capability-definition.js").CapabilityMethodKind>;
        /**
         * Force the integration to re-enumerate and update the
         * runtime-state slice. Returns the freshly-enumerated list (also
         * available via `listDiscovered` post-call).
         */
        readonly refreshDiscovery: import("./capability-definition.js").CapabilityMethodSchema<z.ZodObject<{
            deviceId: z.ZodNumber;
        }, z.core.$strip>, z.ZodReadonly<z.ZodArray<z.ZodObject<{
            childNativeId: z.ZodString;
            name: z.ZodString;
            type: z.ZodEnum<typeof DeviceType>;
            status: z.ZodEnum<{
                unknown: "unknown";
                sleeping: "sleeping";
                offline: "offline";
                online: "online";
            }>;
            metadata: z.ZodDefault<z.ZodObject<{
                model: z.ZodOptional<z.ZodString>;
                serialNumber: z.ZodOptional<z.ZodString>;
                uid: z.ZodOptional<z.ZodString>;
                rtspChannel: z.ZodOptional<z.ZodNumber>;
                isBattery: z.ZodOptional<z.ZodBoolean>;
                isDoorbell: z.ZodOptional<z.ZodBoolean>;
                isMultifocal: z.ZodOptional<z.ZodBoolean>;
            }, z.core.$strip>>;
            alreadyAdopted: z.ZodBoolean;
            adoptedDeviceId: z.ZodNullable<z.ZodNumber>;
        }, z.core.$strip>>>, "mutation">;
        /**
         * Promote a discovered entry to a real child device. The framework
         * creates the child via `kernel.devices.create()` with
         * `parentDeviceId = parent.id` and seeds the child's config from
         * `childInitialConfig` (driver-defined; usually carries channel +
         * uid + parent reference). Returns the kernel-assigned numeric id.
         */
        readonly adoptDevice: import("./capability-definition.js").CapabilityMethodSchema<z.ZodObject<{
            deviceId: z.ZodNumber;
            childNativeId: z.ZodString;
            name: z.ZodOptional<z.ZodString>;
        }, z.core.$strip>, z.ZodObject<{
            deviceId: z.ZodNumber;
            stableId: z.ZodString;
        }, z.core.$strip>, "mutation">;
        /**
         * Inverse of `adoptDevice`: removes the child device from the
         * kernel registry. The discovered entry remains in the
         * enumeration (status updates resume) so the operator can re-adopt
         * it later without a fresh refresh.
         */
        readonly releaseDevice: import("./capability-definition.js").CapabilityMethodSchema<z.ZodObject<{
            deviceId: z.ZodNumber;
            childDeviceId: z.ZodNumber;
        }, z.core.$strip>, z.ZodVoid, "mutation">;
    };
};
export type IDeviceDiscoveryProvider = InferProvider<typeof deviceDiscoveryCapability>;
export type IDeviceDiscoveryNativeProvider = InferNativeProvider<typeof deviceDiscoveryCapability>;
//# sourceMappingURL=device-discovery.cap.d.ts.map