ThreadActionAdapter

Unpublished development API. This package is under development and is not available as a published release.

Conversation commands the application implements. Supplying a command adds it to each row's built-in menu. The list shows the result at once and calls the command; the application then updates threads. A rejected command puts the row back as supplied.

import type { ThreadActionAdapter } from '@threadplane/react/chat';

Declaration

export interface ThreadActionAdapter  {
  readonly archive?: (threadId: string) => RowActionResult;
  readonly delete?: (threadId: string) => RowActionResult;
  readonly moveToProject?: (threadId: string, projectId: string | null) => RowActionResult;
  readonly pin?: (threadId: string) => RowActionResult;
  readonly rename?: (threadId: string, title: string) => RowActionResult;
  readonly reorderPinned?: (threadId: string, beforeId: string | null) => RowActionResult;
  readonly unarchive?: (threadId: string) => RowActionResult;
  readonly unpin?: (threadId: string) => RowActionResult;
}

Members

archive

Reversible, so it runs without confirmation; the row is hidden while it runs.

readonly archive?: (threadId: string) => RowActionResult;

delete

Called after the person confirms; the row is hidden while it runs.

readonly delete?: (threadId: string) => RowActionResult;

moveToProject

Offered when projects is supplied; null removes the conversation from its project.

readonly moveToProject?: (threadId: string, projectId: string | null) => RowActionResult;

pin

readonly pin?: (threadId: string) => RowActionResult;

rename

Called with the trimmed, nonblank title; the row shows it while it runs.

readonly rename?: (threadId: string, title: string) => RowActionResult;

reorderPinned

Places a pinned conversation before another pinned one, or last for null.

readonly reorderPinned?: (threadId: string, beforeId: string | null) => RowActionResult;

unarchive

Offered in the archived mode; the row is hidden while it runs.

readonly unarchive?: (threadId: string) => RowActionResult;

unpin

readonly unpin?: (threadId: string) => RowActionResult;