import type { PluginFactoryOptions } from '@kubb/core' import type { KubbFile } from '@kubb/fabric-core/types' import type { OperationProps, OperationsProps, SchemaProps, Version } from './types.ts' type UserGenerator = { name: string version?: TVersion operations?: (props: OperationsProps) => Promise operation?: (props: OperationProps) => Promise schema?: (props: SchemaProps) => Promise } export type CoreGenerator = { name: string type: 'core' version: TVersion operations: (props: OperationsProps) => Promise operation: (props: OperationProps) => Promise schema: (props: SchemaProps) => Promise } export function createGenerator( generator: UserGenerator, ): CoreGenerator { return { type: 'core', version: (generator.version ?? '1') as TVersion, async operations() { return [] }, async operation() { return [] }, async schema() { return [] }, ...generator, } }