/**
 * Schema Flattening Utilities for URL State Management
 *
 * Converts nested GraphQL input types to flat URL parameter mappings.
 * Example: { filter: { severity: [...] } } → URL params: ?severity=...
 */
import { VariableDefinition, JSType } from './graphql-parser';
import { GraphQLIntrospector } from './introspection';
/**
 * Flattened URL parameter configuration
 *
 * Maps URL parameter names to their GraphQL variable paths
 */
export interface FlattenedParam {
    /** URL parameter name (e.g., "severity") */
    urlParamName: string;
    /** Path in GraphQL variables (e.g., "filter.severity") */
    graphqlPath: string;
    /** JavaScript type for URL handling */
    type: JSType;
    /** Default value for this parameter */
    defaultValue?: any;
    /** Whether this parameter is required */
    required?: boolean;
    /** Whether this parameter is an array */
    isArray?: boolean;
}
/**
 * Flatten GraphQL query variables to URL parameter schema
 *
 * Takes top-level query variables and flattens nested input objects
 * to create a simple URL parameter mapping.
 *
 * @param queryVariables - Variables extracted from GraphQL query
 * @param introspector - Introspector instance with loaded schema
 * @returns Flattened parameter schema for URL handling
 *
 * @example
 * Input variables:
 * {
 *   search: { type: 'string', ... },
 *   filter: { type: 'object', graphqlTypeName: 'LogFilterInput' },
 *   cursor: { type: 'string', ... }
 * }
 *
 * Output schema:
 * {
 *   search: { urlParamName: 'search', graphqlPath: 'search', type: 'string' },
 *   severity: { urlParamName: 'severity', graphqlPath: 'filter.severity', type: 'array' },
 *   toolType: { urlParamName: 'toolType', graphqlPath: 'filter.toolType', type: 'array' },
 *   cursor: { urlParamName: 'cursor', graphqlPath: 'cursor', type: 'string' }
 * }
 *
 * URL: ?search=error&severity=critical&toolType=tactical&cursor=abc
 */
export declare function flattenQueryVariables(queryVariables: Record<string, VariableDefinition>, introspector: GraphQLIntrospector): Promise<Record<string, FlattenedParam>>;
/**
 * Merge default values into flattened schema
 *
 * @param schema - Flattened parameter schema
 * @param defaults - Default values keyed by URL param name
 * @returns Updated schema with default values
 */
export declare function mergeDefaults(schema: Record<string, FlattenedParam>, defaults: Record<string, any>): Record<string, FlattenedParam>;
/**
 * Validate that flattened schema has no conflicts
 *
 * Ensures that no two parameters map to the same URL param name
 *
 * @param schema - Flattened parameter schema
 * @throws Error if conflicts are detected
 */
export declare function validateSchema(schema: Record<string, FlattenedParam>): void;
/**
 * Get all array-type parameters from schema
 *
 * Useful for knowing which URL params should use repeated values
 * (e.g., ?severity=error&severity=warning)
 *
 * @param schema - Flattened parameter schema
 * @returns Array parameter names
 */
export declare function getArrayParams(schema: Record<string, FlattenedParam>): string[];
/**
 * Get required parameters from schema
 *
 * @param schema - Flattened parameter schema
 * @returns Required parameter names
 */
export declare function getRequiredParams(schema: Record<string, FlattenedParam>): string[];
/**
 * Check if a parameter should be included in URL
 *
 * Excludes:
 * - null/undefined values
 * - Empty arrays
 * - Default values (to keep URLs clean)
 *
 * @param value - Parameter value
 * @param param - Parameter configuration
 * @returns Whether to include in URL
 */
export declare function shouldIncludeInUrl(value: any, param: FlattenedParam): boolean;
//# sourceMappingURL=flatten-schema.d.ts.map