import { PackError } from './errors.js'; /** * 16-byte UUID branded ABI. Prevents assignment from plain Uint8Array or string. * Brand field mirrors the declaration in @forgeax/engine-types for cross-package * structural compatibility (both use __guidBrand: 'AssetGuid'). */ export type AssetGuid = Uint8Array & { readonly __guidBrand: 'AssetGuid'; }; /** Pack-level identity. It is intentionally not assignable to AssetGuid. */ export type PackageId = Uint8Array & { readonly __packageIdBrand: 'PackageId'; }; /** Minimal Result alias for this module (structurally compatible with ScanResult). */ export type GuidResult = { readonly ok: true; readonly value: T; } | { readonly ok: false; readonly error: E; }; /** Stable author-owned output identity. Paths and payloads are not identity inputs. */ export declare const PACK_SOURCE_KEY_RE: RegExp; export declare function isValidPackSourceKey(value: unknown): value is string; export declare function isValidAssetGuidString(value: unknown): value is string; /** Utilities for the pack-level UUID identity. */ export declare const PackageId: { readonly parse: (dashForm: string) => GuidResult; readonly format: (value: PackageId) => string; readonly random: () => PackageId; }; /** * Utilities for the AssetGuid branded 16-byte UUID type. * Declare the type via `import type { AssetGuid } from '@forgeax/engine-pack/guid'` * or `import type { AssetGuid } from '@forgeax/engine-types'`. */ export declare const AssetGuid: { /** * Parse a 36-char RFC 4122 dash-form UUID string into an AssetGuid. * Returns Ok(AssetGuid) on success or Err(PackError) with code 'pack-guid-malformed' on failure. * Never throws for expected failures (requirements §4.2 / §14 / charter proposition 4). */ readonly parse: (dashForm: string) => GuidResult; /** * Format an AssetGuid as a 36-char RFC 4122 lowercase dash-form string. */ readonly format: (guid: AssetGuid) => string; /** * Test byte-by-byte equality between two AssetGuids. */ readonly equals: (a: AssetGuid, b: AssetGuid) => boolean; /** * Mint a new time-ordered UUIDv7 as an AssetGuid. * Works in both Node.js and browser environments. */ readonly random: () => AssetGuid; /** Derive the stable UUIDv5 projection for one Pack subject and sourceKey. */ readonly derive: (namespace: PackageId, sourceKey: string) => AssetGuid; }; //# sourceMappingURL=guid.d.ts.map