The Dock provider to register.
A promise that resolves with a DockProviderRegistration
object once the Dock provider is successfully registered. This contains the client API version, Workspace Version and a function to update the Dock provider configuration.
A Workspace Platform must be initialized.
An error if the Workspace Platform is not initialized.
An error if a Dock provider for this Workspace Platform is already registered.
An error if the Dock provider configuration contains buttons with duplicate ids. If no ids are specified, the buttons will be assigned ids automatically.
Register a Dock provider with a single button.
import { Dock, type DockProvider } from '@openfin/workspace';
const provider: DockProvider = {
id: 'provider-id',
title: 'Sample Dock',
icon: 'https://www.openfin.co/favicon-32x32.png',
buttons: [
{
tooltip: 'Sample Button 1',
iconUrl: 'https://www.openfin.co/favicon-32x32.png',
action: {
id: 'sampleButton1'
}
}
]
};
await Dock.register(provider)
await Dock.show()
API function to register a Dock provider.