UNPKG

haystack-codegen

Version:

Project Haystack Core code generation tools

37 lines (36 loc) 1.09 kB
import { Kind } from 'haystack-core'; import { Node } from './Node'; /** * Generates a value line in a TypeScript interface. */ export declare class InterfaceValueNode implements Node { readonly name: string; readonly doc: string; readonly type: string; readonly kind: Kind; readonly genericType?: string; readonly genericKind?: Kind; readonly optional: boolean; /** * The number of new lines after this node is set dynamically depending on its * position in the parent interface. */ newLines: number; constructor({ name, type, kind, doc, genericType, genericKind, optional, }: { name: string; type: string; kind: Kind; doc?: string; genericType?: string; genericKind?: Kind; optional?: boolean; }); generateCode(out: (code: string) => void): void; /** * Returns the types (haystack-core constructor names) used with this node. * * @param kind The kind. * @returns The TypeScript haystack constructor names. */ get types(): string[]; }