Skip to main content

Function: register()

register(routeId, commandId): Disposable

Allow to define custom route for an extension.

Parameters

routeId: string

a unique string value that could be used in navigation.navigate

commandId: string

the command that will be executed on navigate

Returns

Disposable

Remarks

The commandId used must have been registered through commands.registerCommand

Example

import { navigation, commands } from '@podman-desktop/api';

commands.registerCommand('redirect-download-command', (trackingId: string) => {
// todo: do something with the trackingId
});

// register the route
navigation.register('download-page', 'redirect-download-command');

// when needed call the navigate with the route id registered to
// trigger the command
navigation.navigate('download-page', 'dummy-tracking-id');

Defined in

packages/extension-api/src/extension-api.d.ts:4831