API Reference
Complete API documentation for programmatic usage of fluent-gen-ts.
TIP
Most users will use the CLI for code generation. This API reference is for programmatic usage, custom build tools, and advanced plugin development.
Quick Links
- Code Generation: FluentGen
- Plugin System: Plugin System, Transform Builders
- Type Utilities: Type Matchers, Deep Type Transformation
- Context Types: Context Types
- Core Types: Core Types
FluentGen
Constructor
new FluentGen(options?: FluentGenOptions)FluentGenOptions
| Property | Type | Description |
|---|---|---|
outputDir | string | Output directory for generated builders |
fileName | string | File name pattern |
outputPath | string | Output file path |
useDefaults | boolean | Generate default values |
addComments | boolean | Include JSDoc comments |
contextType | string | Context type name |
tsConfigPath | string | Path to tsconfig.json |
cache | Cache | Cache instance |
pluginManager | PluginManager | Plugin manager instance |
maxDepth | number | Maximum recursion depth (1-100) |
monorepoConfig | MonorepoConfig | Monorepo configuration |
Methods
generateBuilder
async generateBuilder(filePath: string, typeName: string): Promise<Result<string>>Generates a builder for a single type.
Parameters:
filePath: Path to TypeScript file (.ts, .tsx, or .d.ts)typeName: Name of the type to generate builder for
Returns: Result<string> - Generated builder code or error
generateMultiple
async generateMultiple(
filePath: string,
typeNames: string[]
): Promise<Result<Map<string, string>>>Generates multiple builders from a single file. Creates a common.ts file with shared utilities.
Parameters:
filePath: Path to TypeScript filetypeNames: Array of type names
Returns: Result<Map<string, string>> - Map of file names to generated code
generateMultipleFromFiles
async generateMultipleFromFiles(
fileTypeMap: Map<string, string[]>
): Promise<Result<Map<string, string>>>Generates builders from multiple files.
Parameters:
fileTypeMap: Map of file paths to arrays of type names
Returns: Result<Map<string, string>> - Map of file names to generated code
generateToFile
async generateToFile(
filePath: string,
typeName: string,
outputPath?: string
): Promise<Result<string>>Generates and writes a builder to a file.
Parameters:
filePath: Source TypeScript file pathtypeName: Type nameoutputPath: Output path (optional)
Returns: Result<string> - Output file path or error
scanAndGenerate
async scanAndGenerate(pattern: string): Promise<Result<Map<string, string>>>Scans files using glob pattern and generates builders.
Parameters:
pattern: Glob pattern
Returns: Result<Map<string, string>> - Map of {filePath}:{typeName} to generated code
registerPlugin
registerPlugin(plugin: Plugin): Result<void>Registers a plugin.
Parameters:
plugin: Plugin instance
Returns: Result<void> - Success or error
clearCache
clearCache(): voidClears internal cache.
Plugin System
createPlugin
function createPlugin(name: string, version: string): PluginBuilder;Creates a new plugin builder.
Parameters:
name: Plugin nameversion: Plugin version
Returns: PluginBuilder
PluginBuilder
setDescription
setDescription(description: string): PluginBuilderSets plugin description.
requireImports
requireImports(configurator: (manager: ImportManager) => ImportManager): PluginBuilderConfigures plugin imports.
beforeParse
beforeParse(hook: (context: ParseContext) => Result<ParseContext>): PluginBuilderHook executed before parsing.
afterParse
afterParse(hook: (context: ParseContext, type: Type) => Result<Type>): PluginBuilderHook executed after parsing.
beforeResolve
beforeResolve(hook: (context: ResolveContext) => Result<ResolveContext>): PluginBuilderHook executed before type resolution.
afterResolve
afterResolve(hook: (context: ResolveContext, typeInfo: TypeInfo) => Result<TypeInfo>): PluginBuilderHook executed after type resolution.
beforeGenerate
beforeGenerate(hook: (context: GenerateContext) => Result<GenerateContext>): PluginBuilderHook executed before code generation.
afterGenerate
afterGenerate(hook: (code: string, context: GenerateContext) => Result<string>): PluginBuilderHook executed after code generation.
transformType
transformType(hook: (type: Type, typeInfo: TypeInfo) => Result<TypeInfo>): PluginBuilderTransforms type information.
transformProperty
transformProperty(hook: (property: PropertyInfo) => Result<PropertyInfo>): PluginBuilderTransforms property information.
transformPropertyMethods
transformPropertyMethods(
configurator: (builder: PropertyMethodTransformBuilder) => PropertyMethodTransformBuilder
): PluginBuilderConfigures property method transformations.
addMethod
addMethod(configurator: (builder: CustomMethodBuilder) => CustomMethodBuilder): PluginBuilderAdds custom method to builders.
transformValues
transformValues(
configurator: (builder: ValueTransformBuilder) => ValueTransformBuilder
): PluginBuilderConfigures value transformations.
transformBuildMethod
transformBuildMethod(
configurator: (builder: BuildMethodTransformBuilder) => BuildMethodTransformBuilder
): PluginBuilderTransforms build method.
transformImports
transformImports(
hook: (context: ImportTransformContext) => Result<ImportTransformContext>
): PluginBuilderTransforms import statements.
build
build(): PluginBuilds the plugin.
Type Matchers
primitive
primitive(...names: string[]): TypeMatcherMatches primitive types.
Parameters:
names: Primitive type names ('string', 'number', 'boolean', etc.)
object
object(name?: string): ObjectTypeMatcherMatches object types.
Parameters:
name: Object name (optional)
ObjectTypeMatcher Methods
withGeneric
withGeneric(name?: string): ObjectTypeMatcherMatches objects with generic parameters.
withProperty
withProperty(name: string, type?: TypeMatcher): ObjectTypeMatcherMatches objects with specific property.
withProperties
withProperties(...names: string[]): ObjectTypeMatcherMatches objects with multiple properties.
array
array(): ArrayTypeMatcherMatches array types.
ArrayTypeMatcher Methods
of
of(matcher: TypeMatcher | ((m: TypeMatcherBuilder) => TypeMatcher)): ArrayTypeMatcherSpecifies array element type.
union
union(): UnionTypeMatcherMatches union types.
UnionTypeMatcher Methods
containing
containing(matcher: TypeMatcher | ((m: TypeMatcherBuilder) => TypeMatcher)): UnionTypeMatcherMatches unions containing specific type.
exact
exact(...matchers: TypeMatcher[]): UnionTypeMatcherMatches exact union types.
intersection
intersection(): IntersectionTypeMatcherMatches intersection types.
IntersectionTypeMatcher Methods
including
including(matcher: TypeMatcher | ((m: TypeMatcherBuilder) => TypeMatcher)): IntersectionTypeMatcherMatches intersections including specific type.
exact
exact(...matchers: TypeMatcher[]): IntersectionTypeMatcherMatches exact intersection types.
Other Matchers
reference(name?: string): TypeMatcher
generic(name?: string): TypeMatcher
any(): TypeMatcher
never(): TypeMatcher
literal(value: string | number | boolean): TypeMatcher
or(...matchers: TypeMatcher[]): TypeMatcher
and(...matchers: TypeMatcher[]): TypeMatcher
not(matcher: TypeMatcher): TypeMatcherDeep Type Transformation
Utilities for recursively transforming types at any depth in the type tree.
typeInfoToString
typeInfoToString(typeInfo: TypeInfo): stringConverts a TypeInfo structure to its string representation.
Parameters:
typeInfo: The TypeInfo object to convert
Returns: String representation of the type
Example:
const stringType: TypeInfo = { kind: TypeKind.Primitive, name: 'string' };
typeInfoToString(stringType); // "string"
const arrayType: TypeInfo = {
kind: TypeKind.Array,
elementType: { kind: TypeKind.Primitive, name: 'number' },
};
typeInfoToString(arrayType); // "Array<number>"transformTypeDeep
transformTypeDeep(typeInfo: TypeInfo, transformer: TypeTransformer): stringRecursively transforms a TypeInfo structure using provided transformation handlers.
Parameters:
typeInfo: The type to transformtransformer: Object with transformation handlers for different type kinds
Returns: String representation of the transformed type
Example:
import { transformTypeDeep, primitive } from 'fluent-gen-ts';
const result = transformTypeDeep(propertyType, {
onPrimitive: type => {
if (primitive('string').match(type)) {
return 'string | { value: string }';
}
return null; // preserve original
},
});TypeTransformer
Interface for type transformation handlers:
interface TypeTransformer {
onPrimitive?: (
type: TypeInfo & { kind: TypeKind.Primitive },
) => string | TypeInfo | null;
onObject?: (
type: TypeInfo & { kind: TypeKind.Object },
) => string | TypeInfo | null;
onArray?: (
type: TypeInfo & { kind: TypeKind.Array },
) => string | TypeInfo | null;
onUnion?: (
type: TypeInfo & { kind: TypeKind.Union },
) => string | TypeInfo | null;
onIntersection?: (
type: TypeInfo & { kind: TypeKind.Intersection },
) => string | TypeInfo | null;
onGeneric?: (
type: TypeInfo & { kind: TypeKind.Generic },
) => string | TypeInfo | null;
onLiteral?: (
type: TypeInfo & { kind: TypeKind.Literal },
) => string | TypeInfo | null;
onReference?: (
type: TypeInfo & { kind: TypeKind.Reference },
) => string | TypeInfo | null;
onTuple?: (
type: TypeInfo & { kind: TypeKind.Tuple },
) => string | TypeInfo | null;
onAny?: (type: TypeInfo) => string | TypeInfo | null;
}containsTypeDeep
containsTypeDeep(typeInfo: TypeInfo, matcher: TypeMatcher): booleanChecks if a type contains a matching type at any depth.
Parameters:
typeInfo: The type to searchmatcher: Type matcher to search for
Returns: true if any nested type matches
Example:
import { containsTypeDeep, primitive } from 'fluent-gen-ts';
const hasString = containsTypeDeep(complexType, primitive('string'));
if (hasString) {
// Type contains string somewhere in its structure
}findTypesDeep
findTypesDeep(typeInfo: TypeInfo, matcher: TypeMatcher): TypeInfo[]Finds all types matching the given matcher at any depth.
Parameters:
typeInfo: The type to searchmatcher: Type matcher to search for
Returns: Array of all matching TypeInfo objects
Example:
import { findTypesDeep, primitive } from 'fluent-gen-ts';
const allStrings = findTypesDeep(complexType, primitive('string'));
console.log(`Found ${allStrings.length} string types`);TypeDeepTransformer
Fluent API for chained type transformations.
Constructor
new TypeDeepTransformer(typeInfo: TypeInfo)Methods
replace
replace(
matcher: TypeMatcher,
replacement: string | ((type: TypeInfo) => string)
): TypeDeepTransformerReplaces all occurrences of types matching the given matcher.
Example:
const transformer = new TypeDeepTransformer(propertyType);
const result = transformer
.replace(primitive('string'), 'string | { value: string }')
.replace(primitive('number'), 'number | { value: number }')
.toString();replaceIf
replaceIf(
predicate: (type: TypeInfo, depth: number, path: readonly string[]) => boolean,
replacement: string | ((type: TypeInfo) => string)
): TypeDeepTransformerReplaces types matching a custom predicate.
Example:
transformer.replaceIf(
(type, depth) => depth > 2 && type.kind === TypeKind.Primitive,
'unknown',
);hasMatch
hasMatch(matcher: TypeMatcher): booleanChecks if the type contains a match for the given matcher.
findMatches
findMatches(matcher: TypeMatcher): TypeInfo[]Finds all types matching the given matcher.
toString
toString(): stringExecutes transformations and returns the resulting type string.
Transform Builders
PropertyMethodTransformBuilder
when
when(predicate: (context: PropertyMethodContext) => boolean): PropertyMethodTransformBuilderStarts new transformation rule with condition.
setParameter
setParameter(type: string | ((original: string) => string)): PropertyMethodTransformBuilderSets parameter type transformation.
setExtractor
setExtractor(code: string): PropertyMethodTransformBuilderSets value extraction code.
setValidator
setValidator(code: string): PropertyMethodTransformBuilderSets validation code.
done
done(): PropertyMethodTransformBuilderCompletes current rule.
build
build(): (context: PropertyMethodContext) => PropertyMethodTransformBuilds transformation function.
CustomMethodBuilder
name
name(name: string): CustomMethodBuilderSets method name.
param
param(
name: string,
type: string,
options?: { optional?: boolean; defaultValue?: string }
): CustomMethodBuilderAdds method parameter.
returns
returns(type: string | ((context: BuilderContext) => string)): CustomMethodBuilderSets return type.
implementation
implementation(code: string | ((context: BuilderContext) => string)): CustomMethodBuilderSets method implementation.
jsDoc
jsDoc(doc: string): CustomMethodBuilderSets JSDoc comment.
when
when(predicate: (context: BuilderContext) => boolean): CustomMethodBuilderConditionally applies the custom method based on a predicate. When set, the method is only added to builders where the predicate returns true.
plugin.addMethod(method =>
method
.name('validate')
.implementation(ctx => `/* validate ${ctx.typeName} */`)
.when(ctx => ctx.hasProperty('email')),
);build
build(): CustomMethodDefinitionBuilds method definition.
ValueTransformBuilder
when
when(predicate: (context: ValueContext) => boolean): ValueTransformBuilderStarts new transformation rule.
transform
transform(code: string | ((value: string) => string)): ValueTransformBuilderSets transformation code.
withCondition
withCondition(condition: string): ValueTransformBuilderSets transformation condition.
done
done(): ValueTransformBuilderCompletes current rule.
build
build(): (context: ValueContext) => ValueTransform | nullBuilds transformation function.
BuildMethodTransformBuilder
insertBefore
insertBefore(marker: string | RegExp, code: string): BuildMethodTransformBuilderInserts code before marker.
insertAfter
insertAfter(marker: string | RegExp, code: string): BuildMethodTransformBuilderInserts code after marker.
replace
replace(marker: string | RegExp, replacement: string): BuildMethodTransformBuilderReplaces marker with code.
wrap
wrap(before: string, after: string): BuildMethodTransformBuilderWraps build method with code.
build
build(): (context: BuildMethodContext) => stringBuilds transformation function.
Import Management
ImportManager
addInternal
addInternal(
path: string,
imports: string | string[],
options?: {
typeOnly?: boolean;
isDefault?: boolean;
defaultName?: string;
}
): ImportManagerAdds internal import.
addExternal
addExternal(
packageName: string,
imports: string | string[],
options?: {
typeOnly?: boolean;
isDefault?: boolean;
defaultName?: string;
}
): ImportManagerAdds external import.
addInternalTypes
addInternalTypes(path: string, types: string | string[]): ImportManagerAdds internal type imports.
addExternalTypes
addExternalTypes(packageName: string, types: string | string[]): ImportManagerAdds external type imports.
addInternalDefault
addInternalDefault(path: string, defaultName: string): ImportManagerAdds internal default import.
addExternalDefault
addExternalDefault(packageName: string, defaultName: string): ImportManagerAdds external default import.
merge
merge(other: ImportManager): ImportManagerMerges imports from another manager.
deduplicate
deduplicate(): ImportManagerRemoves duplicate imports.
clear
clear(): ImportManagerClears all imports.
clone
clone(): ImportManagerCreates copy of import manager.
hasImport
hasImport(predicate: (imp: Import) => boolean): booleanChecks if import exists.
removeImports
removeImports(predicate: (imp: Import) => boolean): ImportManagerRemoves matching imports.
getImports
getImports(): readonly Import[]Returns all imports.
getGroupedImports
getGroupedImports(): {
internal: readonly InternalImport[];
external: readonly ExternalImport[];
}Returns imports grouped by type.
toImportStatements
toImportStatements(): string[]Converts to import statements.
build
build(): PluginImportsBuilds plugin imports configuration.
Plugin Manager
Constructor
new PluginManager();Methods
register
register(plugin: Plugin): voidRegisters a plugin. Throws error if validation fails or plugin name already registered.
unregister
unregister(name: string): booleanUnregisters plugin by name. Returns true if removed, false if not found.
getPlugins
getPlugins(): readonly Plugin[]Returns all registered plugins.
getPlugin
getPlugin(name: string): Plugin | undefinedReturns plugin by name or undefined.
hasPlugin
hasPlugin(name: string): booleanChecks if plugin is registered.
getPluginCount
getPluginCount(): numberReturns number of registered plugins.
getPluginsByHookType
getPluginsByHookType(hookType: HookTypeValue): readonly Plugin[]Returns plugins that implement specific hook.
executeHook
async executeHook<K extends HookTypeValue>(
options: ExecuteHookOptions<K>
): Promise<Result<ReturnType<PluginHookMap[K]>>>Executes hook across all registered plugins sequentially.
executePluginHook
async executePluginHook<K extends HookTypeValue>(
pluginName: string,
options: ExecuteHookOptions<K>
): Promise<Result<ReturnType<PluginHookMap[K]>>>Executes hook from specific plugin.
getPropertyMethodTransform
getPropertyMethodTransform(context: PropertyMethodContext): PropertyMethodTransform | nullReturns merged property method transformations from all plugins.
getCustomMethods
getCustomMethods(context: BuilderContext): readonly CustomMethod[]Returns custom methods from all plugins.
getValueTransforms
getValueTransforms(context: ValueContext): readonly ValueTransform[]Returns value transformations from all plugins.
getRequiredImports
getRequiredImports(): ImportManagerReturns deduplicated imports from all plugins.
generateImportStatements
generateImportStatements(): string[]Generates import statements from all plugins.
clear
clear(): voidRemoves all registered plugins.
Context Types
ParseContext
interface ParseContext {
readonly sourceFile: string;
readonly typeName: string;
}ResolveContext
interface ResolveContext {
readonly type: Type;
readonly symbol?: Symbol | undefined;
readonly sourceFile?: string;
readonly typeName?: string;
}GenerateContext
interface GenerateContext {
readonly resolvedType: ResolvedType;
readonly options: GeneratorOptions;
}PropertyMethodContext
interface PropertyMethodContext {
readonly typeName: string;
readonly typeInfo: TypeInfo;
readonly builderName: string;
readonly property: PropertyInfo;
readonly propertyType: TypeInfo;
readonly originalTypeString: string;
readonly type: TypeMatcherInterface;
hasGeneric(name: string): boolean;
getGenericConstraint(name: string): string | undefined;
isOptional(): boolean;
isReadonly(): boolean;
getPropertyPath(): string[];
getMethodName(): string;
}BuilderContext
interface BuilderContext {
readonly typeName: string;
readonly typeInfo: TypeInfo;
readonly builderName: string;
readonly genericParams: string;
readonly genericConstraints: string;
readonly properties: readonly PropertyInfo[];
hasProperty(name: string): boolean;
getProperty(name: string): PropertyInfo | undefined;
getRequiredProperties(): readonly PropertyInfo[];
getOptionalProperties(): readonly PropertyInfo[];
}ValueContext
interface ValueContext {
readonly property: string;
readonly valueVariable: string;
readonly type: TypeInfo;
readonly isOptional: boolean;
readonly typeChecker: TypeMatcherInterface;
}BuildMethodContext
interface BuildMethodContext {
readonly typeName: string;
readonly typeInfo: TypeInfo;
readonly builderName: string;
readonly buildMethodCode: string;
readonly properties: readonly PropertyInfo[];
readonly options: GeneratorOptions;
readonly resolvedType: ResolvedType;
readonly genericParams: string;
readonly genericConstraints: string;
}BaseBuildContext
Base context interface for builder operations. Provides information about the builder's position in the object hierarchy.
interface BaseBuildContext {
/** Parent builder identifier */
readonly parentId?: string;
/** Name of the parameter being built */
readonly parameterName?: string;
/** Index in array if building array elements */
readonly index?: number;
/** Optional custom context generator for nested builders */
readonly __nestedContextGenerator__?: NestedContextGenerator<BaseBuildContext>;
/** Additional context properties */
readonly [key: string]: unknown;
}Usage:
// Extend to create custom context types
interface MyDomainContext extends BaseBuildContext {
tenantId?: string;
nodeId?: string;
}See Custom Nested Context Generation for advanced usage.
NestedContextParams
Parameters passed to nested context generators.
interface NestedContextParams<C extends BaseBuildContext> {
/** Context from parent builder */
readonly parentContext: C;
/** Name of the parameter being built */
readonly parameterName: string;
/** Index in array if building array elements */
readonly index?: number;
}Important: Due to the deferred pattern, child builders are NOT executed when this is called. The parent can only use information from its own state and parent context.
NestedContextGenerator
Function type for generating nested context. Allows customization of how context is passed from parent to child builders.
type NestedContextGenerator<C extends BaseBuildContext> = (
params: NestedContextParams<C>,
) => C;Example:
const generator: NestedContextGenerator<MyContext> = ({
parentContext,
parameterName,
index,
}) => ({
...parentContext,
parameterName,
...(index !== undefined ? { index } : {}),
nodeId: `${parentContext.nodeId || 'root'}-${parameterName}`,
__nestedContextGenerator__: generator, // Pass it down!
});See Custom Nested Context Generation for detailed examples.
TypeMatcherInterface
interface TypeMatcherInterface {
isPrimitive(...names: string[]): boolean;
isObject(name?: string): ObjectTypeMatcher;
isArray(): ArrayTypeMatcher;
isUnion(): UnionTypeMatcher;
isIntersection(): IntersectionTypeMatcher;
isReference(name?: string): boolean;
isGeneric(name?: string): boolean;
matches(matcher: TypeMatcher): boolean;
toString(): string;
}Core Types
TypeInfo
interface TypeInfo {
kind: TypeKind;
name?: string;
properties?: PropertyInfo[];
elementType?: TypeInfo;
types?: TypeInfo[];
genericParams?: TypeInfo[];
value?: string | number | boolean;
}PropertyInfo
interface PropertyInfo {
name: string;
type: TypeInfo;
optional: boolean;
readonly: boolean;
jsDoc?: string;
}TypeKind
enum TypeKind {
Primitive = 'primitive',
Object = 'object',
Array = 'array',
Union = 'union',
Intersection = 'intersection',
Reference = 'reference',
Generic = 'generic',
Any = 'any',
Never = 'never',
Literal = 'literal',
}Plugin
interface Plugin {
readonly name: string;
readonly version: string;
readonly description?: string;
readonly imports?: PluginImports;
beforeParse?: (context: ParseContext) => Result<ParseContext>;
afterParse?: (context: ParseContext, type: Type) => Result<Type>;
beforeResolve?: (context: ResolveContext) => Result<ResolveContext>;
afterResolve?: (
context: ResolveContext,
typeInfo: TypeInfo,
) => Result<TypeInfo>;
beforeGenerate?: (context: GenerateContext) => Result<GenerateContext>;
afterGenerate?: (code: string, context: GenerateContext) => Result<string>;
transformType?: (type: Type, typeInfo: TypeInfo) => Result<TypeInfo>;
transformProperty?: (property: PropertyInfo) => Result<PropertyInfo>;
transformBuildMethod?: (context: BuildMethodContext) => Result<string>;
transformPropertyMethod?: (
context: PropertyMethodContext,
) => Result<PropertyMethodTransform>;
addCustomMethods?: (
context: BuilderContext,
) => Result<readonly CustomMethod[]>;
transformValue?: (context: ValueContext) => Result<ValueTransform | null>;
transformImports?: (
context: ImportTransformContext,
) => Result<ImportTransformContext>;
}PropertyMethodTransform
interface PropertyMethodTransform {
readonly parameterType?: string;
readonly extractValue?: string;
readonly validate?: string;
}CustomMethod
interface CustomMethod {
readonly name: string;
readonly signature: string;
readonly implementation: string;
readonly jsDoc?: string;
}ValueTransform
interface ValueTransform {
readonly condition?: string;
readonly transform: string;
}HookTypeValue
type HookTypeValue =
| 'beforeParse'
| 'afterParse'
| 'beforeResolve'
| 'afterResolve'
| 'beforeGenerate'
| 'afterGenerate'
| 'transformType'
| 'transformProperty'
| 'transformBuildMethod'
| 'transformPropertyMethod'
| 'addCustomMethods'
| 'transformValue'
| 'transformImports';Result Type
type Result<T> = { ok: true; value: T } | { ok: false; error: Error };Helper Functions
function ok<T>(value: T): Result<T>;Creates success result.
function err<T>(error: Error): Result<T>;Creates error result.
Utility Functions
isValidPlugin
function isValidPlugin(obj: unknown): obj is Plugin;Type guard for Plugin interface. Checks for required name and version properties.
createPluginManager
function createPluginManager(): PluginManager;Creates new PluginManager instance.
createImportManager
function createImportManager(): ImportManager;Creates new ImportManager instance.
createTypeMatcher
function createTypeMatcher(): TypeMatcherBuilder;Creates new TypeMatcherBuilder instance.
Context Enhancers
enhanceParseContext
function enhanceParseContext(context: ParseContext): ParseContext;Enhances parse context with utility methods.
enhanceResolveContext
function enhanceResolveContext(context: ResolveContext): ResolveContext;Enhances resolve context with utility methods.
enhanceGenerateContext
function enhanceGenerateContext(context: GenerateContext): GenerateContext;Enhances generate context with utility methods.
enhancePropertyMethodContext
function enhancePropertyMethodContext(
context: PropertyMethodContext,
): PropertyMethodContext;Enhances property method context with type matcher interface and helper methods.
enhanceBuilderContext
function enhanceBuilderContext(context: BuilderContext): BuilderContext;Enhances builder context with property query methods.
enhanceValueContext
function enhanceValueContext(context: ValueContext): ValueContext;Enhances value context with type checker.
enhanceBuildMethodContext
function enhanceBuildMethodContext(
context: BuildMethodContext,
): BuildMethodContext;Enhances build method context with utility methods.