File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -32,7 +32,7 @@ export interface ISidebarContext {
3232 * @see https://developer.mozilla.org/en-US/docs/Web/API/Web_components
3333 * @see https://vuejs.org/guide/extras/web-components#building-custom-elements-with-vue
3434 */
35- export interface SidebarComponent extends HTMLElement , ISidebarContext {
35+ export interface SidebarTabComponent extends ISidebarContext {
3636 /**
3737 * This method is called by the files app if the sidebar tab state changes.
3838 *
@@ -41,6 +41,11 @@ export interface SidebarComponent extends HTMLElement, ISidebarContext {
4141 setActive ( active : boolean ) : Promise < void >
4242}
4343
44+ /**
45+ * The instance type of a sidebar tab web component.
46+ */
47+ export type SidebarTabComponentInstance = SidebarTabComponent & HTMLElement
48+
4449/**
4550 * Implementation of a custom sidebar tab within the files app.
4651 */
@@ -82,6 +87,14 @@ export interface ISidebarTab {
8287 * @param context - The current context of the files app
8388 */
8489 enabled : ( context : ISidebarContext ) => boolean
90+
91+ /**
92+ * Called when the sidebar tab is registered in the sidebar.
93+ * This can be used to call the `CustomElementRegistry.define()` method to register the web component.
94+ *
95+ * The sidebar itself will anyways wait for the component to be defined in the registry (`customElements.whenDefined()`).
96+ */
97+ register ?: ( ) => Promise < void >
8598}
8699
87100/**
You can’t perform that action at this time.
0 commit comments