ThreadRoutingOptions
Unpublished development API. This package is under development and is not available as a published release.
Options for useThreadRouting.
import type { ThreadRoutingOptions } from '@threadplane/react/chat';Declaration
export interface ThreadRoutingOptions {
readonly adapter?: ThreadRoutingAdapter;
readonly basePath?: string;
readonly exists?: (threadId: string) => boolean | Promise<boolean>;
readonly param?: string;
}Members
adapter
Custom URL binding. When set, basePath and param are ignored.
readonly adapter?: ThreadRoutingAdapter;basePath
Default adapter: the path the thread segment follows. '/' (default) gives
/<threadId>, '/chat' gives /chat/<threadId>. The query and hash are kept.
readonly basePath?: string;exists
Checks that a thread from the URL still exists. When it answers false, the URL is replaced with the bare URL. A rejected check keeps the thread.
readonly exists?: (threadId: string) => boolean | Promise<boolean>;param
Default adapter: store the thread in this query parameter instead of the path.
readonly param?: string;