roosterjs 9.56.0 → 9.58.0

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.
@@ -1,4 +1,4 @@
1
- // Type definitions for roosterjs (Version 9.56.0)
1
+ // Type definitions for roosterjs (Version 9.58.0)
2
2
  // Generated by dts tool from roosterjs
3
3
  // Project: https://github.com/Microsoft/roosterjs
4
4
 
@@ -3890,6 +3890,11 @@ export interface IEditor {
3890
3890
  * @param featureName The name of feature to check
3891
3891
  */
3892
3892
  isExperimentalFeatureEnabled(featureName: ExperimentalFeature | string): boolean;
3893
+ /**
3894
+ * Get all experimental features enabled in this editor
3895
+ * @returns An array of experimental feature names
3896
+ */
3897
+ getExperimentalFeatures(): ExperimentalFeature[];
3893
3898
  }
3894
3899
 
3895
3900
  /**
@@ -3920,7 +3925,11 @@ export type ExperimentalFeature = GraduatedExperimentalFeature
3920
3925
  * These characters can be used to hide text in HTML and may cause unexpected behavior.
3921
3926
  * @see https://embracethered.com/blog/posts/2024/hiding-and-finding-text-with-unicode-tags/
3922
3927
  */
3923
- | 'FilterInvisibleUnicode';
3928
+ | 'FilterInvisibleUnicode'
3929
+ /**
3930
+ * Handle the drop event for content that is dropped from the same editor instance.
3931
+ */
3932
+ | 'HandleDropInternalContent';
3924
3933
 
3925
3934
  /**
3926
3935
  * Predefined experiment features (Graduated, only keep them for backward compatibility)
@@ -5101,6 +5110,10 @@ export interface FormatContentModelOptions {
5101
5110
  * When pass to true, scroll the editing caret into view after write DOM tree if need
5102
5111
  */
5103
5112
  scrollCaretIntoView?: boolean;
5113
+ /**
5114
+ * When pass to true, skip setting DOM selection after write DOM tree. @default false
5115
+ */
5116
+ skipDOMSelection?: boolean;
5104
5117
  }
5105
5118
 
5106
5119
  /**
@@ -5259,9 +5272,19 @@ export interface ContentModelFormatState {
5259
5272
 
5260
5273
  /**
5261
5274
  * Represents the PasteType parameter used to set the paste type to use.
5262
- * It can be either the Paste Type value or a callback that retuns the Paste Type to use.
5275
+ * It can be either the Paste Type value or a callback that returns the Paste Type to use.
5263
5276
  */
5264
- export type PasteTypeOrGetter = PasteType | ((document: Document | null, clipboardData: ClipboardData) => PasteType);
5277
+ export type PasteTypeOrGetter = PasteType | PasteTypeGetter;
5278
+
5279
+ /**
5280
+ * A function that returns the Paste Type to use based on the pasted content and clipboard data.
5281
+ * @param document The document parsed from the clipboard raw HTML, or null when there is no HTML
5282
+ * @param clipboardData Clipboard data retrieved from clipboard
5283
+ * @param environment The editor environment information
5284
+ * @param htmlAttributes The metadata (HTML attributes) retrieved from the pasted content
5285
+ * @returns The Paste Type to use
5286
+ */
5287
+ export type PasteTypeGetter = (document: Document | null, clipboardData: ClipboardData, environment: EditorEnvironment, htmlAttributes: Record<string, string>) => PasteType;
5265
5288
 
5266
5289
  /**
5267
5290
  * Image Format
@@ -5724,7 +5747,14 @@ export type KnownAnnounceStrings = /**
5724
5747
  * @example
5725
5748
  * {0}, unselected
5726
5749
  */
5727
- | 'unselected';
5750
+ | 'unselected'
5751
+ /**
5752
+ * String announced when a new line is inserted in the editor.
5753
+ * Used when Enter is pressed and a new line is inserted in the editor.
5754
+ * @example
5755
+ * New line inserted
5756
+ */
5757
+ | 'newLineInserted';
5728
5758
 
5729
5759
  /**
5730
5760
  * Options for announcing format changes
@@ -6041,6 +6071,11 @@ export interface MergeModelOption {
6041
6071
  * Whether to add a paragraph after the merged content.
6042
6072
  */
6043
6073
  addParagraphAfterMergedContent?: boolean;
6074
+ /**
6075
+ * Whether to merge into an empty paragraph immediately after a list as a new list item.
6076
+ * @default false
6077
+ */
6078
+ mergeParagraphAfterList?: boolean;
6044
6079
  }
6045
6080
 
6046
6081
  /**
@@ -7929,6 +7964,16 @@ export function normalizeFontFamily(fontFamily: string): string;
7929
7964
  */
7930
7965
  export function extractClipboardItems(items: DataTransferItem[], allowedCustomPasteType?: string[], isPasteNative?: boolean): Promise<ClipboardData>;
7931
7966
 
7967
+ /**
7968
+ * Create a document fragment from clipboard content using the specified paste type
7969
+ * @param document The document used to create the fragment
7970
+ * @param clipboardData The clipboard data to convert
7971
+ * @param pasteType The paste type that determines which clipboard content to use
7972
+ * @param root The optional root element containing the parsed HTML content
7973
+ * @returns A document fragment containing the content to paste
7974
+ */
7975
+ export function createPasteFragment(document: Document, clipboardData: ClipboardData, pasteType: PasteType, root: HTMLElement | undefined): DocumentFragment;
7976
+
7932
7977
  /**
7933
7978
  * Gets the cached event data by cache key from event object if there is already one.
7934
7979
  * Otherwise, call getter function to create one, and cache it.
@@ -8386,6 +8431,10 @@ export const ChangeSource: {
8386
8431
  * Content changed by paste
8387
8432
  */
8388
8433
  Paste: string;
8434
+ /**
8435
+ * Content changed by auto markdown conversion
8436
+ */
8437
+ AutoMarkdownConversion: string;
8389
8438
  /**
8390
8439
  * Content changed by setContent API
8391
8440
  */
@@ -8427,6 +8476,10 @@ export const ChangeSource: {
8427
8476
  * Content changed by replace
8428
8477
  */
8429
8478
  Replace: string;
8479
+ /**
8480
+ * Content changed by dragging content out the editor
8481
+ */
8482
+ DragOutOfEditor: string;
8430
8483
  };
8431
8484
 
8432
8485
  /**
@@ -8862,6 +8915,11 @@ export class Editor implements IEditor {
8862
8915
  * @param featureName The name of feature to check
8863
8916
  */
8864
8917
  isExperimentalFeatureEnabled(featureName: ExperimentalFeature | string): boolean;
8918
+ /**
8919
+ * Get all experimental features enabled in this editor
8920
+ * @returns An array of experimental feature names
8921
+ * */
8922
+ getExperimentalFeatures(): ExperimentalFeature[];
8865
8923
  /**
8866
8924
  * @returns the current EditorCore object
8867
8925
  * @throws a standard Error if there's no core object
@@ -10933,7 +10991,7 @@ export class AnnouncePlugin implements EditorPlugin {
10933
10991
  export class DragAndDropPlugin implements EditorPlugin {
10934
10992
  private editor;
10935
10993
  private forbiddenElements;
10936
- private isInternalDragging;
10994
+ private internalDrag;
10937
10995
  private disposer;
10938
10996
  /**
10939
10997
  * Construct a new instance of DragAndDropPlugin
@@ -10963,6 +11021,8 @@ export class DragAndDropPlugin implements EditorPlugin {
10963
11021
  * @param event The event to handle:
10964
11022
  */
10965
11023
  onPluginEvent(event: PluginEvent): void;
11024
+ private adjustDraggingCursor;
11025
+ private handleDragOutOfTheEditor;
10966
11026
  }
10967
11027
 
10968
11028
  /**