import type { Events as AdapterEvents } from "../../adapter";
import type { Eui64 } from "../../zspec/tstypes";
import * as Zcl from "../../zspec/zcl";
import type { TClusterCommandPayload, TPartialClusterAttributes } from "../../zspec/zcl/definition/clusters-types";
import type { ClusterDefinition, CustomClusters } from "../../zspec/zcl/definition/tstype";
import type { BindingTableEntry, LQITableEntry, RoutingTableEntry } from "../../zspec/zdo/definition/tstypes";
import type { ControllerEventMap } from "../controller";
import type { DeviceType, KeyValue, OtaDataSettings, OtaExtraMetas, OtaSource, OtaUpdateAvailableResult, ZigbeeOtaImageMeta } from "../tstype";
import Endpoint from "./endpoint";
import Entity from "./entity";
type CustomReadResponse = (frame: Zcl.Frame, endpoint: Endpoint) => boolean;
export declare enum InterviewState {
    Pending = "PENDING",
    InProgress = "IN_PROGRESS",
    Successful = "SUCCESSFUL",
    Failed = "FAILED"
}
export declare class Device extends Entity<ControllerEventMap> {
    #private;
    private readonly ID;
    private _endpoints;
    private _ieeeAddr;
    private _interviewState;
    private _lastSeen?;
    private _manufacturerID?;
    private _networkAddress;
    private _type;
    private _linkquality?;
    private _skipDefaultResponse;
    private _customReadResponse?;
    private _lastDefaultResponseSequenceNumber?;
    private _checkinInterval?;
    private _pendingRequestTimeout;
    private _customClusters;
    private _gpSecurityKey?;
    get ieeeAddr(): string;
    set ieeeAddr(ieeeAddr: string);
    get applicationVersion(): number | undefined;
    set applicationVersion(version: number);
    get endpoints(): Endpoint[];
    get interviewState(): InterviewState;
    get lastSeen(): number | undefined;
    get manufacturerID(): number | undefined;
    get isDeleted(): boolean;
    set type(type: DeviceType);
    get type(): DeviceType;
    get dateCode(): string | undefined;
    set dateCode(code: string);
    set hardwareVersion(version: number);
    get hardwareVersion(): number | undefined;
    get manufacturerName(): string | undefined;
    set manufacturerName(name: string | undefined);
    set modelID(id: string);
    get modelID(): string | undefined;
    get networkAddress(): number;
    set networkAddress(networkAddress: number);
    get powerSource(): string | undefined;
    set powerSource(source: string | number);
    get softwareBuildID(): string | undefined;
    set softwareBuildID(id: string);
    get stackVersion(): number | undefined;
    set stackVersion(version: number);
    get zclVersion(): number | undefined;
    set zclVersion(version: number);
    get linkquality(): number | undefined;
    set linkquality(linkquality: number);
    get skipDefaultResponse(): boolean;
    set skipDefaultResponse(skipDefaultResponse: boolean);
    get customReadResponse(): CustomReadResponse | undefined;
    set customReadResponse(customReadResponse: CustomReadResponse | undefined);
    get checkinInterval(): number | undefined;
    set checkinInterval(checkinInterval: number | undefined);
    get pendingRequestTimeout(): number;
    set pendingRequestTimeout(pendingRequestTimeout: number);
    get customClusters(): CustomClusters;
    get gpSecurityKey(): number[] | undefined;
    get genBasic(): TPartialClusterAttributes<"genBasic">;
    get scheduledOta(): OtaSource | undefined;
    get otaInProgress(): boolean;
    meta: KeyValue;
    private static readonly devices;
    private static loadedFromDatabase;
    private static readonly deletedDevices;
    private static readonly nwkToIeeeCache;
    private constructor();
    createEndpoint(id: number): Endpoint;
    changeIeeeAddress(ieeeAddr: string): void;
    getEndpoint(id: number): Endpoint | undefined;
    getEndpointByDeviceType(deviceType: string): Endpoint | undefined;
    updateGenBasic(data: TPartialClusterAttributes<"genBasic">): void;
    implicitCheckin(): void;
    updateLastSeen(): void;
    private resetPendingRequestTimeout;
    private hasPendingRequests;
    onZclData(dataPayload: AdapterEvents.ZclPayload, frame: Zcl.Frame, endpoint: Endpoint): Promise<void>;
    /**
     * Reset runtime lookups.
     */
    static resetCache(): void;
    private static fromDatabaseEntry;
    private toDatabaseEntry;
    save(writeDatabase?: boolean): void;
    private static loadFromDatabaseIfNecessary;
    static find(ieeeOrNwkAddress: string | number, includeDeleted?: boolean): Device | undefined;
    static byIeeeAddr(ieeeAddr: string, includeDeleted?: boolean): Device | undefined;
    static byNetworkAddress(networkAddress: number, includeDeleted?: boolean): Device | undefined;
    static byType(type: DeviceType): Device[];
    /** Check if a device is explicitly deleted */
    static isDeletedByIeeeAddr(ieeeAddr: string): boolean;
    /** Check if a device is explicitly deleted */
    static isDeletedByNetworkAddress(networkAddress: number): boolean;
    /**
     * @deprecated use allIterator()
     */
    static all(): Device[];
    static allIterator(predicate?: (value: Device) => boolean): Generator<Device>;
    undelete(): void;
    static create(type: DeviceType, ieeeAddr: string, networkAddress: number, manufacturerID: number | undefined, manufacturerName: string | undefined, powerSource: string | undefined, modelID: string | undefined, interviewState: InterviewState, gpSecurityKey: number[] | undefined): Device;
    interview(ignoreCache?: boolean): Promise<void>;
    private interviewQuirks;
    private interviewInternal;
    updateNodeDescriptor(): Promise<void>;
    updateActiveEndpoints(): Promise<void>;
    /**
     * Request device to advertise its network address.
     * Note: This does not actually update the device property (if needed), as this is already done with `zdoResponse` event in Controller.
     */
    requestNetworkAddress(): Promise<void>;
    removeFromNetwork(): Promise<void>;
    removeFromDatabase(): void;
    lqi(): Promise<LQITableEntry[]>;
    routingTable(): Promise<RoutingTableEntry[]>;
    bindingTable(): Promise<BindingTableEntry[]>;
    /**
     * Clear all the bindings of a device.
     * Support of this command is optional (only mandatory if device has a binding table).
     * @param eui64List list of bind entries to match and clear. Send `["0xffffffffffffffff"]` to clear all.
     */
    clearAllBindings(eui64List: Eui64[]): Promise<void>;
    ping(disableRecovery?: boolean): Promise<void>;
    addCustomCluster(name: string, cluster: ClusterDefinition): void;
    findMatchingOtaImage(source: OtaSource, current: TClusterCommandPayload<"genOta", "queryNextImageRequest">, extraMetas: OtaExtraMetas): Promise<ZigbeeOtaImageMeta | undefined>;
    /**
     * If `current` is undefined, will automatically notify and reply to query with `NO_IMAGE_AVAILABLE` (stops device from doing further requests).
     */
    checkOta(source: OtaSource, current: TClusterCommandPayload<"genOta", "queryNextImageRequest"> | undefined, extraMetas: OtaExtraMetas, endpoint?: Endpoint | undefined): Promise<OtaUpdateAvailableResult>;
    updateOta(source: Readonly<OtaSource> | undefined, requestPayload: TClusterCommandPayload<"genOta", "queryNextImageRequest"> | undefined, requestTsn: number | undefined, extraMetas: Readonly<OtaExtraMetas>, onProgress: (progress: number, remaining: number) => void, dataSettings: OtaDataSettings, endpoint?: Endpoint | undefined): Promise<[from: OtaUpdateAvailableResult["current"], to: OtaUpdateAvailableResult["current"] | undefined]>;
    scheduleOta(source: OtaSource): void;
    unscheduleOta(): void;
}
export default Device;
//# sourceMappingURL=device.d.ts.map