import type { ExecutableStep } from 'postgraphile/grafast';
import type { FieldArgs } from 'postgraphile/grafast';
import type { FieldInfo } from 'postgraphile/grafast';
import type { PlanWrapperFn } from 'postgraphile/utils';
import type { PlanWrapperRule } from 'postgraphile/utils';

/**
 * Creates a PostGraphile plugin that wraps GraphQL query and mutation plans with before/after hooks
 * @param hookMap - Configuration mapping field names to before/after hook functions
 * @public
 */
export declare const createPglRockfoilPlugin: (hookMap: HookConfig) => GraphileConfig.Plugin;

/**
 * Configuration object mapping field names to their before/after hooks for queries and mutations
 * @public
 */
export declare interface HookConfig {
    /**
     * Hook configuration for a specific field
     */
    [fieldName: string]: {
        /** Function to execute before a query operation */
        beforeQuery?: PlanWrapperFn;
        /** Function to execute after a query operation */
        afterQuery?: (result: any, plan: any, $source: ExecutableStep, fieldArgs: FieldArgs, info: FieldInfo) => any;
        /** Function to execute before a mutation operation */
        beforeMutation?: PlanWrapperFn;
        /** Function to execute after a mutation operation */
        afterMutation?: (result: any, plan: any, $source: ExecutableStep, fieldArgs: FieldArgs, info: FieldInfo) => any;
    };
}

/**
 * Internal mapping of field names to their plan wrapper rules
 * @public
 */
export declare interface HookPlan {
    /**
     * Plan wrapper rule for a specific field
     */
    [fieldName: string]: PlanWrapperRule;
}

export { }
