/**
 * @license
 * Copyright 2022-2026 Matter.js Authors
 * SPDX-License-Identifier: Apache-2.0
 */
import { Bytes, type Cipher } from "@matter/general";
import { FabricIndex } from "@matter/types";
import { DoorLock } from "@matter/types/clusters/door-lock";
import CredentialType = DoorLock.CredentialType;
import LockDataType = DoorLock.LockDataType;
/**
 * Auth-related data types and pure helper functions for the DoorLock server implementation.
 */
export declare namespace LockAuth {
    /**
     * Reference to a credential by type and index.
     */
    class CredentialRef {
        credentialType: CredentialType;
        credentialIndex: number;
    }
    /**
     * Stored user record with credential associations and fabric tracking.
     */
    class User {
        userIndex: number;
        userName: string;
        userUniqueId: number | null;
        userStatus: DoorLock.UserStatus;
        userType: DoorLock.UserType;
        credentialRule: DoorLock.CredentialRule;
        credentials: DoorLock.Credential[];
        creatorFabricIndex: FabricIndex;
        lastModifiedFabricIndex: FabricIndex;
    }
    /**
     * Stored credential record with encrypted data and fabric tracking.
     */
    class Credential {
        credentialType: CredentialType;
        credentialIndex: number;
        credentialData: Bytes;
        creatorFabricIndex: FabricIndex;
        lastModifiedFabricIndex: FabricIndex;
    }
    function credentialTypeToLockDataType(type: CredentialType): LockDataType;
    /**
     * Encapsulates user/credential persistence with integrated encryption.
     *
     * All credential data mutations encrypt automatically; all queries decrypt automatically. Override
     * {@link DoorLockBaseServer.cipher} or {@link DoorLockBaseServer.auth} to customize.
     */
    class Store {
        #private;
        constructor(state: {
            users: User[];
            credentials: Credential[];
        }, cipher: Cipher);
        findUser(userIndex: number): User | undefined;
        findNextOccupiedUserIndex(afterIndex: number): number | null;
        findAvailableUserIndex(maxUsers: number): number | null;
        findUserIndexForCredential(type: CredentialType, index: number): number | null;
        addUser(user: User): void;
        replaceUser(userIndex: number, user: User): void;
        removeUser(userIndex: number): void;
        clearUsers(): void;
        findCredential(type: CredentialType, index: number): Credential | undefined;
        findNextAvailableCredentialIndex(type: CredentialType, afterIndex: number, max: number): number | null;
        findNextOccupiedCredentialIndex(type: CredentialType, afterIndex: number): number | null;
        isDuplicateCredential(type: CredentialType, data: Bytes, excludeIndex?: number): boolean;
        addCredential(type: CredentialType, index: number, data: Bytes, fabricIndex: FabricIndex): void;
        updateCredentialData(type: CredentialType, index: number, data: Bytes, fabricIndex: FabricIndex): void;
        removeCredential(type: CredentialType, index: number): void;
        removeAllCredentialsOfType(type: CredentialType): void;
        encrypt(data: Bytes): Bytes;
        decrypt(data: Bytes): Bytes;
        get users(): readonly User[];
        get credentials(): readonly Credential[];
    }
}
//# sourceMappingURL=LockAuth.d.ts.map