Skip to main content
Version: Next

internal.ComponentRef

Home > @backstage/backend-openapi-utils > internal > ComponentRef

Signature:

export type ComponentRef<Doc extends RequiredDoc, Type extends ComponentTypes<Doc>, Ref extends ImmutableReferenceObject> = Ref extends {
$ref: `#/components/${Type}/${infer Name}`;
} ? Name extends keyof Doc['components'][Type] ? Doc['components'][Type][Name] extends ImmutableReferenceObject ? ComponentRef<Doc, Type, Doc['components'][Type][Name]> : Doc['components'][Type][Name] : never : never;

References: RequiredDoc, ComponentTypes, ImmutableReferenceObject, ComponentRef