API reference / @chanx-js/codegen / resolveReuse
Function: resolveReuse()
ts
function resolveReuse(
wanted,
outDir,
options
): Promise<ReuseResolution>;Defined in: reuse.ts:66
Find types the project already declares so they are referenced rather than regenerated.
Uses the TypeScript AST rather than a line regex: export type X, interface X and indented declarations are all real cases a regex over ^type\s+(\w+)\s*= misses. ts-morph is loaded only here, so a run without reuseFrom never pays for it.
Parameters
| Parameter | Type |
|---|---|
wanted | ReadonlySet<string> |
outDir | string |
options | ReuseOptions |
Returns
Promise<ReuseResolution>