import type { ParseError, ParseWarning } from './parser/logger'; import type { ModelInfo } from './intermediate/model-info'; import type { createCodeGenerationContext } from './utils/generation'; export type PluginResult = { hasErrors: true; errors: ParseError[]; warnings?: ParseWarning[]; } | { hasErrors: false; warnings?: ParseWarning[]; }; interface ResolvedArtifactResult { identifier: string; absolutePath: string; } export interface CompilerPluginConfig { outputDir: string; } export interface CompilerPlugin { validate?: (modelInfo: ModelInfo) => Promise; afterGenerate?: (compilerPluginConfig: CompilerPluginConfig, modelInfo: ModelInfo, createGenerationContext: ReturnType) => void; resolveRamlArtifact?: (ramlId: string, identifier: string) => void | ResolvedArtifactResult; resolveGraphQLArtifact?: (type: 'types' | 'directives', name: string, identifier: string) => void | ResolvedArtifactResult; } export {};