roosterjs 9.45.2 → 9.46.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.45.2)
1
+ // Type definitions for roosterjs (Version 9.46.0)
2
2
  // Generated by dts tool from roosterjs
3
3
  // Project: https://github.com/Microsoft/roosterjs
4
4
 
@@ -1293,7 +1293,7 @@ export type EntityFormatOperation = /**
1293
1293
  /**
1294
1294
  * Operations used by editTable() API
1295
1295
  */
1296
- export type TableOperation = TableVerticalInsertOperation | TableHorizontalInsertOperation | TableDeleteOperation | TableVerticalMergeOperation | TableHorizontalMergeOperation | TableCellMergeOperation | TableSplitOperation | TableAlignOperation | TableCellHorizontalAlignOperation | TableCellVerticalAlignOperation;
1296
+ export type TableOperation = TableVerticalInsertOperation | TableHorizontalInsertOperation | TableDeleteOperation | TableVerticalMergeOperation | TableHorizontalMergeOperation | TableCellMergeOperation | TableSplitOperation | TableAlignOperation | TableCellHorizontalAlignOperation | TableCellVerticalAlignOperation | TableCellShiftOperation;
1297
1297
 
1298
1298
  /**
1299
1299
  * Operations used by editTable() API for insert table cell vertically
@@ -1427,6 +1427,18 @@ export type TableCellVerticalAlignOperation = /**
1427
1427
  */
1428
1428
  | 'alignCellBottom';
1429
1429
 
1430
+ /**
1431
+ * Operations used by editTable() API to shift table cell content up or left
1432
+ */
1433
+ export type TableCellShiftOperation = /**
1434
+ * Move the table cell content to the cell on the left
1435
+ */
1436
+ 'shiftCellsLeft'
1437
+ /**
1438
+ * Move the table cell content to the cell above
1439
+ */
1440
+ | 'shiftCellsUp';
1441
+
1430
1442
  /**
1431
1443
  * Specify what type of content to paste
1432
1444
  */
@@ -3535,8 +3547,9 @@ export interface Colors {
3535
3547
  * @param baseLValue Base value of light used for dark value calculation
3536
3548
  * @param colorType @optional Type of color, can be text, background, or border
3537
3549
  * @param element @optional Source HTML element of the color
3550
+ * @param comparingColor @optional When generating dark color for background color, we can provide text color as comparingColor to make sure the generated dark border color has enough contrast with text color in dark mode
3538
3551
  */
3539
- export type ColorTransformFunction = (lightColor: string, baseLValue?: number, colorType?: 'text' | 'background' | 'border', element?: HTMLElement) => string;
3552
+ export type ColorTransformFunction = (lightColor: string, baseLValue?: number, colorType?: 'text' | 'background' | 'border', element?: HTMLElement, comparingColor?: string) => string;
3540
3553
 
3541
3554
  /**
3542
3555
  * An interface of Editor, built on top of Content Model
@@ -7492,8 +7505,9 @@ export function getColor(element: HTMLElement, isBackground: boolean, isDarkMode
7492
7505
  * @param isBackground True to set background color, false to set text color
7493
7506
  * @param isDarkMode Whether element is in dark mode now
7494
7507
  * @param darkColorHandler @optional The dark color handler object to help manager dark mode color
7508
+ * @param comparingColor @optional When generating dark color for background color, we can provide text color as comparingColor to make sure the generated dark border color has enough contrast with text color in dark mode
7495
7509
  */
7496
- export function setColor(element: HTMLElement, color: string | null | undefined, isBackground: boolean, isDarkMode: boolean, darkColorHandler?: DarkColorHandler): void;
7510
+ export function setColor(element: HTMLElement, color: string | null | undefined, isBackground: boolean, isDarkMode: boolean, darkColorHandler?: DarkColorHandler, comparingColor?: string): void;
7497
7511
 
7498
7512
  /**
7499
7513
  * Parse color string to r/g/b value.
@@ -7572,6 +7586,13 @@ export function getSelectionRootNode(selection: DOMSelection | undefined): Node
7572
7586
  */
7573
7587
  export function getDOMInsertPointRect(doc: Document, pos: DOMInsertPoint): Rect | null;
7574
7588
 
7589
+ /**
7590
+ * Remove the unselected content from the model
7591
+ * @param model the model document
7592
+ * @param selection The editor selection
7593
+ * */
7594
+ export function trimModelForSelection(model: ContentModelDocument, selection: DOMSelection): void;
7595
+
7575
7596
  /**
7576
7597
  * Returns true when the event was fired from a key that produces a character value, otherwise false
7577
7598
  * This detection is not 100% accurate. event.key is not fully supported by all browsers, and in some browsers (e.g. IE),
@@ -7660,7 +7681,7 @@ export function retrieveDocumentMetadata(doc: Document): Record<string, string>;
7660
7681
  * @param darkColorHandler The dark color handler object to help do color transformation
7661
7682
  * @param transformColorOptions Configuration options for controlling which elements and styles undergo color transformation.
7662
7683
  */
7663
- export function transformColor(rootNode: Node, includeSelf: boolean, direction: 'lightToDark' | 'darkToLight', darkColorHandler?: DarkColorHandler, transformColorOptions?: TransformColorOptions): void;
7684
+ export function transformColor(rootNode: Node, includeSelf: boolean, direction: 'lightToDark' | 'darkToLight', darkColorHandler?: DarkColorHandler, transformColorOptions?: TransformColorOptions, defaultTextColor?: string): void;
7664
7685
 
7665
7686
  /**
7666
7687
  * Configuration options for controlling which elements and styles undergo color transformation.