Skip to main content

Function: register()

register(routeId, commandId, searchEntry?): Disposable

Defined in: packages/extension-api/src/extension-api.d.ts:5236

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

searchEntry?​

NavigationSearchEntry

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');