import type { AdapterStateSnapshot, BackendIdentity, BackendProvider, ManagerConstruction, OwnerMode } from '../backend-contract/index.js'; import type { AdvertisementObservation, ScanOptions } from '../backend-contract/advertisement.js'; import type { NormalizedScanQuery } from '../backend-contract/scan-query.js'; import type { ScanPlan } from '../backend-contract/scan-planning.js'; import type { CleanupRecord } from '../backend-contract/errors.js'; import type { CharacteristicPath, GattDatabaseChangedEvent, GattDatabaseSnapshot } from '../backend-contract/gatt.js'; import type { AdapterSelection } from '../backend-contract/identity.js'; import type { CapabilityDescriptor, FeatureId } from '../backend-contract/capabilities.js'; import type { WriteMode } from '../backend-contract/operations.js'; import type { AttachmentId, BackendCompatibilityOffer, PeerId } from '../backend-contract/primitives.js'; import type { AttachedBackend, BleCentralBackend, ConnectionOptions, OwningManagerConstruction } from '../backend-contract/backend.js'; import type { BoundedAsyncStream } from '../backend-contract/streams.js'; import type { RestorationAdoptionRequest, RestorationAdoptionResult } from '../backend-contract/restoration.js'; import type { SecurityBackend } from '../backend-contract/security.js'; import type { ConnectionPhyObservation, ConnectionPhyRequest, ConnectionPriority, ConnectionWriteReadinessWatch, PhyPreference } from '../backend-contract/connection-controls.js'; import type { DiagnosticTraceDocument } from '../diagnostics/trace-format.js'; import { UnifiedBleCore } from '../core/unified-ble-core.js'; import type { CoreDeadlineHandle, CoreScanSession, UnifiedBleCoreOptions } from '../core/unified-ble-core.js'; import { CoreConnection, CoreGattDatabase } from '../core/core-gatt-handles.js'; import { CoreSubscription } from '../core/subscription-registry.js'; import { type BleConnectionHandle, type BleManagerLifetime, type DeadlineHandle, type DiscoveredGattDatabaseHandle, type PortableCurrentCharacteristicPath, type PortableCurrentDescriptorPath, type PortableOperationOptions, type PortableSubscriptionOptions, type PortableWritePolicy, type SubscriptionHandle } from './consumer-handles.js'; import { ManagerOwnershipAuthority, type OwnershipRoleTransitionCapability, type OwnershipTransferGrant } from './manager-ownership-authority.js'; /** Internal non-enrolling bridge used by the authority to verify actual BleManager construction. */ export declare function isConstructedBleManagerOwnershipParticipant(participant: object): boolean; export interface BleManagerOptions { readonly now: () => number; readonly timer?: UnifiedBleCoreOptions['timer']; readonly maximumValueBytes: UnifiedBleCoreOptions['maximumValueBytes']; readonly maximumAggregateRetainedBytes: number; readonly traceMaximumRecords: number; readonly traceMaximumBytes: number; } export interface ProviderBleManagerConstruction> { readonly provider: BackendProvider; readonly selection: AdapterSelection; readonly coreCompatibility: BackendCompatibilityOffer; readonly manager: Omit, 'attachedBackend'>; } export interface BackendBleManagerConstruction> { readonly coreCompatibility: BackendCompatibilityOffer; readonly manager: Omit, 'attachedBackend'>; } /** * Host-neutral public manager. Construction is explicit and delegates all * shared policy to UnifiedBleCore; it neither detects a host nor creates a * singleton or physical adapter owner on import. */ export declare class BleManager> implements BleManagerLifetime { private readonly core; private readonly ownershipAuthority; private resourceReleaseResult; private destroyResult; private ownershipMode; private constructor(); get state(): UnifiedBleCore['state']; get identity(): Identity; get attachmentId(): AttachmentId; get managerId(): ManagerConstruction['managerId']; get clientId(): ManagerConstruction['clientId']; get ownerMode(): OwnerMode; get attachedBackend(): AttachedBackend; get features(): import("../backend-contract/index.js").FeatureRegistry; securityBackend(): SecurityBackend | undefined; /** True only where the instantiated backend/core registry exposes an invocable feature implementation. */ supports(id: FeatureId): boolean; /** Returns one immutable capability descriptor, or null when no registration exists. */ capability(id: FeatureId): CapabilityDescriptor | null; /** Returns the immutable capability projection derived from negotiated registrations. */ capabilities(): readonly CapabilityDescriptor[]; /** Explicitly consumes the active provider's bounded native restoration journal. */ adoptRestoration(request: RestorationAdoptionRequest): Promise>; static create>(construction: ManagerConstruction, ownershipAuthority: ManagerOwnershipAuthority, options: BleManagerOptions): Promise>; scan(options: ScanOptions): Promise>; planScan(query: NormalizedScanQuery): ScanPlan | null; connect(peerId: PeerId, options: ConnectionOptions): Promise>; destroy(): Promise; traces(): readonly import("../core/index.js").CoreTraceRecord[]; traceDocument(): DiagnosticTraceDocument; monotonicNow(): number; scheduleDeadline(deadlineAt: number, action: () => void): CoreDeadlineHandle; localResourceCounters(): import("../backend-contract/index.js").ResourceCounters; adapterState(): Promise>; adapterStates(options?: { readonly signal?: AbortSignal | null; }): Promise<{ readonly initial: AdapterStateSnapshot; readonly values: BoundedAsyncStream>; stop(): Promise; }>; /** Called only by the explicit authority during settled owner revocation. */ revokeForOwnerDestroy(): Promise; /** Settles this owner's resources, then atomically hands backend authority to an accepted borrower. */ transferOwnership(grant: OwnershipTransferGrant): Promise; acceptsOwnershipTransfer(): boolean; becomeOwnershipTransferDestination(capability: OwnershipRoleTransitionCapability): void; relinquishOwnershipTransferSource(capability: OwnershipRoleTransitionCapability): void; private releaseOwnedResources; private destroyBorrowingManager; private destroyOwningManager; } /** Explicitly creates a manager from a selected provider adapter. */ export declare function createBleManagerFromProvider>(construction: ProviderBleManagerConstruction, options: BleManagerOptions): Promise>; /** Creates an owning manager for a host backend that has already been selected. */ export declare function createBleManagerFromBackend>(backend: BleCentralBackend, construction: BackendBleManagerConstruction, options: BleManagerOptions, expectedAdapterId?: AdapterSelection['selectedAdapterId']): Promise>; /** Performs the one manager-neutral attachment handshake for a selected backend. */ export declare function attachBleBackend>(backend: AttachedBackend['backend'], coreCompatibility: BackendCompatibilityOffer): Promise>; /** Creates the explicit per-attachment authority shared by logical managers. */ export declare function createManagerOwnershipAuthority>(attachedBackend: AttachedBackend): ManagerOwnershipAuthority; /** Explicitly creates a manager from a backend that has already been selected by its host/provider. */ export declare function createBleManager>(construction: ManagerConstruction, ownershipAuthority: ManagerOwnershipAuthority, options: BleManagerOptions): Promise>; export declare class ScanSession { private readonly session; constructor(session: CoreScanSession); get scanSessionId(): CoreScanSession['scanSessionId']; get leaseId(): CoreScanSession['leaseId']; get shareToken(): CoreScanSession['shareToken']; get observations(): BoundedAsyncStream>; stop(): Promise; } export declare class Connection> implements BleConnectionHandle { private readonly connection; constructor(connection: CoreConnection); get peerId(): PeerId; get connectionId(): import("../backend-contract/index.js").ConnectionId; get ownerLeaseId(): import("../backend-contract/index.js").LeaseId; get connectionGeneration(): import("../backend-contract/index.js").GenerationId<"connection-generation", string>; get events(): BoundedAsyncStream>; discover(options: PortableOperationOptions): Promise>; rediscoverGatt(options: PortableOperationOptions, reason: Extract): Promise>; release(): Promise; disconnect(): Promise; readRssi(options: PortableOperationOptions): Promise>; requestMtu(requestedMtu: number, options: PortableOperationOptions): Promise>; effectiveMtu(): Promise>; requestPriority(priority: ConnectionPriority, options: PortableOperationOptions): Promise>; readPhy(options: PortableOperationOptions): Promise>; requestPhy(preference: PhyPreference, options: PortableOperationOptions): Promise>; maximumWriteLength(mode: WriteMode, options: PortableOperationOptions): Promise>; writeWithoutResponseReadiness(options?: PortableOperationOptions): Promise>; } export declare class DiscoveredGattDatabase> implements DiscoveredGattDatabaseHandle { private readonly database; private readonly discoverySnapshot; constructor(database: CoreGattDatabase, discoverySnapshot: GattDatabaseSnapshot); get path(): import("../backend-contract/index.js").DatabasePath; monotonicNow(): number; assertCurrent(): void; get changed(): BoundedAsyncStream; scheduleDeadline(deadlineAt: number, action: () => void): DeadlineHandle; snapshot(): Promise>; read(path: PortableCurrentCharacteristicPath, options: PortableOperationOptions): Promise; write(path: PortableCurrentCharacteristicPath, bytes: Readonly, options: PortableWritePolicy): Promise>; writeWhenReady(path: PortableCurrentCharacteristicPath, bytes: Readonly, options: PortableWritePolicy): Promise>; maximumWriteLength(path: PortableCurrentCharacteristicPath, mode: WriteMode): Promise>; writeLong(path: PortableCurrentCharacteristicPath, bytes: Readonly, options: PortableWritePolicy): Promise>; readDescriptor(path: PortableCurrentDescriptorPath, options: PortableOperationOptions): Promise; writeDescriptor(path: PortableCurrentDescriptorPath, bytes: Readonly, options: PortableWritePolicy): Promise>; subscribe(path: PortableCurrentCharacteristicPath, options: PortableSubscriptionOptions): Promise>; private resolveCharacteristicPath; private resolveDescriptorPath; } export declare class Subscription> implements SubscriptionHandle { private readonly subscription; constructor(subscription: CoreSubscription); get subscriptionId(): import("../backend-contract/index.js").SubscriptionId; get path(): CharacteristicPath; get values(): BoundedAsyncStream; remove(): Promise; } export declare const DEFAULT_BLE_MANAGER_OPTIONS: BleManagerOptions; //# sourceMappingURL=ble-manager.d.ts.map