import type { OperationNode, SchemaNode } from '@kubb/ast/types' import type { Config, Plugin, PluginFactoryOptions } from '@kubb/core' import type { Operation, SchemaObject } from '@kubb/oas' import type { OperationGenerator } from '../OperationGenerator.ts' import type { SchemaGenerator, SchemaGeneratorOptions } from '../SchemaGenerator.ts' import type { Schema } from '../SchemaMapper.ts' import type { CoreGenerator } from './createGenerator.ts' import type { ReactGenerator } from './createReactGenerator.ts' export type Version = '1' | '2' export type OperationsV1Props = { config: Config generator: Omit, 'build'> plugin: Plugin operations: Array } export type OperationsV2Props = { config: Config plugin: Plugin nodes: Array } export type OperationV1Props = { config: Config generator: Omit, 'build'> plugin: Plugin operation: Operation } export type OperationV2Props = { config: Config plugin: Plugin node: OperationNode } export type OperationsProps = TVersion extends '2' ? OperationsV2Props : OperationsV1Props export type OperationProps = TVersion extends '2' ? OperationV2Props : OperationV1Props export type SchemaV1Props = { config: Config generator: Omit, 'build'> plugin: Plugin schema: { name: string tree: Array value: SchemaObject } } export type SchemaV2Props = { config: Config plugin: Plugin node: SchemaNode } export type SchemaProps = TVersion extends '2' ? SchemaV2Props : SchemaV1Props export type Generator = TVersion extends Version ? CoreGenerator | ReactGenerator : never