anniedrawing 0.3.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (97) hide show
  1. package/CHANGELOG.md +33 -0
  2. package/LICENSE +21 -0
  3. package/NOTICE +292 -0
  4. package/README.md +162 -0
  5. package/dist/agent/describe.d.ts +12 -0
  6. package/dist/agent/index.d.ts +10 -0
  7. package/dist/agent/index.js +2 -0
  8. package/dist/agent/index.js.map +1 -0
  9. package/dist/agent/place.d.ts +4 -0
  10. package/dist/agent/query.d.ts +3 -0
  11. package/dist/agent/toolDefs.d.ts +343 -0
  12. package/dist/board.d.ts +193 -0
  13. package/dist/core/catalog.d.ts +22 -0
  14. package/dist/core/clipboard.d.ts +2 -0
  15. package/dist/core/defaults.d.ts +19 -0
  16. package/dist/core/doc.d.ts +2 -0
  17. package/dist/core/ids.d.ts +5 -0
  18. package/dist/core/index.d.ts +16 -0
  19. package/dist/core/index.js +1 -0
  20. package/dist/core/item.d.ts +25 -0
  21. package/dist/core/links.d.ts +21 -0
  22. package/dist/core/locks.d.ts +3 -0
  23. package/dist/core/migrate.d.ts +5 -0
  24. package/dist/core/paste.d.ts +27 -0
  25. package/dist/core/schema.d.ts +644 -0
  26. package/dist/core/types.d.ts +313 -0
  27. package/dist/docs/agents-repository.md +56 -0
  28. package/dist/docs/agents.md +157 -0
  29. package/dist/docs/api.md +258 -0
  30. package/dist/docs/board-js.md +345 -0
  31. package/dist/docs/code-of-conduct.md +11 -0
  32. package/dist/docs/contributing.md +35 -0
  33. package/dist/docs/decisions.md +107 -0
  34. package/dist/docs/extensions.md +122 -0
  35. package/dist/docs/format.md +79 -0
  36. package/dist/docs/index.html +993 -0
  37. package/dist/docs/license.txt +21 -0
  38. package/dist/docs/llms-full.txt +345 -0
  39. package/dist/docs/llms.txt +90 -0
  40. package/dist/docs/mcp.md +97 -0
  41. package/dist/docs/notice.txt +292 -0
  42. package/dist/docs/nunito-OFL.txt +93 -0
  43. package/dist/docs/releasing.md +38 -0
  44. package/dist/docs/security.md +33 -0
  45. package/dist/favicon.svg +1 -0
  46. package/dist/fellow.d.ts +7 -0
  47. package/dist/fellow.js +2 -0
  48. package/dist/fellow.js.map +1 -0
  49. package/dist/geo/box.d.ts +13 -0
  50. package/dist/geo/index.d.ts +5 -0
  51. package/dist/geo/picker.d.ts +25 -0
  52. package/dist/geo/router.d.ts +11 -0
  53. package/dist/geo/vec.d.ts +8 -0
  54. package/dist/index.d.ts +7 -0
  55. package/dist/index.js +1 -0
  56. package/dist/input/autosave.d.ts +2 -0
  57. package/dist/input/cursors.d.ts +8 -0
  58. package/dist/input/measure.d.ts +6 -0
  59. package/dist/input/urlPaste.d.ts +18 -0
  60. package/dist/kinds/index.d.ts +2 -0
  61. package/dist/kinds/registry.d.ts +45 -0
  62. package/dist/porter/index.d.ts +5 -0
  63. package/dist/porter/indexedPng.d.ts +13 -0
  64. package/dist/porter/json.d.ts +3 -0
  65. package/dist/porter/png.d.ts +10 -0
  66. package/dist/porter/svg.d.ts +9 -0
  67. package/dist/shared/board-Bya0O1I7.js +2 -0
  68. package/dist/shared/board-Bya0O1I7.js.map +1 -0
  69. package/dist/shared/cards-DWgSVE54.js +2 -0
  70. package/dist/shared/cards-DWgSVE54.js.map +1 -0
  71. package/dist/shared/defaults-C-aC_B4z.js +2 -0
  72. package/dist/shared/defaults-C-aC_B4z.js.map +1 -0
  73. package/dist/shared/describe-DaWyf3qV.js +3 -0
  74. package/dist/shared/describe-DaWyf3qV.js.map +1 -0
  75. package/dist/shared/paste-C22i8o-g.js +2 -0
  76. package/dist/shared/paste-C22i8o-g.js.map +1 -0
  77. package/dist/shared/picker-Dv_i4iNP.js +2 -0
  78. package/dist/shared/picker-Dv_i4iNP.js.map +1 -0
  79. package/dist/shared/ui-Cay6AVqT.js +2 -0
  80. package/dist/shared/ui-Cay6AVqT.js.map +1 -0
  81. package/dist/shared/urlPaste-DN4JtgeB.js +2 -0
  82. package/dist/shared/urlPaste-DN4JtgeB.js.map +1 -0
  83. package/dist/stage/cards.d.ts +2 -0
  84. package/dist/stage/index.d.ts +3 -0
  85. package/dist/stage/itemView.d.ts +22 -0
  86. package/dist/stage/lens.d.ts +26 -0
  87. package/dist/stage/paint.d.ts +23 -0
  88. package/dist/stage/presence.d.ts +50 -0
  89. package/dist/stage/stage.d.ts +60 -0
  90. package/dist/style.css +2 -0
  91. package/dist/ui/icons.d.ts +2 -0
  92. package/dist/ui/index.d.ts +16 -0
  93. package/dist/ui/index.js +1 -0
  94. package/dist/ui/version.d.ts +3 -0
  95. package/llms-full.txt +345 -0
  96. package/llms.txt +90 -0
  97. package/package.json +120 -0
@@ -0,0 +1,193 @@
1
+ import type { KindCatalogSnapshot } from './core/catalog.js';
2
+ import type { LinkPreview } from './core/links.js';
3
+ import type { AgentPresenceOptions, AnnieDoc, ApplyOptions, ApplyResult, Box, ChangeEvent, ChangeLog, DescribeOptions, DocModel, ExportFormat, ExportOptions, Item, LensState, Op, Point, Query, Scope, Style } from './core/types.js';
4
+ import { Stage } from './stage/stage.js';
5
+ import { type KindDef } from './kinds/index.js';
6
+ import { type UiOptions } from './ui/index.js';
7
+ export type { UiOptions, UiExportFormat } from './ui/index.js';
8
+ export interface BoardOptions {
9
+ doc?: AnnieDoc;
10
+ /** Used when origin starts with `agent:` and apply() omits agentName. */
11
+ agentName?: string;
12
+ /**
13
+ * `shared` (default): undo/redo walk every origin.
14
+ * `hidden`: default undo/redo skip origins that start with `agent:`.
15
+ */
16
+ agentHistory?: 'shared' | 'hidden';
17
+ /** Default reveal for origins that start with `agent:`. Default `fit`. */
18
+ agentReveal?: 'none' | 'fit';
19
+ /** Used when origin starts with `agent:` and place.gap is omitted. Default 32. */
20
+ agentPlaceGap?: number;
21
+ agentPresence?: boolean | AgentPresenceOptions;
22
+ readonly?: boolean;
23
+ /** `'light'` when omitted, `'dark'`, or `'auto'` for `prefers-color-scheme`. */
24
+ theme?: 'light' | 'dark' | 'auto';
25
+ /** `false` omits chrome. An object keeps the tools and sets the header. Default `true`. */
26
+ ui?: boolean | UiOptions;
27
+ kinds?: KindDef[];
28
+ autosaveKey?: string;
29
+ /** Register on `window.__anniedrawing`. Default false. The local demo sets true. */
30
+ exposeGlobal?: boolean;
31
+ allowedImageOrigins?: string[];
32
+ sanitizeHTML?: (html: string) => string;
33
+ unfurl?: false | ((url: string) => Promise<LinkPreview | undefined>);
34
+ }
35
+ type Events = {
36
+ change: ChangeEvent;
37
+ select: string[];
38
+ view: LensState;
39
+ tool: string;
40
+ page: string;
41
+ save: {
42
+ status: 'saving' | 'saved' | 'error';
43
+ message?: string;
44
+ };
45
+ };
46
+ /** Browser editor: document session, pointer input, and the public Board API. */
47
+ export declare class Board {
48
+ readonly host: HTMLElement;
49
+ /** @internal Renderer. Use `view` and documented Board methods. */
50
+ readonly stage: Stage;
51
+ readonly model: DocModel;
52
+ readonly ready: Promise<void>;
53
+ readonly readonly: boolean;
54
+ readonly agentName?: string;
55
+ readonly selectionSignal: import("@preact/signals-core").Signal<string[]>;
56
+ readonly toolSignal: import("@preact/signals-core").Signal<string>;
57
+ readonly drafts: Map<string, Partial<Item>>;
58
+ /** Drawing tools fill paper; compact JSON omits fill and treats missing fill as none. */
59
+ defaultStyle: Style;
60
+ grid: boolean;
61
+ pageId: string;
62
+ private document;
63
+ private spatial;
64
+ private geometryLookup;
65
+ private hiddenGeometry;
66
+ private lockedGeometry;
67
+ private listeners;
68
+ private cleanup;
69
+ private uiCleanup?;
70
+ private frame;
71
+ private drag?;
72
+ private rect;
73
+ private space;
74
+ private clipboard;
75
+ private pointers;
76
+ private pinch?;
77
+ private editor?;
78
+ private finishEditor?;
79
+ private longPressTimer?;
80
+ private lastTouchTap?;
81
+ private touchDoubleAt;
82
+ private enteredGroup?;
83
+ private destroyed;
84
+ private themeValue;
85
+ private drawPreview?;
86
+ private previewDocument?;
87
+ private previewBase?;
88
+ private observer;
89
+ private unfurl?;
90
+ private agentReveal;
91
+ private pendingReveal?;
92
+ constructor(host: HTMLElement, options?: BoardOptions);
93
+ get selection(): string[];
94
+ get tool(): string;
95
+ get theme(): "auto" | "dark" | "light";
96
+ get canUndo(): boolean;
97
+ get canRedo(): boolean;
98
+ get revision(): number;
99
+ changesSince(since: number, options?: {
100
+ origin?: string | 'user' | 'agent';
101
+ }): ChangeLog;
102
+ get items(): Item[];
103
+ get view(): {
104
+ fit(ids?: string[]): void;
105
+ flyTo(box: Box): void;
106
+ zoom: number;
107
+ center: Point;
108
+ };
109
+ read(scope?: Scope | {
110
+ scope?: Scope;
111
+ includeDrafts?: boolean;
112
+ }): AnnieDoc;
113
+ get(id: string): Item | undefined;
114
+ isLocked(id: string): boolean;
115
+ private lockedResult;
116
+ query(selector?: Query): Item[];
117
+ describe(options?: DescribeOptions): string;
118
+ /** Built-in kinds added or last changed after `since`. Omit or pass 0 for the full catalog. */
119
+ kindsSince(since?: number): KindCatalogSnapshot;
120
+ boundsOf(ids?: string[]): Box;
121
+ apply(ops: Op[], options?: ApplyOptions): ApplyResult;
122
+ private queueReveal;
123
+ private flushReveal;
124
+ private revealCreated;
125
+ undo(options?: {
126
+ origin?: string;
127
+ }): boolean;
128
+ redo(): boolean;
129
+ load(doc: AnnieDoc): void;
130
+ clear(): void;
131
+ select(ids: string[]): void;
132
+ setTool(id: string): void;
133
+ setTheme(theme: 'light' | 'dark' | 'auto'): void;
134
+ setPage(id: string): void;
135
+ setGrid(value: boolean): void;
136
+ on<K extends keyof Events>(name: K, callback: (event: Events[K]) => void): () => boolean;
137
+ emit<K extends keyof Events>(name: K, event: Events[K]): void;
138
+ export(format: ExportFormat, options?: ExportOptions): Promise<string | Blob>;
139
+ destroy(): void;
140
+ addCleanup(fn: () => void): void;
141
+ focus(): void;
142
+ add(kind: string, point?: Point): ApplyResult;
143
+ updateSelection(patch: Partial<Item>): ApplyResult;
144
+ deleteSelection(): void;
145
+ duplicate(offset?: number): ApplyResult;
146
+ group(): void;
147
+ ungroup(): void;
148
+ align(mode: 'left' | 'center' | 'right' | 'top' | 'middle' | 'bottom' | 'horizontal' | 'vertical'): void;
149
+ addImage(file: File, point?: Point): Promise<void>;
150
+ /** Replace a video or link href. Editor helper; agents should `apply` a `set`. */
151
+ setHref(id: string, href: string): Promise<ApplyResult>;
152
+ private pasteHost;
153
+ editText(id: string): void;
154
+ cancel(): void;
155
+ private schedule;
156
+ private render;
157
+ private visible;
158
+ private isUI;
159
+ private point;
160
+ private updateCursor;
161
+ private topSelection;
162
+ private pageItems;
163
+ private movable;
164
+ private outline;
165
+ /** Hit-testing uses committed geometry; drafts do not update this index. */
166
+ private refreshGeometry;
167
+ private hit;
168
+ private zoomAt;
169
+ private pointerDown;
170
+ private pointerMove;
171
+ private pointerUp;
172
+ private pointerCancel;
173
+ private wheel;
174
+ private doubleClick;
175
+ private openContext;
176
+ private activateAt;
177
+ private activateEmbedded;
178
+ private clearInteractive;
179
+ private keyDown;
180
+ private withDrafts;
181
+ private copyEvent;
182
+ private cutEvent;
183
+ private pasteEvent;
184
+ private pasteFrom;
185
+ private drop;
186
+ }
187
+ /** Mount a board in `host`. See `BoardOptions` for theme, chrome, and export. */
188
+ export declare function createBoard(host: HTMLElement, options?: BoardOptions): Board;
189
+ declare global {
190
+ interface Window {
191
+ __anniedrawing?: Board[];
192
+ }
193
+ }
@@ -0,0 +1,22 @@
1
+ /** Bump when a built-in kind is added or its create/read contract changes. */
2
+ export declare const CATALOG_VERSION = 1;
3
+ export interface KindCatalogEntry {
4
+ kind: string;
5
+ /** Catalog version that added this kind or last changed its create/read fields. */
6
+ since: number;
7
+ w: number;
8
+ h: number;
9
+ note: string;
10
+ }
11
+ export interface KindCatalogSnapshot {
12
+ version: number;
13
+ since: number;
14
+ kinds: KindCatalogEntry[];
15
+ }
16
+ /** Built-in kinds. `since` is the catalog version that introduced or last changed the kind. */
17
+ export declare const KIND_CATALOG: readonly KindCatalogEntry[];
18
+ /**
19
+ * Built-in kinds added or last changed after `since`.
20
+ * Omit `since` or pass 0 to list every built-in kind.
21
+ */
22
+ export declare function kindsSince(since?: number): KindCatalogSnapshot;
@@ -0,0 +1,2 @@
1
+ /** First non-comment `text/uri-list` line, then `text/plain`. */
2
+ export declare function clipboardText(data: DataTransfer | null | undefined): string;
@@ -0,0 +1,19 @@
1
+ import type { AnnieDoc, Endpoint, EndpointInput, Item, NewItem, Style } from './types.js';
2
+ export declare const KIND_ALIASES: Record<string, string>;
3
+ export declare const COLOR_ALIASES: Record<string, string>;
4
+ export declare function storedKind(kind: string): string;
5
+ export declare function storedColor(value?: string): string | undefined;
6
+ export declare function storedEndpoint(value?: EndpointInput): Endpoint | undefined;
7
+ export declare function aliasStyle(style?: Style): Style | undefined;
8
+ export declare const CARD_CORNER = 12;
9
+ export declare const DEFAULT_STYLE: Required<Style>;
10
+ export declare const DEFAULT_SIZES: Record<string, [number, number]>;
11
+ export declare function clone<T>(value: T): T;
12
+ export declare function sizeOf(kind: string): [number, number];
13
+ export declare function kindDefaultsFrom(kinds?: {
14
+ kind: string;
15
+ defaults?: Partial<Item>;
16
+ }[]): Record<string, Partial<Item>>;
17
+ export declare function defaultDoc(): AnnieDoc;
18
+ export declare function normalizeItem(input: NewItem, kindDefaults?: Record<string, Partial<Item>>): Item;
19
+ export declare function minimalItem(item: Item, kindDefaults?: Record<string, Partial<Item>>): Item;
@@ -0,0 +1,2 @@
1
+ import type { AnnieDoc, DocModel, DocOptions } from './types.js';
2
+ export declare function createDoc(initial?: AnnieDoc, options?: DocOptions): DocModel;
@@ -0,0 +1,5 @@
1
+ export declare const itemId: () => string;
2
+ export declare const pageId: () => string;
3
+ export declare const mediaId: () => string;
4
+ /** Next free id: keep `requested` when unused, otherwise `stem_1`, `stem_2`, … */
5
+ export declare function uniqueItemId(requested: string, taken: Set<string>): string;
@@ -0,0 +1,16 @@
1
+ /** Headless document, validation, history, and geometry. */
2
+ export type * from './types.js';
3
+ export { CATALOG_VERSION, KIND_CATALOG, kindsSince } from './catalog.js';
4
+ export type { KindCatalogEntry, KindCatalogSnapshot } from './catalog.js';
5
+ export { createDoc } from './doc.js';
6
+ export { DEFAULT_STYLE, CARD_CORNER, DEFAULT_SIZES, clone, sizeOf, kindDefaultsFrom, defaultDoc, normalizeItem, minimalItem, storedKind, storedColor, storedEndpoint, } from './defaults.js';
7
+ export { itemId, pageId, mediaId } from './ids.js';
8
+ export { LIMITS, VISION_PNG, ItemSchema, PlacementSchema, DocumentSchema, OpSchema, OpsSchema, QuerySchema, DescribeSchema, } from './schema.js';
9
+ export { migrate } from './migrate.js';
10
+ export { IMAGE_DATA_URL, MEDIA_DATA_URL, normalizeHref, hostnameOf, parseVideo, videoEmbed, } from './links.js';
11
+ export type { VideoRef, LinkPreview } from './links.js';
12
+ export { clipboardText } from './clipboard.js';
13
+ export { imageMime, classifyPaste, parseLinkPreview, unfurlPage, displayUrl, prettyTitle, linkFallback, decodeEntities, } from './paste.js';
14
+ export { allItems, applyDraft, translateItem, copyItems, detachMissingEndpoints } from './item.js';
15
+ export type { ItemPatch } from './item.js';
16
+ export * from '../geo/index.js';
@@ -0,0 +1 @@
1
+ import{a as s,c as a,d as r,f as o,i as e,n as m,o as p,p as t,s as d,t as i,u as f}from"../shared/picker-Dv_i4iNP.js";import{a as h,b as c,c as j,d as u,f as b,g as n,h as g,l as k,m as l,n as v,o as x,p as y,r as w,s as A,t as C,u as D,v as E,y as F}from"../shared/defaults-C-aC_B4z.js";import{A as I,C as L,D as M,E as N,F as O,I as P,L as S,M as T,N as _,O as q,P as z,S as B,T as G,_ as H,a as J,b as K,d as Q,f as R,g as U,h as V,i as W,j as X,k as Y,m as Z,o as $,p as ss,s as as,u as rs,v as os,w as es,x as ms,y as ps}from"../shared/describe-DaWyf3qV.js";import{a as ts,c as ds,i as is,n as fs,o as hs,r as cs,s as js,t as us}from"../shared/paste-C22i8o-g.js";export{C as CARD_CORNER,E as CATALOG_VERSION,v as DEFAULT_SIZES,w as DEFAULT_STYLE,Y as DescribeSchema,I as DocumentSchema,p as IMAGE_DATA_URL,X as ItemSchema,F as KIND_CATALOG,T as LIMITS,d as MEDIA_DATA_URL,_ as OpSchema,z as OpsSchema,O as PlacementSchema,P as QuerySchema,i as SpatialIndex,S as VISION_PNG,W as allItems,J as applyDraft,Q as boundsOf,R as boxCorners,ss as boxFromPoints,Z as centerOf,us as classifyPaste,e as clipboardText,h as clone,V as contains,U as containsPoint,$ as copyItems,s as createDoc,fs as decodeEntities,x as defaultDoc,as as detachMissingEndpoints,cs as displayUrl,L as distance,H as flattenItems,m as hitTest,a as hostnameOf,is as imageMime,os as intersects,ps as itemBounds,l as itemId,A as kindDefaultsFrom,c as kindsSince,ts as linkFallback,K as lookupItem,g as mediaId,t as migrate,j as minimalItem,f as normalizeHref,k as normalizeItem,n as pageId,hs as parseLinkPreview,r as parseVideo,es as pointInPolygon,js as prettyTitle,ms as resolveEndpoint,G as rotatePoint,B as routeConnector,N as segmentDistance,M as simplifyPoints,q as simplifyStroke,D as sizeOf,u as storedColor,b as storedEndpoint,y as storedKind,rs as translateItem,ds as unfurlPage,o as videoEmbed};
@@ -0,0 +1,25 @@
1
+ import type { AnnieDoc, ApplyIssue, Item, ItemText, Op, Style } from './types.js';
2
+ import { itemId } from './ids.js';
3
+ import { type ItemLookup } from '../geo/box.js';
4
+ import { type OutlineResolver } from '../geo/router.js';
5
+ export declare function pageRoots(doc: AnnieDoc): Item[];
6
+ export declare function allItems(doc: AnnieDoc): Item[];
7
+ export type ItemPatch = Omit<Partial<Item>, 'style' | 'text' | 'data'> & {
8
+ style?: Partial<Style>;
9
+ text?: Partial<ItemText>;
10
+ data?: Record<string, unknown>;
11
+ };
12
+ /** Nested style, text, and data patches merge; other fields replace. */
13
+ export declare function applyDraft(item: Item, patch?: ItemPatch): Item;
14
+ export declare function translateItem(item: Item, dx: number, dy: number): Partial<Item>;
15
+ /**
16
+ * Agent creates keep colliding ids by storing `id_1`, `id_2`, … and rewriting
17
+ * same-batch place, parent, and endpoint refs. Mutates a clone of `ops`.
18
+ */
19
+ export declare function remapAgentCreateIds(doc: AnnieDoc, ops: Op[]): {
20
+ ops: Op[];
21
+ warnings: ApplyIssue[];
22
+ };
23
+ export declare function copyItems(items: Item[], offset: number, nextId?: typeof itemId): Item[];
24
+ /** Bound ends whose targets are missing become page points. Mutates `items`. */
25
+ export declare function detachMissingEndpoints(items: Iterable<Item>, lookup: ItemLookup, outline?: OutlineResolver): Op[];
@@ -0,0 +1,21 @@
1
+ export type VideoProvider = 'youtube' | 'vimeo';
2
+ export interface VideoRef {
3
+ provider: VideoProvider;
4
+ id: string;
5
+ hash?: string;
6
+ }
7
+ export interface LinkPreview {
8
+ title?: string;
9
+ description?: string;
10
+ image?: string;
11
+ }
12
+ /** Raster image data URLs accepted as image items. */
13
+ export declare const IMAGE_DATA_URL: RegExp;
14
+ /** Image media table sources, including SVG. */
15
+ export declare const MEDIA_DATA_URL: RegExp;
16
+ export declare function normalizeHref(value?: string): string | undefined;
17
+ /** True for http(s) URLs whose host is not loopback, link-local, ULA, or RFC1918. */
18
+ export declare function isPublicHttpUrl(value: string): boolean;
19
+ export declare function hostnameOf(href: string): string;
20
+ export declare function parseVideo(href?: string): VideoRef | undefined;
21
+ export declare function videoEmbed(href?: string): string | undefined;
@@ -0,0 +1,3 @@
1
+ import type { Item } from './types.js';
2
+ /** Moving a group must not move a locked descendant; locked groups protect their children. */
3
+ export declare function lockedItems(items: Item[]): Set<string>;
@@ -0,0 +1,5 @@
1
+ import type { AnnieDoc, Item } from './types.js';
2
+ export declare const CURRENT_VERSION = 2;
3
+ export declare const migrations: Record<number, (doc: Record<string, unknown>) => Record<string, unknown>>;
4
+ /** Load any supported version. Retired `frame` items become groups on every import. */
5
+ export declare function migrate(input: unknown, kindDefaults?: Record<string, Partial<Item>>): AnnieDoc;
@@ -0,0 +1,27 @@
1
+ import { type LinkPreview, type VideoRef } from './links.js';
2
+ export declare function imageMime(href: string): string;
3
+ export type PastedContent = {
4
+ kind: 'video';
5
+ href: string;
6
+ video: VideoRef;
7
+ } | {
8
+ kind: 'image';
9
+ href: string;
10
+ } | {
11
+ kind: 'link';
12
+ href: string;
13
+ } | {
14
+ kind: 'text';
15
+ value: string;
16
+ };
17
+ export declare function decodeEntities(value: string): string;
18
+ export declare function classifyPaste(value: string): PastedContent;
19
+ export declare function parseLinkPreview(html: string, base: string): LinkPreview;
20
+ export declare function unfurlPage(href: string): Promise<LinkPreview | undefined>;
21
+ export declare function displayUrl(href: string): string;
22
+ export declare function prettyTitle(href: string): string;
23
+ export declare function linkFallback(href: string): {
24
+ title: string;
25
+ description: string;
26
+ host: string;
27
+ };