/**
 * WriterId - CRDT-safe writer identity generation and resolution.
 *
 * Provides utilities for generating stable, globally unique writer IDs
 * that are safe for use in Git refs and CRDT version vectors.
 *
 * @module domain/utils/WriterId
 * @see WARP WriterId Spec v1
 */
/**
 * Typed error for WriterId generation and resolution failures.
 */
export declare class WriterIdError extends Error {
    readonly code: string;
    readonly cause: Error | undefined;
    /**
     * Constructs a WriterIdError with a code and optional cause.
     */
    constructor(code: string, message: string, cause?: Error);
}
/**
 * Validates that a writer ID is in canonical format.
 *
 * Canonical format:
 * - Prefix: `w_`
 * - Body: 26 chars Crockford Base32 (lowercase)
 * - Total length: 28 chars
 *
 * @throws {WriterIdError} If the ID is not canonical
 *
 * @example
 * validateWriterIdCanonical('w_0123456789abcdefghjkmnpqrs'); // OK
 * validateWriterIdCanonical('alice'); // throws INVALID_CANONICAL
 */
export declare function validateWriterIdCanonical(id: string): void;
/**
 * Generates a new canonical writer ID.
 *
 * Uses 128 bits of entropy (16 bytes) encoded as Crockford Base32.
 * The result is prefixed with `w_` for a total length of 28 characters.
 *
 * @throws {WriterIdError} If RNG is unavailable or returns wrong shape
 *
 * @example
 * const id = generateWriterId();
 * // => 'w_abc123...' (26 random chars after prefix)
 *
 * @example
 * // With custom RNG for deterministic testing
 * const id = generateWriterId({ randomBytes: mySeededRng });
 */
export declare function generateWriterId(options?: {
    randomBytes?: (n: number) => Uint8Array;
}): string;
interface ResolveWriterIdArgs {
    readonly graphName: string;
    readonly explicitWriterId: string | null | undefined;
    readonly configGet: (key: string) => Promise<string | null>;
    readonly configSet: (key: string, value: string) => Promise<void>;
}
/**
 * Resolves a writer ID with repo-local persistence.
 *
 * Resolution order:
 * 1. If `explicitWriterId` is provided, validate (ref-safe) and return it
 * 2. Load from git config key `warp.writerId.<graphName>`
 * 3. If missing or invalid, generate new canonical ID, persist, and return
 *
 * @throws {WriterIdError} If config operations fail
 *
 * @example
 * const writerId = await resolveWriterId({
 *   graphName: 'events',
 *   explicitWriterId: undefined,
 *   configGet: async (key) => git.config.get(key),
 *   configSet: async (key, val) => git.config.set(key, val),
 * });
 */
export declare function resolveWriterId({ graphName, explicitWriterId, configGet, configSet }: ResolveWriterIdArgs): Promise<string>;
export {};
