import { z } from 'zod';
import { type InferProvider } from './capability-definition.js';
import { DeviceType } from '../device/device-type.js';
/**
 * Per-zone occupancy aggregation produced by the analytics frame
 * processor on every inference result. Covers the full combinatorial
 * matrix the operator UI needs: total objects everywhere, total
 * objects per zone, single class everywhere, single class per zone,
 * objects outside any zone.
 *
 * Counts are derived from the analytics tracker (tracked detections
 * with stable trackIds), not raw detector hits — this filters out
 * one-off detector flickers and gives counts that match what the user
 * sees on the live overlay.
 *
 * Overlap policy: a detection that intersects two zones counts in
 * BOTH zones' `byClass` and `totalObjects` (count-in-each). The
 * `frame` aggregate de-duplicates trivially since it's frame-wide.
 * `unzoned` counts only detections that landed in zero zones.
 */
declare const PerScopeBreakdownSchema: z.ZodObject<{
    totalObjects: z.ZodNumber;
    byClass: z.ZodRecord<z.ZodString, z.ZodNumber>;
}, z.core.$strip>;
declare const ZoneScopeBreakdownSchema: z.ZodObject<{
    totalObjects: z.ZodNumber;
    byClass: z.ZodRecord<z.ZodString, z.ZodNumber>;
    zoneId: z.ZodString;
    zoneName: z.ZodString;
    trackIds: z.ZodReadonly<z.ZodArray<z.ZodString>>;
}, z.core.$strip>;
export declare const CameraOccupancySnapshotSchema: z.ZodObject<{
    ts: z.ZodNumber;
    frameWidth: z.ZodNumber;
    frameHeight: z.ZodNumber;
    zones: z.ZodReadonly<z.ZodArray<z.ZodObject<{
        totalObjects: z.ZodNumber;
        byClass: z.ZodRecord<z.ZodString, z.ZodNumber>;
        zoneId: z.ZodString;
        zoneName: z.ZodString;
        trackIds: z.ZodReadonly<z.ZodArray<z.ZodString>>;
    }, z.core.$strip>>>;
    frame: z.ZodObject<{
        totalObjects: z.ZodNumber;
        byClass: z.ZodRecord<z.ZodString, z.ZodNumber>;
    }, z.core.$strip>;
    unzoned: z.ZodObject<{
        totalObjects: z.ZodNumber;
        byClass: z.ZodRecord<z.ZodString, z.ZodNumber>;
    }, z.core.$strip>;
}, z.core.$strip>;
export type CameraOccupancySnapshot = z.infer<typeof CameraOccupancySnapshotSchema>;
export type ZoneScopeBreakdown = z.infer<typeof ZoneScopeBreakdownSchema>;
export type PerScopeBreakdown = z.infer<typeof PerScopeBreakdownSchema>;
/**
 * Time-series resolution. The history methods return one bucket per
 * step over the requested range. Smaller resolutions cost more
 * memory + bandwidth; bound to discrete steps so caller cannot ask
 * for arbitrary fractional buckets.
 */
declare const HistoryResolutionEnum: z.ZodEnum<{
    minute: "minute";
    "5min": "5min";
    hour: "hour";
}>;
export type HistoryResolution = z.infer<typeof HistoryResolutionEnum>;
declare const HistoryRangeSchema: z.ZodObject<{
    from: z.ZodNumber;
    to: z.ZodNumber;
    resolution: z.ZodEnum<{
        minute: "minute";
        "5min": "5min";
        hour: "hour";
    }>;
}, z.core.$strip>;
declare const HistoryPointSchema: z.ZodObject<{
    ts: z.ZodNumber;
    count: z.ZodNumber;
}, z.core.$strip>;
export type HistoryPoint = z.infer<typeof HistoryPointSchema>;
/**
 * Zone Analytics capability — spatial occupancy aggregations over
 * tracked detections. Hosted by `addon-pipeline-analytics`.
 *
 * Live snapshot is mirrored into the `zone-occupancy` device-state
 * slice on every frame; the cap method `getCurrentSnapshot` is a
 * direct read for callers that don't want to subscribe.
 *
 * History methods are sourced from a 60-minute rolling in-memory
 * ring of frame-level samples (sub-second resolution). Queries
 * outside the ring window return empty arrays — durable storage
 * is a follow-up (Step 4b: persisted samples → SQL store).
 *
 * Every history method takes an optional `className` filter:
 * - omitted → bucket count includes ALL classes in scope
 * - present → bucket count restricted to that class
 *
 * The `getZoneHistory` / `getCameraHistory` / `getUnzonedHistory`
 * triple covers the three spatial scopes (per-zone, frame-wide,
 * outside-any-zone). Crossing them with `className?` gives the full
 * combinatorial coverage the operator UI requested.
 */
export declare const zoneAnalyticsCapability: {
    readonly name: "zone-analytics";
    readonly scope: "device";
    readonly mode: "singleton";
    readonly deviceTypes: readonly [DeviceType.Camera];
    readonly methods: {
        /** Latest computed occupancy snapshot for this camera. Null when
         *  the analytics pipeline hasn't seen a frame for this device yet
         *  (no inference result emitted since boot or since binding was
         *  activated). */
        readonly getCurrentSnapshot: import("./capability-definition.js").CapabilityMethodSchema<z.ZodObject<{
            deviceId: z.ZodNumber;
        }, z.core.$strip>, z.ZodNullable<z.ZodObject<{
            ts: z.ZodNumber;
            frameWidth: z.ZodNumber;
            frameHeight: z.ZodNumber;
            zones: z.ZodReadonly<z.ZodArray<z.ZodObject<{
                totalObjects: z.ZodNumber;
                byClass: z.ZodRecord<z.ZodString, z.ZodNumber>;
                zoneId: z.ZodString;
                zoneName: z.ZodString;
                trackIds: z.ZodReadonly<z.ZodArray<z.ZodString>>;
            }, z.core.$strip>>>;
            frame: z.ZodObject<{
                totalObjects: z.ZodNumber;
                byClass: z.ZodRecord<z.ZodString, z.ZodNumber>;
            }, z.core.$strip>;
            unzoned: z.ZodObject<{
                totalObjects: z.ZodNumber;
                byClass: z.ZodRecord<z.ZodString, z.ZodNumber>;
            }, z.core.$strip>;
        }, z.core.$strip>>, import("./capability-definition.js").CapabilityMethodKind>;
        /** Time-series object count inside one zone. `className` optional —
         *  omit to count every class in the zone. */
        readonly getZoneHistory: import("./capability-definition.js").CapabilityMethodSchema<z.ZodObject<{
            deviceId: z.ZodNumber;
            zoneId: z.ZodString;
            className: z.ZodOptional<z.ZodString>;
            from: z.ZodNumber;
            to: z.ZodNumber;
            resolution: z.ZodEnum<{
                minute: "minute";
                "5min": "5min";
                hour: "hour";
            }>;
        }, z.core.$strip>, z.ZodReadonly<z.ZodArray<z.ZodObject<{
            ts: z.ZodNumber;
            count: z.ZodNumber;
        }, z.core.$strip>>>, import("./capability-definition.js").CapabilityMethodKind>;
        /** Time-series frame-wide object count (everywhere). */
        readonly getCameraHistory: import("./capability-definition.js").CapabilityMethodSchema<z.ZodObject<{
            deviceId: z.ZodNumber;
            className: z.ZodOptional<z.ZodString>;
            from: z.ZodNumber;
            to: z.ZodNumber;
            resolution: z.ZodEnum<{
                minute: "minute";
                "5min": "5min";
                hour: "hour";
            }>;
        }, z.core.$strip>, z.ZodReadonly<z.ZodArray<z.ZodObject<{
            ts: z.ZodNumber;
            count: z.ZodNumber;
        }, z.core.$strip>>>, import("./capability-definition.js").CapabilityMethodKind>;
        /** Time-series count of objects outside every zone. */
        readonly getUnzonedHistory: import("./capability-definition.js").CapabilityMethodSchema<z.ZodObject<{
            deviceId: z.ZodNumber;
            className: z.ZodOptional<z.ZodString>;
            from: z.ZodNumber;
            to: z.ZodNumber;
            resolution: z.ZodEnum<{
                minute: "minute";
                "5min": "5min";
                hour: "hour";
            }>;
        }, z.core.$strip>, z.ZodReadonly<z.ZodArray<z.ZodObject<{
            ts: z.ZodNumber;
            count: z.ZodNumber;
        }, z.core.$strip>>>, import("./capability-definition.js").CapabilityMethodKind>;
    };
    /**
     * Runtime-state slice — the latest occupancy snapshot mirrored by
     * the analytics frame processor on every inference result. Consumers
     * read via `device.state.zoneAnalytics.value` and stay in sync
     * automatically; the explicit `getCurrentSnapshot` cap method is
     * still useful for one-off polls without a subscription.
     */
    readonly runtimeState: z.ZodObject<{
        ts: z.ZodNumber;
        frameWidth: z.ZodNumber;
        frameHeight: z.ZodNumber;
        zones: z.ZodReadonly<z.ZodArray<z.ZodObject<{
            totalObjects: z.ZodNumber;
            byClass: z.ZodRecord<z.ZodString, z.ZodNumber>;
            zoneId: z.ZodString;
            zoneName: z.ZodString;
            trackIds: z.ZodReadonly<z.ZodArray<z.ZodString>>;
        }, z.core.$strip>>>;
        frame: z.ZodObject<{
            totalObjects: z.ZodNumber;
            byClass: z.ZodRecord<z.ZodString, z.ZodNumber>;
        }, z.core.$strip>;
        unzoned: z.ZodObject<{
            totalObjects: z.ZodNumber;
            byClass: z.ZodRecord<z.ZodString, z.ZodNumber>;
        }, z.core.$strip>;
    }, z.core.$strip>;
};
export type IZoneAnalyticsProvider = InferProvider<typeof zoneAnalyticsCapability>;
export { CameraOccupancySnapshotSchema as _CameraOccupancySnapshotSchema, HistoryResolutionEnum, HistoryPointSchema, HistoryRangeSchema, ZoneScopeBreakdownSchema, PerScopeBreakdownSchema, };
//# sourceMappingURL=zone-analytics.cap.d.ts.map