import * as v from 'valibot'; import type { OasOperation } from '../../oas/operation/Operation.js'; import type { EnrichmentRequest } from '../../types/EnrichmentRequest.js'; import type { IsSupportedArgs, ToOperationPreviewModuleArgs, ToOperationMappingArgs, TransformOperationArgs } from './types.js'; import type { IsSupportedOperationConfigArgs } from './types.js'; import type { MappingModule, PreviewModule } from '../../types/Preview.js'; /** * Configuration arguments for creating operation generator entries. * * Defines the structure for operation generator configuration including transform functions, * enrichment schemas, preview/mapping modules, and support validation. * * @template EnrichmentType - Type of enrichment data this operation can provide * @template Acc - Accumulator type used during operation processing */ export type ToOperationConfigArgs = { id: string; transform: ({ context, operation, acc }: TransformOperationArgs) => Acc; toEnrichmentSchema?: () => v.GenericSchema; isSupported?: ({ context, operation }: IsSupportedOperationConfigArgs) => boolean; toPreviewModule?: ({ context, operation }: ToOperationPreviewModuleArgs) => PreviewModule; toMappingModule?: ({ context, operation }: ToOperationMappingArgs) => MappingModule; toEnrichmentRequest?: (operation: OasOperation) => EnrichmentRequest | undefined; }; /** * Creates a configured operation generator entry. * * Transforms operation configuration arguments into a standardized operation generator entry * that can be used within the SKMTC generation pipeline. Provides type-safe operation processing * with optional enrichment support and preview capabilities. * * @template EnrichmentType - Type of enrichment data this operation provides * @template Acc - Accumulator type used during operation processing * @param config - Configuration object defining operation behavior * @returns Configured operation generator entry ready for pipeline integration * * @example Basic operation entry * ```typescript * import { toOperationEntry } from '@skmtc/core'; * * const operationEntry = toOperationEntry({ * id: 'my-operation-generator', * transform: ({ context, operation, acc }) => { * // Transform operation into desired format * return processedOperation; * }, * isSupported: ({ operation }) => { * return operation.method === 'POST'; * } * }); * ``` */ export declare const toOperationEntry: ({ id, transform, toEnrichmentSchema, isSupported, toPreviewModule, toMappingModule, toEnrichmentRequest }: ToOperationConfigArgs) => { id: string; type: "operation"; transform: ({ context, operation, acc }: TransformOperationArgs) => Acc; toEnrichmentSchema?: () => v.GenericSchema; isSupported: ({ context, operation }: IsSupportedArgs) => boolean; toPreviewModule?: ({ context, operation }: ToOperationPreviewModuleArgs) => PreviewModule; toMappingModule?: ({ context, operation }: ToOperationMappingArgs) => MappingModule; toEnrichmentRequest?: (operation: OasOperation) => EnrichmentRequest | undefined; }; //# sourceMappingURL=toOperationEntry.d.ts.map