RenderOptions
tcmts.loader.RenderOptions · #jtjpsvlm · type
import type { Kept, Style } from "#codebase/tcmts/loader";
export interface RenderOptions {
style: Style;
/** rewrite references (used by update propagation) */
remap?: (hash: string) => string;
/** re-pin packages: the module each `npm:` import should use instead (`npm:react@18` → `npm:react@19`) */
remapPackage?: (module: string) => string;
/** leave out import lines (for showing a definition's body, e.g. in diffs) */
omitImports?: boolean;
/** names to render with instead of the current branch's (a diff shows each side with its own names) */
nameOf?: (hash: string) => string | undefined;
/** scratch style: a comment line to put above a member, given the identifier it is declared as */
annotate?: (hash: string, declaredAs: string) => string | undefined;
/** put `export` on each member's declaration (for type/value pair modules) */
exportDeclarations?: boolean;
/** put documentation above members (scratch style always does; `tcm pack` wants it in declarations) */
docs?: boolean;
/** keep every identifier as it is written in the stored source (migration re-derives text-identical code) */
preserveText?: boolean;
/** cache style: pure constants' kept values, emitted instead of computing them (`DefSource.kept`) */
kept?: (hash: string) => Kept | undefined;
/** scratch style: the directory the file is in (default the project's): a definition imported by hash is imported
* from the cache by a path from there */
dir?: string;
/** local names not to give imports (names the text this goes with binds otherwise): another is chosen (`Move_1`) */
avoid?: Iterable<string>;
}
uses
used by