validateToolbarItems

Checks an environment's toolbar contribution and returns it, throwing on a malformed item or a duplicate id. Slots carry no id and are not checked for one.

@internote/canvas-sdkFunction
On this page
import { validateToolbarItems } from '@internote/canvas-sdk';

A contribution is data, so a problem with it is an authoring bug and surfaces loudly rather than rendering half a bar. The headless host runs it on every contribution it resolves.

#Signature

(items: ToolbarContribution[], environmentName: string): ToolbarContribution[]

#Parameters

items
The items the environment's toolbar function returned.
environmentName
The environment's name, for the error message.

#Returns

The same items.

Declared in packages/canvas-sdk/src/toolbar/types.ts:197.

Last updated