Skip to content

buildTypeParameterMap

Build a mapping from parent type parameter names to concrete type arguments. E.g., parent has typeParameters: ['Instance extends BaseInstance'] and child extends Parent<CanvasPluginInstance> → {Instance: 'CanvasPluginInstance'}

Import:

import { buildTypeParameterMap } from '@mnaoumov/typescript-dev-toolkit/docs-site/api-doc-type-merging';

Signature:

function buildTypeParameterMap(baseInfo: TypeInfo, typeArguments: string[]): Map<string, string>

Parameters:

Parameter Type Description
baseInfo TypeInfo The base type.
typeArguments string[] The type arguments the base type is given.

Returns: Map<string, string> — The parameter names mapped to their arguments.