import type { InterfaceType, Property } from '@jsii/spec'; import type { HasStructSpec } from '../builder'; /** * Options for `TypeScriptRenderer`. */ export interface TypeScriptRendererOptions { /** * The module locations assemblies should be imported from * * All types are imported from the top-level of the module. * This map can be used to overwrite the default import locations. * * For local imports, the import traverse up a number of levels equivalent to the number of fqn parts of the rendered type. * E.g. if the the rendered type is `pkg.interface`, it is assumed to be at the top-level and imports from the same assembly would be from `./`. * If the rendered type is `pkg.nested.sub.interface` a local import will be from `../../`. * * @default - uses the assembly name for external packages * local imports traverse up a number of levels equivalent to the number of fqn parts */ readonly importLocations?: Record; /** * Indentation size * * @default 2 */ readonly indent?: number; /** * Use explicit `type` imports when importing referenced modules. * * @see https://www.typescriptlang.org/docs/handbook/modules.html#importing-types * @default true */ readonly useTypeImports?: boolean; } /** * Jsii to TypeScript renderer */ export declare class TypeScriptRenderer { private buffer; private options; constructor(options?: TypeScriptRendererOptions); /** * Render something that has a struct spec */ renderStruct(struct: HasStructSpec): string; /** * Render a jsii InterfaceType spec */ renderStructSpec(spec: InterfaceType): string; protected renderImports(modules: Map>): void; protected renderProperty(p: Property, containingFqn: string): void; protected renderDocBlock(lines: string[]): void; }