@nextcloud/vue
Version:
Nextcloud vue components
42 lines (41 loc) • 1.66 kB
TypeScript
/**
* SPDX-FileCopyrightText: 2023 Nextcloud GmbH and Nextcloud contributors
* SPDX-License-Identifier: AGPL-3.0-or-later
*/
interface WidgetRenderProperties {
richObjectType: string;
richObject: object;
accessible: boolean;
interactive: boolean;
}
type widgetRenderCallback = (el: HTMLElement, properties: WidgetRenderProperties) => void;
type widgetDestroyCallback = (el: HTMLElement) => void;
interface WidgetProps {
id: string;
hasInteractiveView: boolean;
fullWidth: boolean;
callback: widgetRenderCallback;
onDestroy: widgetDestroyCallback;
}
interface WidgetPropsOptional {
hasInteractiveView?: boolean;
fullWidth?: boolean;
}
declare global {
interface Window {
_vue_richtext_widgets: Record<string, WidgetProps>;
_registerWidget: (id: string, callback: widgetRenderCallback, onDestroy: widgetDestroyCallback, props: WidgetPropsOptional) => void;
}
}
declare const isWidgetRegistered: (id: string) => boolean;
declare const hasInteractiveView: (id: string) => boolean;
export declare const hasFullWidth: (id: string) => boolean;
declare const registerWidget: (id: string, callback: widgetRenderCallback, onDestroy: ((el: HTMLElement) => void) | undefined, props: WidgetPropsOptional) => void;
declare const renderWidget: (el: HTMLElement, { richObjectType, richObject, accessible, interactive }: {
richObjectType: any;
richObject: any;
accessible: any;
interactive: any;
}) => void;
declare const destroyWidget: (richObjectType: string, el: HTMLElement) => void;
export { registerWidget, renderWidget, destroyWidget, isWidgetRegistered, hasInteractiveView, };