@blocknote/react
Version:
A "Notion-style" block-based extensible text editor built on top of Prosemirror and Tiptap.
20 lines (19 loc) • 1.04 kB
TypeScript
import { User } from "@blocknote/core";
import { VersionSnapshot } from "@blocknote/core/extensions";
/**
* Reads users from the versioning extension's user store, loading any that
* aren't cached yet. Re-renders only when one of the requested users changes
* (the store uses a shallow `Map` comparison).
*
* Versioning-scoped: it reads the store the {@link VersioningExtension} builds
* from its `resolveUsers` option and exposes on its instance, so it must be
* used within a versioning UI where that extension is registered.
*/
export declare function useVersionUsers<U extends User = User>(userIds: string[]): Map<string, U>;
/**
* Computes the secondary label to display for a snapshot row: the snapshot's
* explicit `secondaryLabel` when set, otherwise its `by` author ids resolved
* to usernames (falling back to the raw id for users the store can't
* resolve). Reactive: re-renders as user info loads into the store.
*/
export declare function useSnapshotLabel(snapshot: VersionSnapshot | undefined): string | undefined;