createExternalRouteRef()
Home > @backstage/frontend-plugin-api
> createExternalRouteRef
Creates a route descriptor, to be later bound to a concrete route by the app. Used to implement cross-plugin route references.
Signature:
function createExternalRouteRef<TParams extends {
[param in TParamKeys]: string;
} | undefined = undefined, TOptional extends boolean = false, TParamKeys extends string = string>(options?: {
readonly params?: string extends TParamKeys ? (keyof TParams)[] : TParamKeys[];
optional?: TOptional;
defaultTarget?: string;
}): ExternalRouteRef<keyof TParams extends never ? undefined : string extends TParamKeys ? TParams : {
[param in TParamKeys]: string;
}, TOptional>;
Parameters
Parameter | Type | Description |
---|---|---|
options | { readonly params?: string extends TParamKeys ? (keyof TParams)[] : TParamKeys[]; optional?: TOptional; defaultTarget?: string; } | (Optional) Description of the route reference to be created. |
Returns:
ExternalRouteRef<keyof TParams extends never ? undefined : string extends TParamKeys ? TParams : { [param in TParamKeys]: string; }, TOptional>
Remarks
See https://backstage.io/docs/plugins/composability#routing-system.