@nextcloud/vue
Version:
Nextcloud vue components
41 lines (40 loc) • 1.37 kB
TypeScript
/**
* SPDX-FileCopyrightText: 2024 Nextcloud GmbH and Nextcloud contributors
* SPDX-License-Identifier: AGPL-3.0-or-later
*/
export interface ContactsMenuEntry {
id: number | string | null;
fullName: string;
avatar: string | null;
topAction: object | null;
actions: object[];
lastMessage: string;
emailAddresses: string[];
profileTitle: string | null;
profileUrl: string | null;
status: string | null;
statusMessage: string | null;
statusMessageTimestamp: number | null;
statusIcon: string | null;
isUser: boolean;
uid: string | null;
}
export interface ContactsMenuAction {
id: string;
displayName: (entry: ContactsMenuEntry) => string;
enabled: (entry: ContactsMenuEntry) => boolean;
iconSvg: (entry: ContactsMenuEntry) => string;
callback: (entry: ContactsMenuEntry) => void;
}
/**
* Register a contacts and avatar menu action that will invoke the given callback on click.
*
* @param action - The action to register
*/
export declare function registerContactsMenuAction(action: ContactsMenuAction): void;
/**
* Get all registered and enabled contacts menu actions for the given menu entry.
*
* @param entry - The contacts menu entry object as returned by the backend
*/
export declare function getEnabledContactsMenuActions(entry: ContactsMenuEntry): ContactsMenuAction[];