UNPKG

@nextcloud/vue

Version:
57 lines (56 loc) 2.17 kB
/** * SPDX-FileCopyrightText: 2023 Nextcloud GmbH and Nextcloud contributors * SPDX-License-Identifier: AGPL-3.0-or-later */ /** * Representation of the render callback result * It contains a dom element and an object (Vue instance or other fancy things) */ export declare class NcCustomPickerRenderResult { element: HTMLElement; object: object; /** * @param element - The HTML element * @param object - The object */ constructor(element: HTMLElement, object: object); } interface CustomPickerElementProps { providerId: number; accessible: boolean; } type CustomPickerElementRegistrationCallback = (el: HTMLElement, options: CustomPickerElementProps) => void; type CustomPickerElementDestroyCallback = (el: HTMLElement, result: NcCustomPickerRenderResult) => void; export interface CustomPickerElement { id: string; size: 'small' | 'normal' | 'large' | 'full'; callback: CustomPickerElementRegistrationCallback; onDestroy: CustomPickerElementDestroyCallback; } /** * @param id - Id of the element to check */ export declare function isCustomPickerElementRegistered(id: string): boolean; /** * @param id - Id of the element to get */ export declare function getCustomPickerElementSize(id: string): 'small' | 'normal' | 'large' | 'full' | null; /** * @param id - Id of element to register * @param callback - Render callback * @param onDestroy - Cleanup callback * @param size - Size of the element */ export declare function registerCustomPickerElement(id: string, callback: CustomPickerElementRegistrationCallback, onDestroy?: CustomPickerElementDestroyCallback, size?: CustomPickerElement['size']): void; /** * @param el - element to render to * @param options - Element options */ export declare function renderCustomPickerElement(el: HTMLElement, options: CustomPickerElementProps): void; /** * @param providerId - Provider id of element to destroy * @param el - The element to destroy element from * @param renderResult - The render result */ export declare function destroyCustomPickerElement(providerId: string, el: HTMLElement, renderResult: NcCustomPickerRenderResult): void; export {};