VSCode extension API has this function:
export function createWebviewPanel(viewType: string, title: string, showOptions: ViewColumn | {
/**
* The view column in which the {@link WebviewPanel} should be shown.
*/
readonly viewColumn: ViewColumn;
/**
* An optional flag that when `true` will stop the panel from taking focus.
*/
readonly preserveFocus?: boolean;
}, options?: WebviewPanelOptions & WebviewOptions): WebviewPanel;
Records aren't updatable so we can't use it freely with sum types, however, when the sum type is being used as an input like WebviewPanelOptions & WebviewOptions above, we may be able to generate a Record to be used instead of Object