declare const backendContractBrand: unique symbol; export type Brand = Value & { readonly [backendContractBrand]: { readonly kind: Kind; readonly scope: Scope; }; }; export type OpaqueId = Brand; export type AttachmentId = OpaqueId<'attachment', Attachment>; export type AdapterId = OpaqueId<'adapter', Attachment>; export type BackendInstanceId = OpaqueId<'backend-instance', Attachment>; export type ManagerId = OpaqueId<'manager', `${Attachment}:${Manager}`>; export type GenerationId = OpaqueId; export type PeerId = OpaqueId<'peer', Attachment>; export type ConnectionId = OpaqueId<'connection', `${Attachment}:${Connection}`>; export type LeaseId = OpaqueId<'lease', `${Attachment}:${Lease}`>; export type ScanShareToken = OpaqueId<'scan-share-token', `${Attachment}:${Lease}`>; export type ScanSessionId = OpaqueId<'scan-session', `${Attachment}:${Lease}`>; export type ClientId = OpaqueId<'client', `${Attachment}:${Client}`>; export type OperationCorrelation = OpaqueId<'core-operation', `${Attachment}:${Operation}`>; export type BackendOperationHandle = OpaqueId<'backend-operation', `${Attachment}:${Operation}`>; export type NativeOperationCorrelation = OpaqueId<'native-operation', `${Attachment}:${Operation}`>; export type IpcOperationCorrelation = OpaqueId<'ipc-operation', `${Attachment}:${Operation}`>; export type GattDatabaseId = OpaqueId<'gatt-database', `${Attachment}:${Connection}:${Database}`>; export type SubscriptionId = OpaqueId<'subscription', `${Attachment}:${Connection}:${Database}:${Service}:${Characteristic}:${Subscription}`>; export type Uuid = Brand; export type OwnedBytes = Brand; export type BorrowedBytes = Readonly; export type ByteLimit = Brand; export type MonotonicTimestamp = Brand; export type Deadline = Brand; export type Capacity = Brand; export type ResourceCount = Brand; export type BackendContractAxis = 'backend-contract'; export type CapabilitySchemaAxis = 'capability-schema'; export type EventSchemaAxis = 'event-schema'; export type TraceFormatAxis = 'trace-format'; export type NativeProtocolAxis = 'native-protocol'; export type IpcProtocolAxis = 'ipc-protocol'; export type ProtocolAxis = BackendContractAxis | CapabilitySchemaAxis | EventSchemaAxis | TraceFormatAxis | NativeProtocolAxis | IpcProtocolAxis; export interface VersionNumber { readonly axis: Axis; readonly value: number; } export interface VersionRange { readonly axis: Axis; readonly minimum: VersionNumber; readonly maximum: VersionNumber; } export interface NegotiatedVersion { readonly axis: Axis; readonly selected: VersionNumber; readonly localRange: VersionRange; readonly remoteRange: VersionRange; } export interface BackendCompatibilityOffer { readonly backendContract: VersionRange; readonly capabilitySchema: VersionRange; readonly eventSchema: VersionRange; readonly traceFormat: VersionRange; } export interface NativeCompatibilityOffer extends BackendCompatibilityOffer { readonly nativeProtocol: VersionRange; } export interface IpcCompatibilityOffer extends BackendCompatibilityOffer { readonly ipcProtocol: VersionRange; } export interface CoreVersionAxes { readonly backendContract: NegotiatedVersion; readonly capabilitySchema: NegotiatedVersion; readonly eventSchema: NegotiatedVersion; readonly traceFormat: NegotiatedVersion; } export interface NativeVersionAxes extends CoreVersionAxes { readonly nativeProtocol: NegotiatedVersion; } export interface IpcVersionAxes extends CoreVersionAxes { readonly ipcProtocol: NegotiatedVersion; } export type HostNeutralVersionAxes = CoreVersionAxes; export type ApplicableCompatibilityOffer = BackendCompatibilityOffer | NativeCompatibilityOffer | IpcCompatibilityOffer; export type ApplicableVersionAxes = HostNeutralVersionAxes | NativeVersionAxes | IpcVersionAxes; export interface ByteLimits { readonly maximumOperationBytes: ByteLimit; readonly maximumAdvertisementBytes: ByteLimit; readonly maximumStreamItemBytes: ByteLimit; readonly maximumRetainedBytes: ByteLimit; } export interface ByteOwnership { readonly input: 'caller-borrows-until-settlement'; readonly retainedInput: 'backend-copies-before-retention'; readonly output: 'receiver-owns-independent-copy'; readonly boundary: 'copy-or-transfer-with-explicit-owner'; } export interface AttachmentBinding { readonly attachmentId: AttachmentId; readonly backendInstanceId: BackendInstanceId; readonly backendGeneration: GenerationId<'backend-generation', Attachment>; readonly adapterId: AdapterId; readonly adapterGeneration: GenerationId<'adapter-generation', Attachment>; } export interface AttachmentBoundIdFactory { clientId(value: string): ClientId; managerId(value: string): ManagerId; connectionId(value: string): ConnectionId; leaseId(value: string): LeaseId; scanShareToken(value: string): ScanShareToken; scanSessionId(value: string): ScanSessionId; databaseId(value: string): GattDatabaseId; subscriptionId(value: string): SubscriptionId; operationCorrelation(value: string): OperationCorrelation; backendOperationHandle(value: string): BackendOperationHandle; } export interface IpcOperationIdFactory { ipcOperationCorrelation(value: string): IpcOperationCorrelation; ipcDispatchEpoch(value: string): GenerationId<'ipc-dispatch-epoch', `${Attachment}:${string}`>; } type AttachmentFromBoundScope = Scope extends `${infer Attachment}:${string}` ? Attachment : never; export type Scalar = boolean | number | string | null; export type SerializableValue = Scalar | OwnedBytes | readonly SerializableValue[] | SerializableRecord; export interface SerializableRecord { readonly [key: string]: SerializableValue; } export declare function opaqueId(value: string, kind: Kind, scope: Scope): OpaqueId; /** Creates a peer identifier using the same attachment-bound scope as other runtime identifiers. */ export declare function createAttachmentBoundPeerId(binding: AttachmentBinding, value: string): PeerId; export declare function createAttachmentBoundIdFactory(binding: AttachmentBinding): AttachmentBoundIdFactory; /** Creates renderer-local IPC correlation IDs scoped to one already-attached backend generation. */ export declare function createIpcOperationIdFactory(scope: string): IpcOperationIdFactory; export declare function rebindAttachmentBoundId(id: OpaqueId, source: AttachmentBinding>, target: AttachmentBinding>): OpaqueId; export declare function canonicalUuid(value: string): Uuid; /** * Canonicalizes a 48-bit BLE radio address to uppercase colon-separated octets. * Accepts ':' or '-' separators in any case; rejects every other shape. This * canonical form only identifies peers using public or static random addresses; * peers using resolvable private addresses have no stable radio address and * must be re-entered through a durable `PeerReference` instead. */ export declare function canonicalBleAddress(value: string): string; export declare function byteLimit(value: number): ByteLimit; export declare function capacity(value: number): Capacity; export declare function resourceCount(value: number): ResourceCount; export declare function monotonicTimestamp(value: number): MonotonicTimestamp; export declare function deadline(value: number): Deadline; export declare function ownBytes(bytes: BorrowedBytes, maximumBytes: ByteLimit): OwnedBytes; export declare function version(axis: Axis, value: number): VersionNumber; export declare function versionRange(minimum: VersionNumber, maximum: VersionNumber): VersionRange; export declare function negotiateVersion(localRange: VersionRange, remoteRange: VersionRange): NegotiatedVersion; export declare function negotiateCoreVersions(local: BackendCompatibilityOffer, remote: BackendCompatibilityOffer): CoreVersionAxes; export declare function assertCoreVersionsAccepted(versions: CoreVersionAxes, offer: BackendCompatibilityOffer): void; export declare function assertIpcVersionsAccepted(versions: IpcVersionAxes, offer: IpcCompatibilityOffer): void; export declare function applicableVersionAxesEqual(left: ApplicableVersionAxes, right: ApplicableVersionAxes): boolean; export declare function snapshotApplicableVersionAxes(versions: ApplicableVersionAxes): ApplicableVersionAxes; export {}; //# sourceMappingURL=primitives.d.ts.map