import { WeavySubComponent } from '../classes/weavy-sub-component'; import { ShadowPartsController } from '../controllers/shadow-parts-controller'; import { MemberIdType } from '../types/members.types'; import { ComponentFeaturePolicy } from '../contexts/features-context'; import { OverlayAppearanceType } from '../types/ui.types'; declare global { interface HTMLElementTagNameMap { "wy-conversation-new": WyConversationNew; } } /** * Button and dialog for creating new conversations. * * **Used sub components** * * - [``](./ui/wy-button.ts) * - [``](./ui/wy-icon.ts) * - [``](./ui/wy-overlay.ts) * - [``](./ui/wy-titlebar.ts) * - [``](./wy-users-search.ts) * * @slot - Anything to replace the default button. * * @csspart wy-conversation-new-button - The button for creating a new conversation. * @csspart wy-conversation-new-dialog - The dialog overlay for creating a conversation. * * @fires {CreateConversationEventType} create - Emitted when a conversation should be created. */ export declare class WyConversationNew extends WeavySubComponent { static styles: import('lit').CSSResult[]; /** @internal */ protected exportParts: ShadowPartsController; /** * The feature policy of the host component, used to tell the picker whether blocking is available. * * @internal */ componentFeatures: ComponentFeaturePolicy | undefined; /** * Internal resolver for the member selection promise. * * @internal */ protected _resolveMembers?: (members: MemberIdType[]) => void; /** * Internal rejector for the member selection promise. * * @internal */ protected _rejectMembers?: (reason?: string) => void; /** * Promise resolved when members are selected via the dialog. * * Consumers can await whenMembers() to get selected member ids. * * @internal */ protected _whenMembers: Promise; /** * Resolves when members are selected from the modal. * * @returns Promise */ whenMembers(): Promise; /** * Create an internal members promise and store resolve/reject handlers. * * @internal */ protected createMembersPromise(): Promise; /** * Overlay appearance used for the create conversation dialog. * * @type {"modal" | "sheet" | "drawer" | "full" | "none"} * @default "modal" */ overlay: OverlayAppearanceType; /** * Whether the new conversation dialog is shown. * * @internal */ private show; /** * Any elements in the general slot. * * @internal */ private slotElements; /** * Open the new conversation dialog and return selected members. * * @returns Promise */ selectMembers(): Promise; /** * Close the new conversation dialog and resolve or reject the selection promise. * * @internal * @param members - Optional selected member ids to resolve the promise with. */ private close; /** * Handle a member selection from the picker. * * Picking exactly one blocked person opens their profile card instead of starting a conversation: a blocked 1:1 is * not openable, so creating one would drop the user straight into a muted conversation with no way forward. The card * is where unblock lives. Any other selection -- including a group that happens to contain a blocked person -- is * created as usual, since group participation is unrestricted. * * @internal * @param members - The members chosen in the picker. */ private handleSubmit; /** * Create a conversation by dispatching a `create` event and closing the dialog. * * @param members - Array of members by id/uid for a new conversation. */ private submit; render(): import('../../node_modules/lit-html/node/lit-html.js').TemplateResult<1>; } //# sourceMappingURL=wy-conversation-new.d.ts.map