roosterjs 9.54.0 → 9.56.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.54.0)
1
+ // Type definitions for roosterjs (Version 9.56.0)
2
2
  // Generated by dts tool from roosterjs
3
3
  // Project: https://github.com/Microsoft/roosterjs
4
4
 
@@ -102,6 +102,11 @@ export type ContentModelHyperLinkFormat = LinkFormat & TextColorFormat & Backgro
102
102
  */
103
103
  export type ContentModelCodeFormat = FontFamilyFormat & DisplayFormat;
104
104
 
105
+ /**
106
+ * The format object for a data element (<data>) in Content Model
107
+ */
108
+ export type ContentModelDataFormat = DataValueFormat;
109
+
105
110
  /**
106
111
  * Type for FormatContainer
107
112
  */
@@ -216,6 +221,10 @@ export interface ContentModelFormatMap {
216
221
  * Format type for code
217
222
  */
218
223
  code: FontFamilyFormat;
224
+ /**
225
+ * Format type for data, used by HTML <data> element
226
+ */
227
+ data: ContentModelDataFormat;
219
228
  /**
220
229
  * Format type for dataset
221
230
  */
@@ -284,6 +293,10 @@ export interface FormatHandlerTypeMap {
284
293
  * Format for DatasetFormat
285
294
  */
286
295
  dataset: DatasetFormat;
296
+ /**
297
+ * Format for DataValueFormat, used by HTML <data> element
298
+ */
299
+ dataValue: DataValueFormat;
287
300
  /**
288
301
  * Format for DirectionFormat
289
302
  */
@@ -505,6 +518,16 @@ export type LetterSpacingFormat = {
505
518
  letterSpacing?: string;
506
519
  };
507
520
 
521
+ /**
522
+ * Format of the value of a HTML "data" element
523
+ */
524
+ export type DataValueFormat = {
525
+ /**
526
+ * The machine-readable value, represented by the "value" attribute of a HTML "data" element
527
+ */
528
+ dataValue?: string;
529
+ };
530
+
508
531
  /**
509
532
  * Format of line height
510
533
  */
@@ -2170,6 +2193,10 @@ export interface ContentModelSegmentBase<T extends ContentModelSegmentType, TFor
2170
2193
  * Code info
2171
2194
  */
2172
2195
  code?: ContentModelCode;
2196
+ /**
2197
+ * Data info, used by HTML &lt;data&gt; element
2198
+ */
2199
+ data?: ContentModelData;
2173
2200
  }
2174
2201
 
2175
2202
  /**
@@ -2194,6 +2221,10 @@ export interface ReadonlyContentModelSegmentBase<T extends ContentModelSegmentTy
2194
2221
  * Code info
2195
2222
  */
2196
2223
  readonly code?: ReadonlyContentModelCode;
2224
+ /**
2225
+ * Data info, used by HTML &lt;data&gt; element
2226
+ */
2227
+ readonly data?: ReadonlyContentModelData;
2197
2228
  }
2198
2229
 
2199
2230
  /**
@@ -2208,6 +2239,10 @@ export interface ShallowMutableContentModelSegmentBase<T extends ContentModelSeg
2208
2239
  * Code info
2209
2240
  */
2210
2241
  code?: ContentModelCode;
2242
+ /**
2243
+ * Data info, used by HTML &lt;data&gt; element
2244
+ */
2245
+ data?: ContentModelData;
2211
2246
  }
2212
2247
 
2213
2248
  /**
@@ -2241,6 +2276,22 @@ export interface ContentModelCode extends MutableMark, ContentModelWithFormat<Co
2241
2276
  export interface ReadonlyContentModelCode extends ReadonlyMark, ReadonlyContentModelWithFormat<ContentModelCodeFormat> {
2242
2277
  }
2243
2278
 
2279
+ /**
2280
+ * Represent data info of Content Model, used by HTML &lt;data&gt; element.
2281
+ * ContentModelData is a decorator but not a standalone model type, instead it need to be put inside a ContentModelSegment
2282
+ * since the &lt;data&gt; element is also a kind of segment, with some extra information
2283
+ */
2284
+ export interface ContentModelData extends MutableMark, ContentModelWithFormat<ContentModelDataFormat> {
2285
+ }
2286
+
2287
+ /**
2288
+ * Represent data info of Content Model, used by HTML &lt;data&gt; element. (Readonly)
2289
+ * ContentModelData is a decorator but not a standalone model type, instead it need to be put inside a ContentModelSegment
2290
+ * since the &lt;data&gt; element is also a kind of segment, with some extra information
2291
+ */
2292
+ export interface ReadonlyContentModelData extends ReadonlyMark, ReadonlyContentModelWithFormat<ContentModelDataFormat> {
2293
+ }
2294
+
2244
2295
  /**
2245
2296
  * Represent link info of Content Model.
2246
2297
  * ContentModelLink is not a standalone model type, instead it need to be put inside a ContentModelSegment
@@ -2286,12 +2337,12 @@ export interface ReadonlyContentModelParagraphDecorator extends ReadonlyMark, Re
2286
2337
  /**
2287
2338
  * Union type for segment decorators
2288
2339
  */
2289
- export type ContentModelDecorator = ContentModelLink | ContentModelCode | ContentModelListLevel;
2340
+ export type ContentModelDecorator = ContentModelLink | ContentModelCode | ContentModelData | ContentModelListLevel;
2290
2341
 
2291
2342
  /**
2292
2343
  * Union type for segment decorators (Readonly)
2293
2344
  */
2294
- export type ReadonlyContentModelDecorator = ReadonlyContentModelLink | ReadonlyContentModelCode | ReadonlyContentModelListLevel;
2345
+ export type ReadonlyContentModelDecorator = ReadonlyContentModelLink | ReadonlyContentModelCode | ReadonlyContentModelData | ReadonlyContentModelListLevel;
2295
2346
 
2296
2347
  /**
2297
2348
  * Content Model of List Level
@@ -3047,6 +3098,10 @@ export interface DomToModelDecoratorContext {
3047
3098
  * Context of code info
3048
3099
  */
3049
3100
  code: ContentModelCode;
3101
+ /**
3102
+ * Context of data info, used by HTML &lt;data&gt; element
3103
+ */
3104
+ data: ContentModelData;
3050
3105
  /**
3051
3106
  * Context for paragraph decorator
3052
3107
  */
@@ -7362,9 +7417,10 @@ export function createTableCell(spanLeftOrColSpan?: boolean | number, spanAboveO
7362
7417
  * @param text Text of this model
7363
7418
  * @param format @optional The format of this model
7364
7419
  * @param link @optional The link decorator
7365
- * @param code @option The code decorator
7420
+ * @param code @optional The code decorator
7421
+ * @param data @optional The data decorator
7366
7422
  */
7367
- export function createText(text: string, format?: Readonly<ContentModelSegmentFormat>, link?: ReadonlyContentModelLink, code?: ReadonlyContentModelCode): ContentModelText;
7423
+ export function createText(text: string, format?: Readonly<ContentModelSegmentFormat>, link?: ReadonlyContentModelLink, code?: ReadonlyContentModelCode, data?: ReadonlyContentModelData): ContentModelText;
7368
7424
 
7369
7425
  /**
7370
7426
  * Create a ContentModelImage model
@@ -7871,7 +7927,7 @@ export function normalizeFontFamily(fontFamily: string): string;
7871
7927
  * @param allowedCustomPasteType Allowed custom content type when paste besides text/plain, text/html and images
7872
7928
  Only text types are supported, and do not add "text/" prefix to the type values
7873
7929
  */
7874
- export function extractClipboardItems(items: DataTransferItem[], allowedCustomPasteType?: string[]): Promise<ClipboardData>;
7930
+ export function extractClipboardItems(items: DataTransferItem[], allowedCustomPasteType?: string[], isPasteNative?: boolean): Promise<ClipboardData>;
7875
7931
 
7876
7932
  /**
7877
7933
  * Gets the cached event data by cache key from event object if there is already one.
@@ -8108,6 +8164,13 @@ export function setSelection(group: ReadonlyContentModelBlockGroup, start?: Read
8108
8164
  */
8109
8165
  export function cloneModel(model: ReadonlyContentModelDocument, options?: CloneModelOptions): ContentModelDocument;
8110
8166
 
8167
+ /**
8168
+ * Clone a content model for paste operations, ensuring that cached elements are handled appropriately.
8169
+ * @param model The content model to clone
8170
+ * @returns A cloned content model suitable for paste operations
8171
+ */
8172
+ export function cloneModelForPaste(model: ReadonlyContentModelDocument): ContentModelDocument;
8173
+
8111
8174
  /**
8112
8175
  * Merge source model into target mode
8113
8176
  * @param target Target Content Model that will merge content into
@@ -11042,5 +11105,10 @@ export interface MarkdownPasteOptions {
11042
11105
  * @default false
11043
11106
  */
11044
11107
  autoConversion: boolean;
11108
+ /**
11109
+ * When true, the plugin will undo the markdown conversion when the user undoes the action.
11110
+ * @default false
11111
+ */
11112
+ undoConversion: boolean;
11045
11113
  }
11046
11114