roosterjs 9.10.0 → 9.11.2

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.10.0)
1
+ // Type definitions for roosterjs (Version 9.11.2)
2
2
  // Generated by dts tool from roosterjs
3
3
  // Project: https://github.com/Microsoft/roosterjs
4
4
 
@@ -3482,7 +3482,11 @@ export type ExperimentalFeature = /**
3482
3482
  /**
3483
3483
  * Workaround for the Legacy Image Edit
3484
3484
  */
3485
- | 'LegacyImageSelection';
3485
+ | 'LegacyImageSelection'
3486
+ /**
3487
+ * Use Content Model handle ENTER key
3488
+ */
3489
+ | 'HandleEnterKey';
3486
3490
 
3487
3491
  /**
3488
3492
  * Options for editor
@@ -5211,6 +5215,10 @@ export interface DOMHelper {
5211
5215
  * Get the width of the editable area of the editor content div
5212
5216
  */
5213
5217
  getClientWidth(): number;
5218
+ /**
5219
+ * Get a deep cloned root element
5220
+ */
5221
+ getClonedRoot(): HTMLElement;
5214
5222
  }
5215
5223
 
5216
5224
  /**
@@ -8455,11 +8463,13 @@ export class AutoFormatPlugin implements EditorPlugin {
8455
8463
  * @param options An optional parameter that takes in an object of type AutoFormatOptions, which includes the following properties:
8456
8464
  * - autoBullet: A boolean that enables or disables automatic bullet list formatting. Defaults to false.
8457
8465
  * - autoNumbering: A boolean that enables or disables automatic numbering formatting. Defaults to false.
8458
- * - autoLink: A boolean that enables or disables automatic hyperlink creation when pasting or typing content. Defaults to false.
8459
- * - autoUnlink: A boolean that enables or disables automatic hyperlink removal when pressing backspace. Defaults to false.
8460
8466
  * - autoHyphen: A boolean that enables or disables automatic hyphen transformation. Defaults to false.
8461
8467
  * - autoFraction: A boolean that enables or disables automatic fraction transformation. Defaults to false.
8462
8468
  * - autoOrdinals: A boolean that enables or disables automatic ordinal number transformation. Defaults to false.
8469
+ * - autoLink: A boolean that enables or disables automatic hyperlink url address creation when pasting or typing content. Defaults to false.
8470
+ * - autoUnlink: A boolean that enables or disables automatic hyperlink removal when pressing backspace. Defaults to false.
8471
+ * - autoTel: A boolean that enables or disables automatic hyperlink telephone numbers transformation. Defaults to false.
8472
+ * - autoMailto: A boolean that enables or disables automatic hyperlink email address transformation. Defaults to false.
8463
8473
  */
8464
8474
  constructor(options?: AutoFormatOptions);
8465
8475
  /**
@@ -8494,23 +8504,15 @@ export class AutoFormatPlugin implements EditorPlugin {
8494
8504
  /**
8495
8505
  * Options to customize the Content Model Auto Format Plugin
8496
8506
  */
8497
- export type AutoFormatOptions = {
8507
+ export interface AutoFormatOptions extends AutoLinkOptions {
8498
8508
  /**
8499
- * When true, after type *, ->, -, --, => , —, > and space key a type of bullet list will be triggered. @default true
8509
+ * When true, after type *, ->, -, --, => , —, > and space key a type of bullet list will be triggered.
8500
8510
  */
8501
8511
  autoBullet?: boolean;
8502
8512
  /**
8503
- * When true, after type 1, A, a, i, I followed by ., ), - or between () and space key a type of numbering list will be triggered. @default true
8513
+ * When true, after type 1, A, a, i, I followed by ., ), - or between () and space key a type of numbering list will be triggered.
8504
8514
  */
8505
8515
  autoNumbering?: boolean;
8506
- /**
8507
- * When press backspace before a link, remove the hyperlink
8508
- */
8509
- autoUnlink?: boolean;
8510
- /**
8511
- * When paste content, create hyperlink for the pasted link
8512
- */
8513
- autoLink?: boolean;
8514
8516
  /**
8515
8517
  * Transform -- into hyphen, if typed between two words
8516
8518
  */
@@ -8523,7 +8525,29 @@ export type AutoFormatOptions = {
8523
8525
  * Transform ordinal numbers into superscript
8524
8526
  */
8525
8527
  autoOrdinals?: boolean;
8526
- };
8528
+ }
8529
+
8530
+ /**
8531
+ * Options to customize the Auto link options in Auto Format Plugin
8532
+ */
8533
+ export interface AutoLinkOptions {
8534
+ /**
8535
+ * When press backspace before a link, remove the hyperlink
8536
+ */
8537
+ autoUnlink?: boolean;
8538
+ /**
8539
+ * When paste or type content with a link, create hyperlink for the link
8540
+ */
8541
+ autoLink?: boolean;
8542
+ /**
8543
+ * When paste content or type content with telephone, create hyperlink for the telephone number
8544
+ */
8545
+ autoTel?: boolean;
8546
+ /**
8547
+ * When paste or type a content with mailto, create hyperlink for the content
8548
+ */
8549
+ autoMailto?: boolean;
8550
+ }
8527
8551
 
8528
8552
  /**
8529
8553
  * Shortcut command for Bold
@@ -9209,7 +9233,7 @@ export class ImageEditPlugin implements ImageEditor, EditorPlugin {
9209
9233
  private shadowSpan;
9210
9234
  private selectedImage;
9211
9235
  protected wrapper: HTMLSpanElement | null;
9212
- private imageEditInfo;
9236
+ protected imageEditInfo: ImageMetadataFormat | null;
9213
9237
  private imageHTMLOptions;
9214
9238
  private dndHelpers;
9215
9239
  private clonedImage;
@@ -9252,7 +9276,10 @@ export class ImageEditPlugin implements ImageEditor, EditorPlugin {
9252
9276
  private mouseDownHandler;
9253
9277
  private onDropHandler;
9254
9278
  private keyDownHandler;
9255
- private applyFormatWithContentModel;
9279
+ /**
9280
+ * EXPOSED FOR TESTING PURPOSE ONLY
9281
+ */
9282
+ protected applyFormatWithContentModel(editor: IEditor, isCropMode: boolean, shouldSelectImage: boolean, isApiOperation?: boolean): void;
9256
9283
  private startEditing;
9257
9284
  startRotateAndResize(editor: IEditor, image: HTMLImageElement): void;
9258
9285
  private updateRotateHandleState;
@@ -9261,7 +9288,10 @@ export class ImageEditPlugin implements ImageEditor, EditorPlugin {
9261
9288
  private startCropMode;
9262
9289
  cropImage(): void;
9263
9290
  private editImage;
9264
- private cleanInfo;
9291
+ /**
9292
+ * Exported for testing purpose only
9293
+ */
9294
+ cleanInfo(): void;
9265
9295
  private removeImageWrapper;
9266
9296
  flipImage(direction: 'horizontal' | 'vertical'): void;
9267
9297
  rotateImage(angleRad: number): void;