documint 0.0.22 → 0.0.24

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.
package/dist/index.d.ts CHANGED
@@ -239,15 +239,31 @@ export type EditorInputKeybinding = {
239
239
  shiftKey?: boolean | "any";
240
240
  };
241
241
  export declare const defaultKeybindings: EditorInputKeybinding[];
242
+ export type DocumintPatch = {
243
+ revision: string | null;
244
+ changes: DocumintPatchChange[];
245
+ };
246
+ export type DocumintPatchChange = {
247
+ startLine: number;
248
+ endLine: number;
249
+ text: string;
250
+ };
251
+ export declare function applyDocumintPatch(content: string, patch: DocumintPatch): string;
242
252
  export type DocumintDecoration = {
243
253
  backgroundColor?: string;
244
254
  pulse?: boolean;
245
255
  color?: string;
246
256
  pattern: RegExp;
247
257
  };
258
+ export type UserMentionEvent = {
259
+ lineMarkdown: string;
260
+ lineNumber: number;
261
+ userId: string;
262
+ };
248
263
  export type DocumintProps = {
249
264
  content: string;
250
265
  className?: string;
266
+ revision?: string | null;
251
267
  actions?: DocumintActions;
252
268
  theme?: DocumintTheme;
253
269
  keybindings?: EditorInputKeybinding[];
@@ -257,7 +273,7 @@ export type DocumintProps = {
257
273
  resources?: ActiveResourceSet;
258
274
  storage?: DocumintStorage;
259
275
  users?: DocumentUser[];
260
- onContentChanged?: (content: string, document: Document$1) => void;
276
+ onContentChanged?: (content: string, document: Document$1, patch: DocumintPatch | null) => void;
261
277
  onCommentChanged?: (change: CommentChange) => void;
262
278
  onResourceOpened?: (resource: DocumentResourceReference) => void;
263
279
  onResourcesRequested?: (resources: readonly DocumentResourceReference[]) => void;
@@ -290,11 +306,6 @@ export type CommentChange = {
290
306
  thread: CommentThread;
291
307
  threadId: string;
292
308
  };
293
- export type UserMentionEvent = {
294
- lineMarkdown: string;
295
- lineNumber: number;
296
- userId: string;
297
- };
298
309
  export type DocumintTheme = EditorTheme | {
299
310
  dark: EditorTheme;
300
311
  light: EditorTheme;