import { ForwardRefExoticComponent, RefAttributes, SVGProps } from "react"; //#region src/document/query/anchors/text.d.ts declare const ANCHOR_KINDS: readonly ["text", "code", "tableCell"]; type AnchorKind = (typeof ANCHOR_KINDS)[number]; type TextAnchor = { kind?: AnchorKind; prefix?: string; suffix?: string; }; //#endregion //#region src/document/comments/types.d.ts type CommentThread = { id: string; quote: string; comments: Comment[]; anchor: TextAnchor; resolvedAt?: string; }; type Comment = { body: string; updatedAt: string; }; type CommentThreadAnchor = { threadId: string; }; type Anchor = TextAnchor | CommentThreadAnchor; //#endregion //#region src/document/model/types.d.ts type Document = { blocks: Block[]; comments: CommentThread[]; metadata: DocumentMetadata | null; }; type MetadataValue = string | boolean; type DocumentMetadata = ReadonlyMap | { readonly raw: string; }; type Block = ParagraphBlock | HeadingBlock | ListBlock | ListItemBlock | TableBlock | BlockquoteBlock | DividerBlock | CodeBlock | DirectiveBlock | RawBlock; type Inline = Text | Link | Image | Mention | Resource | LineBreak | Raw; type ParagraphBlock = BlockNode<"paragraph", { children: Inline[]; }>; type HeadingBlock = BlockNode<"heading", { depth: 1 | 2 | 3 | 4 | 5 | 6; children: Inline[]; }>; type ListBlock = BlockNode<"list", { ordered: boolean; items: ListItemBlock[]; start: number | null; compact: boolean; }>; type ListItemBlock = BlockNode<"listItem", { checked: boolean | null; children: Block[]; compact: boolean; }>; type BlockquoteBlock = BlockNode<"blockquote", { children: Block[]; }>; type TableBlock = BlockNode<"table", { rows: TableRow[]; align: Array<"center" | "left" | "right" | null>; }>; type TableRow = { cells: TableCell[]; }; type TableCell = { children: Inline[]; plainText: string; }; type DividerBlock = BlockNode<"divider">; type CodeBlock = BlockNode<"code", { language: string | null; source: string; meta: string | null; }>; type DirectiveBlock = BlockNode<"directive", { name: string; body: string; attributes: string; }>; type RawBlock = BlockNode<"raw", { originalType: string; source: string; }>; type Text = InlineNode<"text", { marks: Mark[]; text: string; }>; type Mark = "bold" | "italic" | "underline" | "strikethrough" | "code" | "superscript"; type Link = InlineNode<"link", { children: Inline[]; title: string | null; url: string; }>; type Image = InlineNode<"image", { alt: string | null; title: string | null; url: string; width: number | null; }>; type Mention = InlineNode<"mention", { name: string; userId: string; }>; type Resource = InlineNode<"resource", { label: string; protocol: string; url: string; }>; type LineBreak = InlineNode<"lineBreak">; type Raw = InlineNode<"raw", { originalType: string; source: string; }>; type BlockNode = { type: K; plainText: string; } & P; type InlineNode = { type: K; } & P; //#endregion //#region src/document/model/resources.d.ts declare function normalizeResourceProtocol(protocol: string): string | null; declare function resolveResourceProtocol(url: string): string | null; //#endregion //#region node_modules/.bun/lucide-react@1.21.0+e14d3f224186685e/node_modules/lucide-react/dist/lucide-react.d.ts type SVGAttributes = Partial>; type ElementAttributes = RefAttributes & SVGAttributes; interface LucideProps extends ElementAttributes { size?: string | number; absoluteStrokeWidth?: boolean; } type LucideIcon = ForwardRefExoticComponent & RefAttributes>; //#endregion //#region src/editor/layout/measure/index.d.ts type LayoutRect = { height: number; left: number; top: number; width: number; }; //#endregion //#region src/types.d.ts type EditorInputCommand = "dedent" | "deleteBackward" | "deleteForward" | "deleteWordBackward" | "deleteWordForward" | "indent" | "insertLineBreak" | "insertSoftLineBreak" | "moveListItemDown" | "moveListItemUp" | "moveToDocumentEnd" | "moveToDocumentStart" | "moveToLineEnd" | "moveToLineStart" | "moveWordBackward" | "moveWordForward" | "redo" | "selectAll" | "toggleBold" | "toggleCode" | "toggleItalic" | "toggleStrikethrough" | "toggleSuperscript" | "toggleUnderline" | "undo"; type CodeTokenKind = "keyword" | "string" | "comment" | "number" | "function" | "type" | "atom" | "punctuation" | "heading" | "emphasis" | "strong" | "link" | (string & {}); type CodeGrammarRule = { pattern: RegExp; token: CodeTokenKind; }; type DocumintDecoration = { backgroundColor?: string; pulse?: boolean; color?: string; pattern: RegExp; }; type EditorTheme = { accent: string; background: string; muted: string; text: string; activeBlockBackground?: string; activeBlockFlash?: string; blockquoteRule?: string; blockquoteRuleActive?: string; blockquoteText?: string; caret?: string; checkboxCheckmark?: string; checkboxCheckedFill?: string; checkboxUncheckedFill?: string; checkboxUncheckedStroke?: string; codeBackground?: string; codeTokens?: Partial>; codeText?: string; commentHighlight?: string; commentHighlightActive?: string; commentHighlightResolved?: string; commentHighlightResolvedActive?: string; dividerRule?: string; externalChangeAdditionBackground?: string; externalChangeDeletionBackground?: string; externalChangeModificationBackground?: string; fontSize?: number; headingRule?: string; headingText?: string; imageLoadingOverlay?: string; imagePlaceholderIcon?: string; imagePlaceholderText?: string; imageSurfaceBackground?: string; imageSurfaceBorder?: string; inlineCodeBackground?: string; inlineCodeText?: string; insertHighlightText?: string; leafAccent?: string; leafBackground?: string; leafBorder?: string; leafInputBackground?: string; leafButtonText?: string; leafSecondaryText?: string; leafShadow?: string; leafText?: string; linkText?: string; listMarkerText?: string; mentionBackground?: string; mentionText?: string; paddingX?: number; paddingY?: number; paragraphText?: string; selectionBackground?: string; selectionHandleBackground?: string; selectionHandleBorder?: string; scrollbar?: string; tableBodyBackground?: string; tableBorder?: string; tableHeaderBackground?: string; }; type ResolvedEditorTheme = Required; type EffectEnvironment = { context: CanvasRenderingContext2D; theme: ResolvedEditorTheme; viewport: LayoutRect; }; type EffectContext = EffectEnvironment & TFields; type EffectComposition = "after" | "before" | "replace"; type DocumintEffectHandler = ((context: TContext) => void) | { compose?: EffectComposition; paint: (context: TContext) => void; }; type ActiveBlockChangedEffectContext = EffectContext<{ progress: number; rect: LayoutRect; }>; type DocumintListMarkerPaintFrame = { checked: boolean; kind: "task"; rect: LayoutRect; } | { kind: "ordered"; label: string; rect: LayoutRect; } | { kind: "unordered"; rect: LayoutRect; }; type ListItemInsertedEffectContext = EffectContext<{ marker: DocumintListMarkerPaintFrame; progress: number; }>; type TextDeletedEffectContext = EffectContext<{ color: string; contentKind: "code" | "text"; font: string; left: number; progress: number; text: string; textBaseline: number; }>; type TextInsertedEffectContext = EffectContext<{ anchor: { x: number; y: number; }; contentKind: "code" | "text"; progress: number; text: string; }>; type DocumintEffects = { activeBlockChanged?: DocumintEffectHandler; listItemInserted?: DocumintEffectHandler; textDeleted?: DocumintEffectHandler; textInserted?: DocumintEffectHandler; }; /** * A user known to the host. The full set is the mention roster; the subset * that also appears in `presence` shows a live cursor in the document. */ type DocumentUser = { id: string; username: string; fullName?: string; avatarUrl?: string; }; /** * One user's live document presence. `userId` foreign-keys into the `users` * roster; entries without a matching user are silently dropped. * * `cursor` is either a content-addressable text anchor (prefix/suffix) or a * comment-thread anchor (`{ threadId }`). The editor resolves comment-thread * anchors to a presence-active comment rule instead of a remote caret. */ type DocumentPresence = { userId: string; cursor?: Anchor; color?: string; status?: string; }; type DocumintStorage = { readFile(path: string): Promise; writeFile(file: File): Promise; openFile?(path: string): void; }; type DocumentResourceProtocol = { icon?: DocumentResourceIcon; label: string; }; type DocumentResourceIcon = string | DocumentResourceVectorIcon; type DocumentResourceVectorIcon = { node: DocumentResourceIconNode; type: "svg"; }; type DocumentResourceIconNode = readonly DocumentResourceIconNodeElement[]; type DocumentResourceIconNodeElement = readonly [elementName: string, attrs: Readonly>]; type DocumentResourceReference = { protocol: string; url: string; }; //#endregion //#region src/component/hooks/useResources.d.ts type ResourceProtocolRecord = ReadonlyMap | Record; type ActiveResourceSet = ReadonlySet | readonly string[] | Record; //#endregion //#region src/component/lib/keybindings.d.ts type EditorInputKeybinding = { altKey?: boolean; command: EditorInputCommand; key: string; modKey?: boolean; platform?: "mac" | "nonMac"; shiftKey?: boolean | "any"; }; declare const defaultKeybindings: readonly EditorInputKeybinding[]; //#endregion //#region src/component/sync/useDocumentSync.d.ts type UserMentionEvent = { lineMarkdown: string; lineNumber: number; userId: string; }; //#endregion //#region src/component/Documint.d.ts type DocumintProps = { content: string; previousContent?: string; className?: string; actions?: DocumintActions; theme?: EditorTheme; keybindings?: EditorInputKeybinding[]; decorations?: readonly DocumintDecoration[]; grammars?: Record | null; effects?: DocumintEffects; presence?: DocumentPresence[]; protocols?: ResourceProtocolRecord; resources?: ActiveResourceSet; readOnly?: boolean; showDiffs?: boolean; storage?: DocumintStorage; users?: DocumentUser[]; onContentChanged?: (content: string) => void; onCommentChanged?: (change: CommentChange) => void; onResourceOpened?: (resource: DocumentResourceReference) => void; onResourcesRequested?: (resources: readonly DocumentResourceReference[]) => void; onUserMentioned?: (event: UserMentionEvent) => void; }; type DocumintAction = { icon: LucideIcon; label: string; onClick: (arg: T) => void; }; type DocumintActions = { selection?: DocumintAction | readonly DocumintAction[]; }; type CommentChange = { kind: "added"; comment: Comment; mentionedUserIds: string[]; thread: CommentThread; threadId: string; } | { kind: "edited"; comment: Comment; previousBody: string; mentionedUserIds: string[]; thread: CommentThread; threadId: string; } | { kind: "deleted"; comment: Comment; thread: CommentThread; threadId: string; }; declare function Documint({ content, previousContent, ...props }: DocumintProps): import("react").JSX.Element; //#endregion //#region src/component/lib/themes.d.ts declare const lightTheme: EditorTheme; declare const darkTheme: EditorTheme; //#endregion //#region src/component/lib/resource-icons.d.ts declare function lucideResourceIcon(node: DocumentResourceIconNode): DocumentResourceIcon; //#endregion export { type ActiveBlockChangedEffectContext, type ActiveResourceSet, type Anchor, type Block, type CodeGrammarRule, type CodeTokenKind, type Comment, type CommentChange, type CommentThread, type DirectiveBlock, type Document, type DocumentMetadata, type DocumentPresence, type DocumentResourceIcon, type DocumentResourceIconNode, type DocumentResourceProtocol, type DocumentResourceReference, type DocumentResourceVectorIcon, type DocumentUser, Documint, type DocumintAction, type DocumintActions, type DocumintDecoration, type DocumintEffectHandler, type DocumintEffects, type DocumintListMarkerPaintFrame, type DocumintProps, type DocumintStorage, type EditorInputCommand, type EditorInputKeybinding, type EditorTheme, type Image, type Inline, type Link, type ListItemInsertedEffectContext, type Mark, type MetadataValue, type Raw, type RawBlock, type Resource, type ResourceProtocolRecord, type Text, type TextDeletedEffectContext, type TextInsertedEffectContext, type UserMentionEvent, darkTheme, defaultKeybindings, lightTheme, lucideResourceIcon, normalizeResourceProtocol, resolveResourceProtocol };