import { DeviceOptions } from './types';
import { IKosDataModel, IKosIdentifiable, KosCreationContext, PublicModelInterface } from '../../../core';

export declare const MODEL_TYPE = "device-model";
export declare const TOPIC_CRITICAL_DATA_CHANGED = "/kos/criticalData/changed";
export declare const TOPIC_CRITICAL_DATA_AVAILABLE = "/kos/criticalData/available";
export declare const TOPIC_CRITICAL_DATA_UNAVAILABLE = "/kos/criticalData/unavailable";
/**
 * KOS Device Model - Device Identity and Node Configuration Management
 *
 * The Device model provides centralized management of device identity, node configuration,
 * and hardware identification within KOS systems. It handles device serial numbers,
 * names, and node topology information essential for system coordination and administration.
 *
 * ## Key Features
 *
 * ### Device Identity Management
 * - **Serial Number Tracking**: Hardware-based device identification
 * - **Name Management**: Human-readable device naming for administration
 * - **Node Configuration**: Multi-node deployment topology handling
 *
 * ### Real-time Synchronization
 * - **Critical Data Events**: Automatic updates on system data changes
 * - **WebSocket Integration**: Live device state synchronization
 * - **Lazy Loading**: Efficient data retrieval when needed
 *
 * ### Node Topology Support
 * - **Node Type/Name Parsing**: Automatic node identifier decomposition
 * - **Multi-node Deployments**: Support for complex system architectures
 * - **Role-based Configuration**: Node-specific parameter management
 *
 * ## Common Integration Patterns
 *
 * ### System Administration Dashboards
 * ```typescript
 * const device = Device.factory({
 *   serialNumber: 'KOS-DEV-001',
 *   name: 'Production Dispenser Alpha',
 *   nodeId: 'primary-main'
 * });
 *
 * // Access device identity
 * console.log(`Device: ${device.name}`);
 * console.log(`Serial: ${device.serialNumber}`);
 * console.log(`Node: ${device.nodeType}-${device.nodeName}`);
 * ```
 *
 * ### Multi-node System Coordination
 * ```typescript
 * const primaryDevice = Device.factory({
 *   nodeId: 'primary-controller'
 * });
 *
 * const secondaryDevice = Device.factory({
 *   nodeId: 'secondary-backup'
 * });
 *
 * // Coordinate based on node roles
 * if (primaryDevice.nodeType === 'primary') {
 *   // Handle primary node logic
 * }
 * ```
 *
 * ### Device Registration and Setup
 * ```typescript
 * const newDevice = Device.factory({
 *   serialNumber: await getHardwareSerial(),
 *   name: userProvidedName,
 *   nodeId: deploymentConfiguration.nodeId
 * });
 *
 * // Device automatically loads additional data
 * // from critical data events
 * ```
 *
 * ## Real-time Updates
 *
 * The Device model automatically responds to critical data changes:
 * - Monitors `/kos/criticalData/changed` and `/kos/criticalData/available` topics
 * - Updates serial number and configuration when system data becomes available
 * - Maintains consistency across device restarts and configuration changes
 *
 * ## Singleton Behavior
 *
 * Device models use singleton pattern - each device type has one instance:
 * - Subsequent factory calls return the existing instance
 * - Options are ignored after first creation
 * - Ensures system-wide device identity consistency
 *
 * This is an alias for the implementation {@link DeviceModelImpl}.
 *
 * @interface
 * @group KOS Model
 * @category Device Data
 * @useDeclaredType
 */
export type DeviceModel = PublicModelInterface<DeviceModelImpl>;
export declare class DeviceModelImpl implements IKosDataModel, IKosIdentifiable {
    id: string;
    private logger;
    private _serialNumber;
    /**
     * Hardware-based device serial number for unique identification.
     *
     * Returns the device's hardware serial number or "unassigned" if not yet loaded.
     * Serial numbers are typically retrieved from the device's hardware identification
     * system during critical data events.
     *
     * @example
     * ```typescript
     * const device = Device.factory({});
     *
     * // Check if serial number is available
     * if (device.serialNumber !== "unassigned") {
     *   console.log(`Device Serial: ${device.serialNumber}`);
     * }
     * ```
     */
    get serialNumber(): string | "unassigned";
    private _name;
    /**
     * Human-readable device name for administrative identification.
     *
     * Returns the configured device name or "unassigned" if not yet set.
     * Device names are typically configured during device setup and used
     * in administrative interfaces for device identification and management.
     *
     * @example
     * ```typescript
     * const device = Device.factory({
     *   name: 'Main Production Dispenser'
     * });
     *
     * console.log(`Device Name: ${device.name}`);
     * // Output: "Device Name: Main Production Dispenser"
     * ```
     */
    get name(): string | "unassigned";
    private _nodeId;
    /**
     * Full node identifier within the KOS deployment.
     *
     * Returns the complete node ID or "unassigned" if not yet configured.
     * Node IDs follow the pattern "type-instance" (e.g., "primary-main", "secondary-backup")
     * and identify the specific node role and instance within multi-node deployments.
     *
     * @example
     * ```typescript
     * const device = Device.factory({
     *   nodeId: 'primary-controller'
     * });
     *
     * console.log(`Node ID: ${device.nodeId}`);
     * // Output: "Node ID: primary-controller"
     * ```
     *
     * @see {@link nodeType} for extracting the node type portion
     * @see {@link nodeName} for extracting the node name portion
     */
    get nodeId(): string | "unassigned";
    /**
     * Node type extracted from the node identifier.
     *
     * Returns the first part of the node ID (before the hyphen).
     * For node ID "primary-controller", this returns "primary".
     * Used for role-based logic and node coordination.
     *
     * @example
     * ```typescript
     * const device = Device.factory({
     *   nodeId: 'primary-controller'
     * });
     *
     * console.log(`Node Type: ${device.nodeType}`);
     * // Output: "Node Type: primary"
     *
     * // Role-based coordination
     * if (device.nodeType === 'primary') {
     *   // Handle primary node responsibilities
     * }
     * ```
     */
    get nodeType(): string;
    /**
     * Node name extracted from the node identifier.
     *
     * Returns the second part of the node ID (after the hyphen).
     * For node ID "primary-controller", this returns "controller".
     * Used for instance-specific identification within node types.
     *
     * @example
     * ```typescript
     * const device = Device.factory({
     *   nodeId: 'secondary-backup'
     * });
     *
     * console.log(`Node Name: ${device.nodeName}`);
     * // Output: "Node Name: backup"
     *
     * // Instance-specific logic
     * if (device.nodeName === 'backup') {
     *   // Handle backup node configuration
     * }
     * ```
     */
    get nodeName(): string;
    constructor(modelId: string, _options: DeviceOptions, context: KosCreationContext);
    /**
     * Update the device model with new configuration options.
     *
     * Allows dynamic updating of device identity and node configuration.
     * Any undefined values will be set to "unassigned". This method is typically
     * called internally during device data loading or external configuration changes.
     *
     * @param options - Device configuration options to apply
     *
     * @example
     * ```typescript
     * const device = Device.factory({});
     *
     * // Update with new device information
     * device.updateModel({
     *   serialNumber: 'KOS-DEVICE-12345',
     *   name: 'Updated Dispenser Name',
     *   nodeId: 'primary-main'
     * });
     *
     * console.log(device.serialNumber); // "KOS-DEVICE-12345"
     * console.log(device.name);         // "Updated Dispenser Name"
     * console.log(device.nodeId);       // "primary-main"
     * ```
     *
     * @example Partial Updates
     * ```typescript
     * // Only update specific fields
     * device.updateModel({
     *   name: 'New Device Name'
     *   // serialNumber and nodeId remain unchanged
     * });
     * ```
     */
    updateModel(options: DeviceOptions): void;
    private loadDeviceData;
    private loadSerialNumber;
    /**
     * Handle critical data changes to load the serial number at the appropriate time.
     */
    handleCriticalDataChanged(): Promise<void>;
    /**
     * @internal
     */
    init(): Promise<void>;
    /**
     * @internal
     */
    load(): Promise<void>;
}
//# sourceMappingURL=device-model.d.ts.map