import { LitElement, PropertyValueMap } from 'lit'; import { WeavyType } from '../contexts/weavy-context'; import { MsgType } from '../types/msg.types'; import { UserType } from '../types/users.types'; import { MembersResultType } from '../types/members.types'; import { ShadowPartsController } from '../controllers/shadow-parts-controller'; import { AppTypeGuid } from '../types/app.types'; declare global { interface HTMLElementTagNameMap { "wy-conversation-item": WyConversationItem; } } /** * Item display of a conversation for use in lists. * * **Used sub components** * * - [``](./ui/wy-button.ts) * - [``](./ui/wy-dropdown.ts) * - [``](./ui/wy-dropdown.ts) * - [``](./ui/wy-icon.ts) * - [``](./ui/wy-item.ts) * - [``](./ui/wy-avatar.ts) * - [``](./ui/wy-avatar.ts) * - [``](./wy-typing.ts) * * @csspart wy-conversation-item - The conversation item container (applied on the inner wy-item) * @csspart wy-conversation-item-avatar - The conversation avatar, whichever of the three variants is rendered. * * @fires {SelectedEventType} selected - Emitted when the conversation item is selected. * @fires {StarEventType} star - Emitted when the star/unstar action is requested. * @fires {PinEventType} pin - Emitted when the pin/unpin action is requested. * @fires {MessagesMarkEventType} mark - Emitted when the conversation should be marked read/unread. * @fires {LeaveEventType} leave - Emitted when the current user requests to leave the conversation. * @fires {RemoveEventType} remove - Emitted when the conversation should be removed/deleted. * @fires {TrashEventType} trash - Emitted when the conversation should be trashed. * @fires {BlockEventType} block - Emitted when the other user in a private chat should be blocked or unblocked. */ export declare class WyConversationItem extends LitElement { #private; static styles: import('lit').CSSResult[]; /** * Controller for exporting named shadow parts. * * @internal */ protected exportParts: ShadowPartsController; /** * Weavy instance context. * * @internal */ weavy?: WeavyType; /** * User context for the current authenticated user. * * @internal */ user: UserType | undefined; /** * The id of the conversation. * * Use this to identify which conversation the item represents. */ conversationId?: number; /** * Whether the conversation is unread. */ unread: boolean; /** * Url to any custom avatar for the conversation. If omitted, member avatars are used. */ avatarUrl?: string; /** * Whether the avatar should be hidden. */ hideAvatar: boolean; /** * Any custom title for the conversation item. */ name: string; /** * The type guid of the conversation. */ type: AppTypeGuid; /** * Whether the conversation item is selected. */ selected: boolean; /** * Whether the conversation is starred. */ starred: boolean; /** * Whether the conversation is pinned. */ pinned: boolean; /** * Whether this is a private chat with a blocked user. * * A blocked conversation goes quiet: it is dimmed, shows no preview or unread, and offers unblock as its only action. * It still opens, onto the blocked notice rather than the chat. Nothing is deleted -- unblocking brings it all back. */ blocked: boolean; /** * Whether blocking is offered for this conversation. * * Set by the parent list, since this component has no feature policy of its own. Gates blocking only -- unblock * stays available, so turning the feature off cannot strand someone with a block they can no longer undo. */ canBlock: boolean; /** * A list of members in the conversation. * * @internal */ members?: MembersResultType; /** * The last received message in the conversation. * * @internal */ lastMessage?: MsgType; /** * Realtime handler for when new messages have been created. * * Updates last message and unread state in the query cache. * * @internal * @param realtimeEvent - Realtime message event data. */ private handleMessageCreated; /** * Realtime handler for when conversations have been updated. * * @internal */ private handleConversationUpdated; /** * Realtime handler for when conversations are marked as read/unread. * * @internal * @param realtimeEvent - Realtime app marked event data. */ private handleConversationMarked; /** * Trigger `selected` event. * * @returns Whether the event was dispatched successfully. */ dispatchSelected(): boolean | undefined; /** * Trigger `block` event for the other member of a private chat. * * @param userId - The id of the other member. * @param block - Whether the user should be blocked or unblocked. * @returns Whether the event was dispatched successfully. * * @internal */ private dispatchBlock; /** * Confirm and block the other member of a private chat. * * Copy is identical to `wy-user-card` on purpose -- blocking is reachable from both and should not be explained two * different ways. Unblock stays unconfirmed; it only restores what was there. * * @param userId - The id of the other member. * * @internal */ private confirmBlock; /** * Trigger `star` event. * * @param star - Whether the conversation should be starred. * @returns Whether the event was dispatched successfully. */ dispatchStar(star: boolean): boolean | undefined; /** * Trigger `pin` event. * * @param pin - Whether the conversation should be pinned. * @returns Whether the event was dispatched successfully. * * @internal */ private dispatchPin; /** * Trigger `mark` event for marking the conversation as read/unread. * * @param mark - Whether the conversation should be marked as read. * @returns Whether the event was dispatched successfully. * * @internal */ private dispatchMarked; /** * Triggers `leave` event when the current user is leaving the conversation. * * @returns Whether the event was dispatched successfully. * * @internal */ private dispatchLeaveConversation; /** * Triggers `remove` when the conversation should be removed. * * @returns Whether the event was dispatched successfully. * * @internal */ private dispatchRemoveConversation; /** * Triggers `trash` event when the conversation should be trashed. * * @returns Whether the event was dispatched successfully. * * @internal */ private dispatchTrashConversation; willUpdate(changedProperties: PropertyValueMap): void; render(): import('../../node_modules/lit-html/node/lit-html.js').TemplateResult<1>; connectedCallback(): void; disconnectedCallback(): void; } //# sourceMappingURL=wy-conversation-item.d.ts.map