import { HashAlgorithm } from '@ibgib/helper-gib/dist/helpers/utils-helper.mjs'; import { KeystonePoolConfig, KeystonePoolConfig_HashV1, KeystonePoolBehavior, KeystoneReplenishStrategy, KeystonePoolConfigBase, KeystoneChallengeType } from './keystone-types.mjs'; import { KeystoneBehaviorProfileTemplate, KeystonePoolTemplate } from './keystone-policy-types.mjs'; export { KeystoneBehaviorProfileTemplate, KeystonePoolTemplate }; /** * Abstract Base Builder. * Handles configuration common to ALL strategies (Salt, Size, Replenishment, Selection). * * @template TConfig The concrete config type being built. */ export declare abstract class KeystoneConfigBuilderBase { protected _id: string | undefined; protected _salt: string | undefined; protected _size: number | undefined; protected _replenish: KeystoneReplenishStrategy | undefined; protected _seq: number | undefined; protected _rand: number | undefined; protected _verbs: string[]; protected _targetBinding: number | undefined; /** * Sets the unique id for this pool. */ withId(id: string): this; /** * Sets the unique salt for this pool. */ withSalt(salt: string): this; /** * Sets the total number of challenges to maintain in the pool. */ withSize(size: number): this; /** * Binds challenge selection to the content address of the target. * @param chars Number of hex characters to match (e.g. 4). */ withTargetBinding(chars: number): this; /** * Configures the pool to use strictly Sequential (FIFO) selection. * @param count Number of challenges to consume per sign. */ withFIFO(count: number): this; /** * Configures the pool to use strictly Random selection. * @param count Number of challenges to consume per sign. */ withRandom(count: number): this; /** * Configures the pool to use Hybrid (Both FIFO and Random) selection. */ withHybrid({ seqCount, randCount }: { seqCount: number; randCount: number; }): this; /** * Sets the replenishment strategy. */ withReplenishStrategy(strategy: KeystoneReplenishStrategy): this; /** * Constructs the behavioral config object. * Helper for subclasses. */ protected buildBehavior(): KeystonePoolBehavior; /** * Restricts this pool to specific verbs. * @param verbs List of verb addresses (e.g. 'revoke^gib') */ forVerbs(verbs: string[]): this; abstract build(): TConfig; } /** * Concrete Builder for Hash-Reveal V1 Strategy. */ export declare class KeystoneConfigBuilder_HashV1 extends KeystoneConfigBuilderBase { protected lc: string; private _algo; private _rounds; /** * Sets the hashing strength. */ withHash({ algo, rounds }: { algo: HashAlgorithm; rounds: number; }): this; build(): KeystonePoolConfig_HashV1; } export declare class KeystoneConfig { static hash(): KeystoneConfigBuilder_HashV1; } interface KeystoneConfigFactoryOptions_Standard { /** * id for pool that this config pertains to */ id: string; /** * should be a unique string */ salt: string; /** * number of challenges in the pool * @see {@link KeystonePoolConfig} */ size?: number; /** * number of sequential challenges required for solution per action */ sequential?: number; /** * number of random challenges required for solution per action */ random?: number; /** * number of target binding characters required for solution per action * @see {@link KeystonePoolBehavior.targetBindingChars} */ targetBinding?: number; /** * @see {@link KeystonePoolBehavior.replenish} */ replenishStrategy?: KeystoneReplenishStrategy; /** * verbs for the pool */ verbs?: string[]; type?: KeystoneChallengeType; hashAlgorithm?: HashAlgorithm; hashRounds?: number; } export declare function createStandardPoolConfig(opts: KeystoneConfigFactoryOptions_Standard): KeystonePoolConfig; export declare function createHighSecurityPoolConfig(opts: KeystoneConfigFactoryOptions_Standard): KeystonePoolConfig; export declare function createManagePoolConfig(opts: KeystoneConfigFactoryOptions_Standard): KeystonePoolConfig; export declare function createRevocationPoolConfig(opts: KeystoneConfigFactoryOptions_Standard): KeystonePoolConfig; export declare function createSyncPoolConfig(opts: KeystoneConfigFactoryOptions_Standard): KeystonePoolConfig; export declare function createConnectPoolConfig(opts: KeystoneConfigFactoryOptions_Standard): KeystonePoolConfig; /** * Builds a KeystonePoolConfig from a JSON-sourced KeystonePoolTemplate. */ export declare function createPoolConfigFromJson({ template, salt }: { template: KeystonePoolTemplate; salt: string; }): KeystonePoolConfig; //# sourceMappingURL=keystone-config-builder.d.mts.map