import type { EncryptionKeyDeriver } from '../types/encryption-types.js';
import type { PrivateKeyJwk } from '../types/jose-types.js';
import type { ProtocolDefinition, ProtocolRuleSet } from '../types/protocols-types.js';
/**
 * Result of parsing a cross-protocol reference in `alias:path` format.
 */
export type CrossProtocolRef = {
    /** The alias key from the `uses` map. */
    alias: string;
    /** The protocol path within the referenced protocol. */
    protocolPath: string;
};
/**
 * Parses a string that may be a cross-protocol reference in `alias:path` format.
 * Returns `undefined` if the string is a local (non-cross-protocol) reference.
 *
 * Examples:
 * - `"threads:thread"` → `{ alias: "threads", protocolPath: "thread" }`
 * - `"threads:thread/participant"` → `{ alias: "threads", protocolPath: "thread/participant" }`
 * - `"thread/comment"` → `undefined` (local reference, no alias)
 */
export declare function parseCrossProtocolRef(ref: string): CrossProtocolRef | undefined;
/**
 * Returns `true` if the given string contains a `:` indicating a cross-protocol reference.
 */
export declare function isCrossProtocolRef(ref: string): boolean;
/**
 * Extracts the last segment of a protocolPath — i.e. the type name.
 * e.g. `'thread/comment'` → `'comment'`, `'note'` → `'note'`.
 */
export declare function getTypeName(protocolPath: string): string;
/**
 * Gets the rule set at a given protocol path within a protocol definition's structure tree.
 * Returns `undefined` if the path does not exist.
 */
export declare function getRuleSetAtPath(protocolPath: string, structure: {
    [key: string]: ProtocolRuleSet;
}): ProtocolRuleSet | undefined;
/**
 * Class containing Protocol related utility methods.
 */
export declare class Protocols {
    /**
     * Derives public encryption keys and injects them in `$keyAgreement`.
     * NOTE: The original definition passed in is unmodified.
     *
     * `$ref` nodes (cross-protocol attachment points) are skipped during `$keyAgreement` injection
     * because their records belong to the referenced protocol, whose own encryption keys govern them.
     * Children of `$ref` nodes are still processed because they belong to the composing protocol.
     *
     * Overload 1 (callback-based): Accepts an EncryptionKeyDeriver that performs
     * key derivation internally. The private key never leaves the caller's boundary.
     */
    static deriveAndInjectPublicEncryptionKeys(protocolDefinition: ProtocolDefinition, keyDeriver: EncryptionKeyDeriver): Promise<ProtocolDefinition>;
    /**
     * Overload 2 (raw-key): Takes rootKeyId and raw PrivateKeyJwk directly.
     */
    static deriveAndInjectPublicEncryptionKeys(protocolDefinition: ProtocolDefinition, rootKeyId: string, privateJwk: PrivateKeyJwk): Promise<ProtocolDefinition>;
}
//# sourceMappingURL=protocols.d.ts.map