import { Address } from '@hyperlane-xyz/utils'; import { ChainTechnicalStack } from '../metadata/chainMetadataTypes.js'; import { DelayedFlowRouterHookConfig, DerivedHookConfig, HookConfig, HookType, NetFlowRateLimitedHookConfig } from './types.js'; /** * Strips the PREDICATE sub-hook from an aggregation hook config. * If the aggregation contains exactly one non-predicate hook, unwraps it. * Returns the hook unchanged if no predicate is found or multiple remain. */ export declare function stripPredicateSubHook(hook: DerivedHookConfig | string): DerivedHookConfig | string; export declare function hookTreeContainsRateLimited(hook: HookConfig | undefined): boolean; export declare function hookTreeContainsLegacyIgp(hook: HookConfig | undefined): boolean; /** * The hook-surface view of a warp-route hybrid hook/ISM. One contract instance * is installed as BOTH the router's hook and its ISM, so the same node is * declared on both surfaces; the ISM-surface counterpart lives in * ../ism/types.js and shares these `type` strings. */ export type HybridHookNodeConfig = NetFlowRateLimitedHookConfig | DelayedFlowRouterHookConfig; export declare function isHybridHookNode(hook: HookConfig | undefined): hook is HybridHookNodeConfig; /** * Rebuilds a hook tree, applying `mapNode` to every hybrid hook/ISM node and * leaving every other node identical. The traversal covers the same containers * as `hookTreeContains`, so the two agree on what "in the tree" means. */ export declare function mapHybridHookNodes(hook: HookConfig, mapNode: (node: HybridHookNodeConfig) => HookConfig): HookConfig; /** Every hybrid hook/ISM node declared anywhere in a hook tree. */ export declare function collectHybridHookNodes(hook: HookConfig | undefined): HybridHookNodeConfig[]; export declare function hookTreeContainsHybridHookIsm(hook: HookConfig | undefined): boolean; /** * Replaces every hybrid hook/ISM node in a hook tree with the address of the * deployed instance, so the remaining parent tree can be handed to * EvmHookModule — which deploys parents but rejects the hybrid types, whose * single instance is deployed once and shared with the ISM surface. */ export declare function resolveHybridHookNodesToAddress(hook: HookConfig, address: Address): HookConfig; /** ISM-side counterpart: collapse only an already-installed matching leaf. */ export declare function collapseMatchingHybridHookNodes(hook: HookConfig, address: Address): HookConfig; export declare const isHookCompatible: ({ hookType, chainTechnicalStack, }: { hookType: HookType; chainTechnicalStack?: ChainTechnicalStack; }) => boolean; //# sourceMappingURL=utils.d.ts.map