fork of hey-api/openapi-ts because I need some additional things
at main 30 lines 734 B view raw
1import type { IProjectRenderMeta } from './extensions'; 2import type { File } from './files/file'; 3import type { AstContext } from './nodes/context'; 4import type { IProject } from './project/types'; 5 6export interface RenderContext { 7 /** 8 * The context passed to `.toAst()` methods. 9 */ 10 astContext: AstContext; 11 /** 12 * The current file. 13 */ 14 file: File; 15 /** 16 * Arbitrary metadata. 17 */ 18 meta?: IProjectRenderMeta; 19 /** 20 * The project the file belongs to. 21 */ 22 project: IProject; 23} 24 25export interface Renderer { 26 /** Renders the given file. */ 27 render(ctx: RenderContext): string; 28 /** Returns whether this renderer can render the given file. */ 29 supports(ctx: Omit<RenderContext, 'astContext'>): boolean; 30}