roosterjs 8.22.1 → 8.24.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.
- package/README.md +1 -1
- package/dist/rooster-amd-min.js +1 -1
- package/dist/rooster-amd-min.js.map +1 -1
- package/dist/rooster-amd.d.ts +686 -103
- package/dist/rooster-amd.js +1431 -163
- package/dist/rooster-amd.js.map +1 -1
- package/dist/rooster-min.js +1 -1
- package/dist/rooster-min.js.map +1 -1
- package/dist/rooster.d.ts +684 -101
- package/dist/rooster.js +1431 -163
- package/dist/rooster.js.map +1 -1
- package/package.json +7 -7
- package/tsconfig.child.tsbuildinfo +1 -1
package/dist/rooster-amd.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
// Type definitions for roosterjs (Version 8.
|
|
1
|
+
// Type definitions for roosterjs (Version 8.24.0)
|
|
2
2
|
// Generated by dts tool from roosterjs
|
|
3
3
|
// Project: https://github.com/Microsoft/roosterjs
|
|
4
4
|
|
|
@@ -391,9 +391,10 @@ export const Browser: BrowserInfo;
|
|
|
391
391
|
* Get current browser information from user agent string
|
|
392
392
|
* @param userAgent The userAgent string of a browser
|
|
393
393
|
* @param appVersion The appVersion string of a browser
|
|
394
|
+
* @param vendor The vendor string of a browser
|
|
394
395
|
* @returns The BrowserInfo object calculated from the given userAgent and appVersion
|
|
395
396
|
*/
|
|
396
|
-
export function getBrowserInfo(userAgent: string, appVersion: string): BrowserInfo;
|
|
397
|
+
export function getBrowserInfo(userAgent: string, appVersion: string, vendor?: string): BrowserInfo;
|
|
397
398
|
|
|
398
399
|
/**
|
|
399
400
|
* Apply format to an HTML element
|
|
@@ -985,6 +986,12 @@ export class VList {
|
|
|
985
986
|
* @param targetType Target list type
|
|
986
987
|
*/
|
|
987
988
|
changeListType(start: NodePosition, end: NodePosition, targetType: ListType | CompatibleListType): void;
|
|
989
|
+
/**
|
|
990
|
+
* Change list style of the given range of this list.
|
|
991
|
+
* If some of the items are not real list item yet, this will make them to be list item with given style
|
|
992
|
+
* @param targetStyle Target list style
|
|
993
|
+
*/
|
|
994
|
+
setListStyleType(targetStyle: NumberingListType | BulletListType | CompatibleBulletListType | CompatibleNumberingListType): void;
|
|
988
995
|
/**
|
|
989
996
|
* Append a new item to this VList
|
|
990
997
|
* @param node node of the item to append. If it is not wrapped with LI tag, it will be wrapped
|
|
@@ -1123,6 +1130,12 @@ export class VListItem {
|
|
|
1123
1130
|
* @param isDummy Whether the item is a dummy item
|
|
1124
1131
|
*/
|
|
1125
1132
|
setNewListStart(startNumber: number): void;
|
|
1133
|
+
/**
|
|
1134
|
+
* Apply the list style type
|
|
1135
|
+
* @param rootList the vList that receives the style
|
|
1136
|
+
* @param index the list item index
|
|
1137
|
+
*/
|
|
1138
|
+
applyListStyle(rootList: HTMLOListElement | HTMLUListElement, index: number): void;
|
|
1126
1139
|
/**
|
|
1127
1140
|
* Write the change result back into DOM
|
|
1128
1141
|
* @param listStack current stack of list elements
|
|
@@ -1697,6 +1710,88 @@ export function deleteSelectedContent(root: HTMLElement, range: Range): null;
|
|
|
1697
1710
|
*/
|
|
1698
1711
|
export function getTextContent(rootNode: Node): string;
|
|
1699
1712
|
|
|
1713
|
+
/**
|
|
1714
|
+
* Validate the given object with a type definition object
|
|
1715
|
+
* @param input The object to validate
|
|
1716
|
+
* @param def The type definition object used for validation
|
|
1717
|
+
* @returns True if the object passed the validation, otherwise false
|
|
1718
|
+
*/
|
|
1719
|
+
export function validate<T>(input: any, def: Definition<T>): input is T;
|
|
1720
|
+
|
|
1721
|
+
/**
|
|
1722
|
+
* Create a number definition
|
|
1723
|
+
* @param isOptional Whether this property is optional
|
|
1724
|
+
* @param value Optional value of the number
|
|
1725
|
+
* @param minValue Optional minimum value
|
|
1726
|
+
* @param maxValue Optional maximum value
|
|
1727
|
+
* @param allowNull Allow the property to be null
|
|
1728
|
+
* @returns The number definition object
|
|
1729
|
+
*/
|
|
1730
|
+
export function createNumberDefinition(isOptional?: boolean, value?: number, minValue?: number, maxValue?: number, allowNull?: boolean): NumberDefinition;
|
|
1731
|
+
|
|
1732
|
+
/**
|
|
1733
|
+
* Create a boolean definition
|
|
1734
|
+
* @param isOptional Whether this property is optional
|
|
1735
|
+
* @param value Optional expected boolean value
|
|
1736
|
+
* @param allowNull Allow the property to be null
|
|
1737
|
+
* @returns The boolean definition object
|
|
1738
|
+
*/
|
|
1739
|
+
export function createBooleanDefinition(isOptional?: boolean, value?: boolean, allowNull?: boolean): BooleanDefinition;
|
|
1740
|
+
|
|
1741
|
+
/**
|
|
1742
|
+
* Create a string definition
|
|
1743
|
+
* @param isOptional Whether this property is optional
|
|
1744
|
+
* @param value Optional expected string value
|
|
1745
|
+
* @param allowNull Allow the property to be null
|
|
1746
|
+
* @returns The string definition object
|
|
1747
|
+
*/
|
|
1748
|
+
export function createStringDefinition(isOptional?: boolean, value?: string, allowNull?: boolean): StringDefinition;
|
|
1749
|
+
|
|
1750
|
+
/**
|
|
1751
|
+
* Create an array definition
|
|
1752
|
+
* @param itemDef Definition of each item of the related array
|
|
1753
|
+
* @param isOptional Whether this property is optional
|
|
1754
|
+
* @param allowNull Allow the property to be null
|
|
1755
|
+
* @returns The array definition object
|
|
1756
|
+
*/
|
|
1757
|
+
export function createArrayDefinition<T>(itemDef: Definition<T>, isOptional?: boolean, minLength?: number, maxLength?: number, allowNull?: boolean): ArrayDefinition<T[]>;
|
|
1758
|
+
|
|
1759
|
+
/**
|
|
1760
|
+
* Create an object definition
|
|
1761
|
+
* @param propertyDef Definition of each property of the related object
|
|
1762
|
+
* @param isOptional Whether this property is optional
|
|
1763
|
+
* @param allowNull Allow the property to be null
|
|
1764
|
+
* @returns The object definition object
|
|
1765
|
+
*/
|
|
1766
|
+
export function createObjectDefinition<T extends Object>(propertyDef: ObjectPropertyDefinition<T>, isOptional?: boolean, allowNull?: boolean): ObjectDefinition<T>;
|
|
1767
|
+
|
|
1768
|
+
/**
|
|
1769
|
+
* Get metadata object from an HTML element
|
|
1770
|
+
* @param element The HTML element to get metadata object from
|
|
1771
|
+
* @param definition The type definition of this metadata used for validate this metadata object.
|
|
1772
|
+
* If not specified, no validation will be performed and always return whatever we get from the element
|
|
1773
|
+
* @param defaultValue The default value to return if the retrieved object cannot pass the validation,
|
|
1774
|
+
* or there is no metadata object at all
|
|
1775
|
+
* @returns The strong-type metadata object if it can be validated, or null
|
|
1776
|
+
*/
|
|
1777
|
+
export function getMetadata<T>(element: HTMLElement, definition?: Definition<T>, defaultValue?: T): T | null;
|
|
1778
|
+
|
|
1779
|
+
/**
|
|
1780
|
+
* Set metadata object into an HTML element
|
|
1781
|
+
* @param element The HTML element to set metadata object to
|
|
1782
|
+
* @param metadata The metadata object to set
|
|
1783
|
+
* @param def An optional type definition object used for validate this metadata object.
|
|
1784
|
+
* If not specified, metadata will be set without validation
|
|
1785
|
+
* @returns True if metadata is set, otherwise false
|
|
1786
|
+
*/
|
|
1787
|
+
export function setMetadata<T>(element: HTMLElement, metadata: T, def?: Definition<T>): boolean;
|
|
1788
|
+
|
|
1789
|
+
/**
|
|
1790
|
+
* Remove metadata from the given element if any
|
|
1791
|
+
* @param element The element to remove metadata from
|
|
1792
|
+
*/
|
|
1793
|
+
export function removeMetadata(element: HTMLElement): void;
|
|
1794
|
+
|
|
1700
1795
|
/**
|
|
1701
1796
|
* RoosterJs core editor class
|
|
1702
1797
|
*/
|
|
@@ -1872,7 +1967,7 @@ export class Editor implements IEditor {
|
|
|
1872
1967
|
* @returns the event object which is really passed into plugins. Some plugin may modify the event object so
|
|
1873
1968
|
* the result of this function provides a chance to read the modified result
|
|
1874
1969
|
*/
|
|
1875
|
-
triggerPluginEvent<T extends PluginEventType>(eventType: T, data: PluginEventData<T>, broadcast?: boolean): PluginEventFromType<T>;
|
|
1970
|
+
triggerPluginEvent<T extends PluginEventType | CompatiblePluginEventType>(eventType: T, data: PluginEventData<T>, broadcast?: boolean): PluginEventFromType<T>;
|
|
1876
1971
|
/**
|
|
1877
1972
|
* Trigger a ContentChangedEvent
|
|
1878
1973
|
* @param source Source of this event, by default is 'SetContent'
|
|
@@ -2143,15 +2238,17 @@ export function insertEntity(editor: IEditor, type: string, contentNode: Node, i
|
|
|
2143
2238
|
* @param editor The editor instance
|
|
2144
2239
|
* @param imageFile The image file. There are at least 3 ways to obtain the file object:
|
|
2145
2240
|
* From local file, from clipboard data, from drag-and-drop
|
|
2241
|
+
* @param attributes Optional image element attributes
|
|
2146
2242
|
*/
|
|
2147
|
-
export function insertImage(editor: IEditor, imageFile: File): void;
|
|
2243
|
+
export function insertImage(editor: IEditor, imageFile: File, attributes?: Record<string, string>): void;
|
|
2148
2244
|
|
|
2149
2245
|
/**
|
|
2150
2246
|
* Insert an image to editor at current selection
|
|
2151
2247
|
* @param editor The editor instance
|
|
2152
|
-
* @param
|
|
2248
|
+
* @param url The image link
|
|
2249
|
+
* @param attributes Optional image element attributes
|
|
2153
2250
|
*/
|
|
2154
|
-
export function insertImage(editor: IEditor, url: string): void;
|
|
2251
|
+
export function insertImage(editor: IEditor, url: string, attributes?: Record<string, string>): void;
|
|
2155
2252
|
|
|
2156
2253
|
/**
|
|
2157
2254
|
* Insert table into editor at current selection
|
|
@@ -2321,8 +2418,9 @@ export function toggleBold(editor: IEditor): void;
|
|
|
2321
2418
|
* If selection contains both bullet/numbering and normal text, the behavior is decided by corresponding
|
|
2322
2419
|
* browser execCommand API
|
|
2323
2420
|
* @param editor The editor instance
|
|
2421
|
+
* @param listStyle (Optional) the style of the bullet list. If not defined, the style will be set to disc.
|
|
2324
2422
|
*/
|
|
2325
|
-
export function toggleBullet(editor: IEditor): void;
|
|
2423
|
+
export function toggleBullet(editor: IEditor, listStyle?: BulletListType | CompatibleBulletListType): void;
|
|
2326
2424
|
|
|
2327
2425
|
/**
|
|
2328
2426
|
* Toggle italic at selection
|
|
@@ -2342,8 +2440,9 @@ export function toggleItalic(editor: IEditor): void;
|
|
|
2342
2440
|
* realization of browser execCommand API
|
|
2343
2441
|
* @param editor The editor instance
|
|
2344
2442
|
* @param startNumber (Optional) Start number of the list
|
|
2443
|
+
* @param listStyle (Optional) The style of the numbering list. If not defined, the style will be set to decimal.
|
|
2345
2444
|
*/
|
|
2346
|
-
export function toggleNumbering(editor: IEditor, startNumber?: number): void;
|
|
2445
|
+
export function toggleNumbering(editor: IEditor, startNumber?: number, listStyle?: NumberingListType | CompatibleNumberingListType): void;
|
|
2347
2446
|
|
|
2348
2447
|
/**
|
|
2349
2448
|
* Resets Ordered List Numbering back to the value of the parameter startNumber
|
|
@@ -2445,8 +2544,9 @@ export function applyCellShading(editor: IEditor, color: string | ModeIndependen
|
|
|
2445
2544
|
* @param listType The list type to toggle
|
|
2446
2545
|
* @param startNumber (Optional) Start number of the list
|
|
2447
2546
|
* @param includeSiblingLists Sets wether the operation should include Sibling Lists, by default true
|
|
2547
|
+
* @param listStyle (Optional) the style of an ordered or unordered list. If If not defined, the style will be set to disc or decimal.
|
|
2448
2548
|
*/
|
|
2449
|
-
export function toggleListType(editor: IEditor, listType: ListType | CompatibleListType, startNumber?: number, includeSiblingLists?: boolean): void;
|
|
2549
|
+
export function toggleListType(editor: IEditor, listType: ListType | CompatibleListType, startNumber?: number, includeSiblingLists?: boolean, listStyle?: BulletListType | NumberingListType | CompatibleBulletListType | CompatibleNumberingListType): void;
|
|
2450
2550
|
|
|
2451
2551
|
/**
|
|
2452
2552
|
* Split selection into regions, and perform a block-wise formatting action for each region.
|
|
@@ -2514,6 +2614,10 @@ export interface BrowserInfo {
|
|
|
2514
2614
|
* Whether current OS is Android
|
|
2515
2615
|
*/
|
|
2516
2616
|
readonly isAndroid?: boolean;
|
|
2617
|
+
/**
|
|
2618
|
+
* Whether current browser is on mobile or a tablet
|
|
2619
|
+
*/
|
|
2620
|
+
readonly isMobileOrTablet?: boolean;
|
|
2517
2621
|
}
|
|
2518
2622
|
|
|
2519
2623
|
/**
|
|
@@ -3364,7 +3468,16 @@ export const enum ExperimentalFeatures {
|
|
|
3364
3468
|
/**
|
|
3365
3469
|
* Align list elements elements to left, center and right using setAlignment API
|
|
3366
3470
|
*/
|
|
3367
|
-
ListItemAlignment = "ListItemAlignment"
|
|
3471
|
+
ListItemAlignment = "ListItemAlignment",
|
|
3472
|
+
/**
|
|
3473
|
+
* Trigger formatting by a especial characters. Ex: (A), 1. i).
|
|
3474
|
+
*/
|
|
3475
|
+
AutoFormatList = "AutoFormatList",
|
|
3476
|
+
/**
|
|
3477
|
+
* @deprecated this feature is always disabled
|
|
3478
|
+
* Automatically transform -- into hyphen, if typed between two words.
|
|
3479
|
+
*/
|
|
3480
|
+
AutoHyphen = "AutoHyphen"
|
|
3368
3481
|
}
|
|
3369
3482
|
|
|
3370
3483
|
/**
|
|
@@ -3916,6 +4029,152 @@ export const enum SelectionRangeTypes {
|
|
|
3916
4029
|
TableSelection = 1
|
|
3917
4030
|
}
|
|
3918
4031
|
|
|
4032
|
+
/**
|
|
4033
|
+
* Enum used to control the different types of numbering list
|
|
4034
|
+
*/
|
|
4035
|
+
export const enum NumberingListType {
|
|
4036
|
+
/**
|
|
4037
|
+
* Numbering triggered by 1.
|
|
4038
|
+
*/
|
|
4039
|
+
Decimal = 0,
|
|
4040
|
+
/**
|
|
4041
|
+
* Numbering triggered by 1-
|
|
4042
|
+
*/
|
|
4043
|
+
DecimalDash = 1,
|
|
4044
|
+
/**
|
|
4045
|
+
* Numbering triggered by 1)
|
|
4046
|
+
*/
|
|
4047
|
+
DecimalParenthesis = 2,
|
|
4048
|
+
/**
|
|
4049
|
+
* Numbering triggered by (1)
|
|
4050
|
+
*/
|
|
4051
|
+
DecimalDoubleParenthesis = 3,
|
|
4052
|
+
/**
|
|
4053
|
+
* Numbering triggered by a.
|
|
4054
|
+
*/
|
|
4055
|
+
LowerAlpha = 4,
|
|
4056
|
+
/**
|
|
4057
|
+
* Numbering triggered by a)
|
|
4058
|
+
*/
|
|
4059
|
+
LowerAlphaParenthesis = 5,
|
|
4060
|
+
/**
|
|
4061
|
+
* Numbering triggered by (a)
|
|
4062
|
+
*/
|
|
4063
|
+
LowerAlphaDoubleParenthesis = 6,
|
|
4064
|
+
/**
|
|
4065
|
+
* Numbering triggered by a-
|
|
4066
|
+
*/
|
|
4067
|
+
LowerAlphaDash = 7,
|
|
4068
|
+
/**
|
|
4069
|
+
* Numbering triggered by A.
|
|
4070
|
+
*/
|
|
4071
|
+
UpperAlpha = 8,
|
|
4072
|
+
/**
|
|
4073
|
+
* Numbering triggered by A)
|
|
4074
|
+
*/
|
|
4075
|
+
UpperAlphaParenthesis = 9,
|
|
4076
|
+
/**
|
|
4077
|
+
* Numbering triggered by (A)
|
|
4078
|
+
*/
|
|
4079
|
+
UpperAlphaDoubleParenthesis = 10,
|
|
4080
|
+
/**
|
|
4081
|
+
* Numbering triggered by A-
|
|
4082
|
+
*/
|
|
4083
|
+
UpperAlphaDash = 11,
|
|
4084
|
+
/**
|
|
4085
|
+
* Numbering triggered by i.
|
|
4086
|
+
*/
|
|
4087
|
+
LowerRoman = 12,
|
|
4088
|
+
/**
|
|
4089
|
+
* Numbering triggered by i)
|
|
4090
|
+
*/
|
|
4091
|
+
LowerRomanParenthesis = 13,
|
|
4092
|
+
/**
|
|
4093
|
+
* Numbering triggered by (i)
|
|
4094
|
+
*/
|
|
4095
|
+
LowerRomanDoubleParenthesis = 14,
|
|
4096
|
+
/**
|
|
4097
|
+
* Numbering triggered by i-
|
|
4098
|
+
*/
|
|
4099
|
+
LowerRomanDash = 15,
|
|
4100
|
+
/**
|
|
4101
|
+
* Numbering triggered by I.
|
|
4102
|
+
*/
|
|
4103
|
+
UpperRoman = 16,
|
|
4104
|
+
/**
|
|
4105
|
+
* Numbering triggered by I)
|
|
4106
|
+
*/
|
|
4107
|
+
UpperRomanParenthesis = 17,
|
|
4108
|
+
/**
|
|
4109
|
+
* Numbering triggered by (I)
|
|
4110
|
+
*/
|
|
4111
|
+
UpperRomanDoubleParenthesis = 18,
|
|
4112
|
+
/**
|
|
4113
|
+
* Numbering triggered by I-
|
|
4114
|
+
*/
|
|
4115
|
+
UpperRomanDash = 19
|
|
4116
|
+
}
|
|
4117
|
+
|
|
4118
|
+
/**
|
|
4119
|
+
* Enum used to control the different types of bullet list
|
|
4120
|
+
*/
|
|
4121
|
+
export const enum BulletListType {
|
|
4122
|
+
/**
|
|
4123
|
+
* Bullet triggered by *
|
|
4124
|
+
*/
|
|
4125
|
+
Disc = 0,
|
|
4126
|
+
/**
|
|
4127
|
+
* Bullet triggered by -
|
|
4128
|
+
*/
|
|
4129
|
+
Dash = 1,
|
|
4130
|
+
/**
|
|
4131
|
+
* Bullet triggered by --
|
|
4132
|
+
*/
|
|
4133
|
+
Square = 2,
|
|
4134
|
+
/**
|
|
4135
|
+
* Bullet triggered by >
|
|
4136
|
+
*/
|
|
4137
|
+
ShortArrow = 3,
|
|
4138
|
+
/**
|
|
4139
|
+
* Bullet triggered by -> or -->
|
|
4140
|
+
*/
|
|
4141
|
+
LongArrow = 4,
|
|
4142
|
+
/**
|
|
4143
|
+
* Bullet triggered by =>
|
|
4144
|
+
*/
|
|
4145
|
+
UnfilledArrow = 5
|
|
4146
|
+
}
|
|
4147
|
+
|
|
4148
|
+
/**
|
|
4149
|
+
* Types of definitions, used by Definition type
|
|
4150
|
+
*/
|
|
4151
|
+
export const enum DefinitionType {
|
|
4152
|
+
/**
|
|
4153
|
+
* Boolean type definition, represents a boolean type value
|
|
4154
|
+
*/
|
|
4155
|
+
Boolean = 0,
|
|
4156
|
+
/**
|
|
4157
|
+
* Number type definition, represents a number type value
|
|
4158
|
+
*/
|
|
4159
|
+
Number = 1,
|
|
4160
|
+
/**
|
|
4161
|
+
* String type definition, represents a string type value
|
|
4162
|
+
*/
|
|
4163
|
+
String = 2,
|
|
4164
|
+
/**
|
|
4165
|
+
* Array type definition, represents an array with a given item type
|
|
4166
|
+
*/
|
|
4167
|
+
Array = 3,
|
|
4168
|
+
/**
|
|
4169
|
+
* Object type definition, represents an object with the given property types
|
|
4170
|
+
*/
|
|
4171
|
+
Object = 4,
|
|
4172
|
+
/**
|
|
4173
|
+
* Customize type definition, represents a customized type with a validator function
|
|
4174
|
+
*/
|
|
4175
|
+
Customize = 5
|
|
4176
|
+
}
|
|
4177
|
+
|
|
3919
4178
|
/**
|
|
3920
4179
|
* Provides a chance for plugin to change the content before it is copied from editor.
|
|
3921
4180
|
*/
|
|
@@ -3941,7 +4200,7 @@ export interface BeforeCutCopyEvent extends BasePluginEvent<PluginEventType.Befo
|
|
|
3941
4200
|
/**
|
|
3942
4201
|
* Editor plugin event interface
|
|
3943
4202
|
*/
|
|
3944
|
-
export interface BasePluginEvent<T extends PluginEventType> {
|
|
4203
|
+
export interface BasePluginEvent<T extends PluginEventType | CompatiblePluginEventType> {
|
|
3945
4204
|
/**
|
|
3946
4205
|
* Type of this event
|
|
3947
4206
|
*/
|
|
@@ -4108,7 +4367,7 @@ export type PluginDomEvent = PluginCompositionEvent | PluginMouseEvent | PluginK
|
|
|
4108
4367
|
/**
|
|
4109
4368
|
* A base interface of all DOM events
|
|
4110
4369
|
*/
|
|
4111
|
-
export interface PluginDomEventBase<TEventType extends PluginEventType, TRawEvent extends Event> extends BasePluginEvent<TEventType> {
|
|
4370
|
+
export interface PluginDomEventBase<TEventType extends PluginEventType | CompatiblePluginEventType, TRawEvent extends Event> extends BasePluginEvent<TEventType> {
|
|
4112
4371
|
rawEvent: TRawEvent;
|
|
4113
4372
|
}
|
|
4114
4373
|
|
|
@@ -4195,24 +4454,24 @@ export type PluginEvent = BeforeCutCopyEvent | BeforePasteEvent | ContentChanged
|
|
|
4195
4454
|
/**
|
|
4196
4455
|
* A type to extract data part of a plugin event type. Data part is the plugin event without eventType field.
|
|
4197
4456
|
*/
|
|
4198
|
-
export type PluginEventData<T extends PluginEventType> = PluginEventDataGeneric<PluginEvent, T>;
|
|
4457
|
+
export type PluginEventData<T extends PluginEventType | CompatiblePluginEventType> = PluginEventDataGeneric<PluginEvent, T>;
|
|
4199
4458
|
|
|
4200
4459
|
/**
|
|
4201
4460
|
* A type to extract data part of a plugin event type. Data part is the plugin event without eventType field.
|
|
4202
4461
|
* This type is a middle result and only used by PluginEventData type
|
|
4203
4462
|
*/
|
|
4204
|
-
export type PluginEventDataGeneric<E extends PluginEvent, T extends PluginEventType> = E extends BasePluginEvent<T> ? Pick<E, Exclude<keyof E, 'eventType'>> : never;
|
|
4463
|
+
export type PluginEventDataGeneric<E extends PluginEvent, T extends PluginEventType | CompatiblePluginEventType> = E extends BasePluginEvent<T> ? Pick<E, Exclude<keyof E, 'eventType'>> : never;
|
|
4205
4464
|
|
|
4206
4465
|
/**
|
|
4207
4466
|
* A type to get specify plugin event type from eventType parameter.
|
|
4208
4467
|
*/
|
|
4209
|
-
export type PluginEventFromType<T extends PluginEventType> = PluginEventFromTypeGeneric<PluginEvent, T>;
|
|
4468
|
+
export type PluginEventFromType<T extends PluginEventType | CompatiblePluginEventType> = PluginEventFromTypeGeneric<PluginEvent, T>;
|
|
4210
4469
|
|
|
4211
4470
|
/**
|
|
4212
4471
|
* A type to get specify plugin event type from eventType parameter.
|
|
4213
4472
|
* This type is a middle result and only used by PluginEventFromType type
|
|
4214
4473
|
*/
|
|
4215
|
-
export type PluginEventFromTypeGeneric<E extends PluginEvent, T extends PluginEventType> = E extends BasePluginEvent<T> ? E : never;
|
|
4474
|
+
export type PluginEventFromTypeGeneric<E extends PluginEvent, T extends PluginEventType | CompatiblePluginEventType> = E extends BasePluginEvent<T> ? E : never;
|
|
4216
4475
|
|
|
4217
4476
|
/**
|
|
4218
4477
|
* A plugin triggered right after editor has entered Shadow Edit mode
|
|
@@ -5549,7 +5808,7 @@ export interface IEditor {
|
|
|
5549
5808
|
* @returns the event object which is really passed into plugins. Some plugin may modify the event object so
|
|
5550
5809
|
* the result of this function provides a chance to read the modified result
|
|
5551
5810
|
*/
|
|
5552
|
-
triggerPluginEvent<T extends PluginEventType>(eventType: T, data: PluginEventData<T>, broadcast?: boolean): PluginEventFromType<T>;
|
|
5811
|
+
triggerPluginEvent<T extends PluginEventType | CompatiblePluginEventType>(eventType: T, data: PluginEventData<T>, broadcast?: boolean): PluginEventFromType<T>;
|
|
5553
5812
|
/**
|
|
5554
5813
|
* Trigger a ContentChangedEvent
|
|
5555
5814
|
* @param source Source of this event, by default is 'SetContent'
|
|
@@ -6573,6 +6832,12 @@ export interface TextFeatureSettings {
|
|
|
6573
6832
|
* If Whole Paragraph selected, outdent paragraph
|
|
6574
6833
|
*/
|
|
6575
6834
|
outdentWhenTabText: boolean;
|
|
6835
|
+
/**
|
|
6836
|
+
* @deprecated
|
|
6837
|
+
* Requires @see ExperimentalFeatures.AutoHyphen to be enabled
|
|
6838
|
+
* Automatically transform -- into hyphen, if typed between two words.
|
|
6839
|
+
*/
|
|
6840
|
+
autoHyphen: boolean;
|
|
6576
6841
|
}
|
|
6577
6842
|
|
|
6578
6843
|
/**
|
|
@@ -6615,7 +6880,7 @@ export interface UndoSnapshotsService<T = string> {
|
|
|
6615
6880
|
* @param step The step to move
|
|
6616
6881
|
* @returns If can move with the given step, returns the snapshot after move, otherwise null
|
|
6617
6882
|
*/
|
|
6618
|
-
move(step: number): T;
|
|
6883
|
+
move(step: number): T | null;
|
|
6619
6884
|
/**
|
|
6620
6885
|
* Add a new undo snapshot
|
|
6621
6886
|
* @param snapshot The snapshot to add
|
|
@@ -6961,7 +7226,7 @@ export interface DOMEventHandlerObject {
|
|
|
6961
7226
|
/**
|
|
6962
7227
|
* Combined event handler type with all 3 possibilities
|
|
6963
7228
|
*/
|
|
6964
|
-
export type DOMEventHandler = PluginEventType | DOMEventHandlerFunction | DOMEventHandlerObject;
|
|
7229
|
+
export type DOMEventHandler = PluginEventType | CompatiblePluginEventType | DOMEventHandlerFunction | DOMEventHandlerObject;
|
|
6965
7230
|
|
|
6966
7231
|
/**
|
|
6967
7232
|
* A handler type to convert HTML string to a trust HTML string
|
|
@@ -6977,6 +7242,120 @@ export type TrustedHTMLHandler = (html: string) => string;
|
|
|
6977
7242
|
*/
|
|
6978
7243
|
export type SizeTransformer = (size: number) => number;
|
|
6979
7244
|
|
|
7245
|
+
/**
|
|
7246
|
+
* A type template to get item type of an array
|
|
7247
|
+
*/
|
|
7248
|
+
export type ArrayItemType<T extends any[]> = T extends (infer U)[] ? U : never;
|
|
7249
|
+
|
|
7250
|
+
/**
|
|
7251
|
+
* Base interface of property definition
|
|
7252
|
+
*/
|
|
7253
|
+
export interface DefinitionBase<T extends DefinitionType | CompatibleDefinitionType> {
|
|
7254
|
+
/**
|
|
7255
|
+
* Type of this property
|
|
7256
|
+
*/
|
|
7257
|
+
type: T;
|
|
7258
|
+
/**
|
|
7259
|
+
* Whether this property is optional
|
|
7260
|
+
*/
|
|
7261
|
+
isOptional?: boolean;
|
|
7262
|
+
/**
|
|
7263
|
+
* Whether this property is allowed to be null
|
|
7264
|
+
*/
|
|
7265
|
+
allowNull?: boolean;
|
|
7266
|
+
}
|
|
7267
|
+
|
|
7268
|
+
/**
|
|
7269
|
+
* String property definition. This definition can also be used for string based enum property
|
|
7270
|
+
*/
|
|
7271
|
+
export interface StringDefinition extends DefinitionBase<DefinitionType.String | CompatibleDefinitionType.String> {
|
|
7272
|
+
/**
|
|
7273
|
+
* An optional value of this property. When specified, the given property must have exactly same value of this value
|
|
7274
|
+
*/
|
|
7275
|
+
value?: string;
|
|
7276
|
+
}
|
|
7277
|
+
|
|
7278
|
+
/**
|
|
7279
|
+
* Number property definition. This definition can also be used for number based enum property
|
|
7280
|
+
*/
|
|
7281
|
+
export interface NumberDefinition extends DefinitionBase<DefinitionType.Number | CompatibleDefinitionType.Number> {
|
|
7282
|
+
/**
|
|
7283
|
+
* An optional value of this property. When specified, the given property must have same value of this value
|
|
7284
|
+
*/
|
|
7285
|
+
value?: number;
|
|
7286
|
+
/**
|
|
7287
|
+
* An optional minimum value of this property. When specified, the given property must be greater or equal to this value
|
|
7288
|
+
*/
|
|
7289
|
+
minValue?: number;
|
|
7290
|
+
/**
|
|
7291
|
+
* An optional maximum value of this property. When specified, the given property must be less or equal to this value
|
|
7292
|
+
*/
|
|
7293
|
+
maxValue?: number;
|
|
7294
|
+
}
|
|
7295
|
+
|
|
7296
|
+
/**
|
|
7297
|
+
* Boolean property definition
|
|
7298
|
+
*/
|
|
7299
|
+
export interface BooleanDefinition extends DefinitionBase<DefinitionType.Boolean | CompatibleDefinitionType.Boolean> {
|
|
7300
|
+
/**
|
|
7301
|
+
* An optional value of this property. When specified, the given property must have same value of this value
|
|
7302
|
+
*/
|
|
7303
|
+
value?: boolean;
|
|
7304
|
+
}
|
|
7305
|
+
|
|
7306
|
+
/**
|
|
7307
|
+
* Array property definition.
|
|
7308
|
+
*/
|
|
7309
|
+
export interface ArrayDefinition<T extends any[]> extends DefinitionBase<DefinitionType.Array | CompatibleDefinitionType.Array> {
|
|
7310
|
+
/**
|
|
7311
|
+
* Definition of each item of this array. All items of the given array must have the same type. Otherwise, use CustomizeDefinition instead.
|
|
7312
|
+
*/
|
|
7313
|
+
itemDef: Definition<ArrayItemType<T>>;
|
|
7314
|
+
/**
|
|
7315
|
+
* An optional minimum length of this array. When specified, the given array must have at least this value of items
|
|
7316
|
+
*/
|
|
7317
|
+
minLength?: number;
|
|
7318
|
+
/**
|
|
7319
|
+
* An optional maximum length of this array. When specified, the given array must have at most this value of items
|
|
7320
|
+
*/
|
|
7321
|
+
maxLength?: number;
|
|
7322
|
+
}
|
|
7323
|
+
|
|
7324
|
+
/**
|
|
7325
|
+
* Object property definition.
|
|
7326
|
+
*/
|
|
7327
|
+
export interface ObjectDefinition<T extends Object> extends DefinitionBase<DefinitionType.Object | CompatibleDefinitionType.Object> {
|
|
7328
|
+
/**
|
|
7329
|
+
* A key-value map to specify the definition of each possible property of this object
|
|
7330
|
+
*/
|
|
7331
|
+
propertyDef: ObjectPropertyDefinition<T>;
|
|
7332
|
+
}
|
|
7333
|
+
|
|
7334
|
+
/**
|
|
7335
|
+
* Object property definition type used by Object Definition
|
|
7336
|
+
*/
|
|
7337
|
+
export type ObjectPropertyDefinition<T extends Object> = {
|
|
7338
|
+
[Key in keyof T]: Definition<T[Key]>;
|
|
7339
|
+
};
|
|
7340
|
+
|
|
7341
|
+
/**
|
|
7342
|
+
* Customize property definition. When all other property definition type cannot satisfy your requirement,
|
|
7343
|
+
* use this definition with a customized validator function to do property validation.
|
|
7344
|
+
*/
|
|
7345
|
+
export interface CustomizeDefinition extends DefinitionBase<DefinitionType.Customize | CompatibleDefinitionType.Customize> {
|
|
7346
|
+
/**
|
|
7347
|
+
* The customized validator function to do customized validation
|
|
7348
|
+
* @param input The value to validate
|
|
7349
|
+
* @returns True means the given value is of the specified type, otherwise false
|
|
7350
|
+
*/
|
|
7351
|
+
validator: (input: any) => boolean;
|
|
7352
|
+
}
|
|
7353
|
+
|
|
7354
|
+
/**
|
|
7355
|
+
* A combination of all definition types
|
|
7356
|
+
*/
|
|
7357
|
+
export type Definition<T> = CustomizeDefinition | (T extends any[] ? ArrayDefinition<T> : T extends Record<string, any> ? ObjectDefinition<T> : T extends String ? StringDefinition : T extends Number ? NumberDefinition : T extends Boolean ? BooleanDefinition : never);
|
|
7358
|
+
|
|
6980
7359
|
/**
|
|
6981
7360
|
* Experimental feature flags
|
|
6982
7361
|
*/
|
|
@@ -7041,7 +7420,114 @@ export enum CompatibleExperimentalFeatures {
|
|
|
7041
7420
|
/**
|
|
7042
7421
|
* Align list elements elements to left, center and right using setAlignment API
|
|
7043
7422
|
*/
|
|
7044
|
-
ListItemAlignment = "ListItemAlignment"
|
|
7423
|
+
ListItemAlignment = "ListItemAlignment",
|
|
7424
|
+
/**
|
|
7425
|
+
* Trigger formatting by a especial characters. Ex: (A), 1. i).
|
|
7426
|
+
*/
|
|
7427
|
+
AutoFormatList = "AutoFormatList",
|
|
7428
|
+
/**
|
|
7429
|
+
* @deprecated this feature is always disabled
|
|
7430
|
+
* Automatically transform -- into hyphen, if typed between two words.
|
|
7431
|
+
*/
|
|
7432
|
+
AutoHyphen = "AutoHyphen"
|
|
7433
|
+
}
|
|
7434
|
+
|
|
7435
|
+
/**
|
|
7436
|
+
* Editor plugin event type
|
|
7437
|
+
*/
|
|
7438
|
+
export enum CompatiblePluginEventType {
|
|
7439
|
+
/**
|
|
7440
|
+
* HTML KeyDown event
|
|
7441
|
+
*/
|
|
7442
|
+
KeyDown = 0,
|
|
7443
|
+
/**
|
|
7444
|
+
* HTML KeyPress event
|
|
7445
|
+
*/
|
|
7446
|
+
KeyPress = 1,
|
|
7447
|
+
/**
|
|
7448
|
+
* HTML KeyUp event
|
|
7449
|
+
*/
|
|
7450
|
+
KeyUp = 2,
|
|
7451
|
+
/**
|
|
7452
|
+
* HTML Input / TextInput event
|
|
7453
|
+
*/
|
|
7454
|
+
Input = 3,
|
|
7455
|
+
/**
|
|
7456
|
+
* HTML CompositionEnd event
|
|
7457
|
+
*/
|
|
7458
|
+
CompositionEnd = 4,
|
|
7459
|
+
/**
|
|
7460
|
+
* HTML MouseDown event
|
|
7461
|
+
*/
|
|
7462
|
+
MouseDown = 5,
|
|
7463
|
+
/**
|
|
7464
|
+
* HTML MouseUp event
|
|
7465
|
+
*/
|
|
7466
|
+
MouseUp = 6,
|
|
7467
|
+
/**
|
|
7468
|
+
* Content changed event
|
|
7469
|
+
*/
|
|
7470
|
+
ContentChanged = 7,
|
|
7471
|
+
/**
|
|
7472
|
+
* Extract Content with a DOM tree event
|
|
7473
|
+
* This event is triggered when getContent() is called with triggerExtractContentEvent = true
|
|
7474
|
+
* Plugin can handle this event to remove the UI only markups to return clean HTML
|
|
7475
|
+
* by operating on a cloned DOM tree
|
|
7476
|
+
*/
|
|
7477
|
+
ExtractContentWithDom = 8,
|
|
7478
|
+
/**
|
|
7479
|
+
* Before Paste event, provide a chance to change copied content
|
|
7480
|
+
*/
|
|
7481
|
+
BeforeCutCopy = 9,
|
|
7482
|
+
/**
|
|
7483
|
+
* Before Paste event, provide a chance to change paste content
|
|
7484
|
+
*/
|
|
7485
|
+
BeforePaste = 10,
|
|
7486
|
+
/**
|
|
7487
|
+
* Let plugin know editor is ready now
|
|
7488
|
+
*/
|
|
7489
|
+
EditorReady = 11,
|
|
7490
|
+
/**
|
|
7491
|
+
* Let plugin know editor is about to dispose
|
|
7492
|
+
*/
|
|
7493
|
+
BeforeDispose = 12,
|
|
7494
|
+
/**
|
|
7495
|
+
* Pending format state (bold, italic, underline, ... with collapsed selection) is changed
|
|
7496
|
+
*/
|
|
7497
|
+
PendingFormatStateChanged = 13,
|
|
7498
|
+
/**
|
|
7499
|
+
* Scroll event triggered by scroll container
|
|
7500
|
+
*/
|
|
7501
|
+
Scroll = 14,
|
|
7502
|
+
/**
|
|
7503
|
+
* Operating on an entity. See enum EntityOperation for more details about each operation
|
|
7504
|
+
*/
|
|
7505
|
+
EntityOperation = 15,
|
|
7506
|
+
/**
|
|
7507
|
+
* HTML ContextMenu event
|
|
7508
|
+
*/
|
|
7509
|
+
ContextMenu = 16,
|
|
7510
|
+
/**
|
|
7511
|
+
* Editor has entered shadow edit mode
|
|
7512
|
+
*/
|
|
7513
|
+
EnteredShadowEdit = 17,
|
|
7514
|
+
/**
|
|
7515
|
+
* Editor is about to leave shadow edit mode
|
|
7516
|
+
*/
|
|
7517
|
+
LeavingShadowEdit = 18,
|
|
7518
|
+
/**
|
|
7519
|
+
* Content of image is being changed from client side
|
|
7520
|
+
*/
|
|
7521
|
+
EditImage = 19,
|
|
7522
|
+
/**
|
|
7523
|
+
* Content of editor is about to be cleared by SetContent API, handle this event to cache anything you need
|
|
7524
|
+
* before it is gone
|
|
7525
|
+
*/
|
|
7526
|
+
BeforeSetContent = 20,
|
|
7527
|
+
/**
|
|
7528
|
+
* Zoom scale value is changed, triggered by Editor.setZoomScale() when set a different scale number
|
|
7529
|
+
*/
|
|
7530
|
+
ZoomChanged = 21
|
|
7045
7531
|
}
|
|
7046
7532
|
|
|
7047
7533
|
/**
|
|
@@ -7355,101 +7841,33 @@ export enum CompatibleSelectionRangeTypes {
|
|
|
7355
7841
|
}
|
|
7356
7842
|
|
|
7357
7843
|
/**
|
|
7358
|
-
*
|
|
7844
|
+
* Types of definitions, used by Definition type
|
|
7359
7845
|
*/
|
|
7360
|
-
export enum
|
|
7846
|
+
export enum CompatibleDefinitionType {
|
|
7361
7847
|
/**
|
|
7362
|
-
*
|
|
7848
|
+
* Boolean type definition, represents a boolean type value
|
|
7363
7849
|
*/
|
|
7364
|
-
|
|
7850
|
+
Boolean = 0,
|
|
7365
7851
|
/**
|
|
7366
|
-
*
|
|
7852
|
+
* Number type definition, represents a number type value
|
|
7367
7853
|
*/
|
|
7368
|
-
|
|
7854
|
+
Number = 1,
|
|
7369
7855
|
/**
|
|
7370
|
-
*
|
|
7856
|
+
* String type definition, represents a string type value
|
|
7371
7857
|
*/
|
|
7372
|
-
|
|
7858
|
+
String = 2,
|
|
7373
7859
|
/**
|
|
7374
|
-
*
|
|
7860
|
+
* Array type definition, represents an array with a given item type
|
|
7375
7861
|
*/
|
|
7376
|
-
|
|
7862
|
+
Array = 3,
|
|
7377
7863
|
/**
|
|
7378
|
-
*
|
|
7864
|
+
* Object type definition, represents an object with the given property types
|
|
7379
7865
|
*/
|
|
7380
|
-
|
|
7866
|
+
Object = 4,
|
|
7381
7867
|
/**
|
|
7382
|
-
*
|
|
7868
|
+
* Customize type definition, represents a customized type with a validator function
|
|
7383
7869
|
*/
|
|
7384
|
-
|
|
7385
|
-
/**
|
|
7386
|
-
* HTML MouseUp event
|
|
7387
|
-
*/
|
|
7388
|
-
MouseUp = 6,
|
|
7389
|
-
/**
|
|
7390
|
-
* Content changed event
|
|
7391
|
-
*/
|
|
7392
|
-
ContentChanged = 7,
|
|
7393
|
-
/**
|
|
7394
|
-
* Extract Content with a DOM tree event
|
|
7395
|
-
* This event is triggered when getContent() is called with triggerExtractContentEvent = true
|
|
7396
|
-
* Plugin can handle this event to remove the UI only markups to return clean HTML
|
|
7397
|
-
* by operating on a cloned DOM tree
|
|
7398
|
-
*/
|
|
7399
|
-
ExtractContentWithDom = 8,
|
|
7400
|
-
/**
|
|
7401
|
-
* Before Paste event, provide a chance to change copied content
|
|
7402
|
-
*/
|
|
7403
|
-
BeforeCutCopy = 9,
|
|
7404
|
-
/**
|
|
7405
|
-
* Before Paste event, provide a chance to change paste content
|
|
7406
|
-
*/
|
|
7407
|
-
BeforePaste = 10,
|
|
7408
|
-
/**
|
|
7409
|
-
* Let plugin know editor is ready now
|
|
7410
|
-
*/
|
|
7411
|
-
EditorReady = 11,
|
|
7412
|
-
/**
|
|
7413
|
-
* Let plugin know editor is about to dispose
|
|
7414
|
-
*/
|
|
7415
|
-
BeforeDispose = 12,
|
|
7416
|
-
/**
|
|
7417
|
-
* Pending format state (bold, italic, underline, ... with collapsed selection) is changed
|
|
7418
|
-
*/
|
|
7419
|
-
PendingFormatStateChanged = 13,
|
|
7420
|
-
/**
|
|
7421
|
-
* Scroll event triggered by scroll container
|
|
7422
|
-
*/
|
|
7423
|
-
Scroll = 14,
|
|
7424
|
-
/**
|
|
7425
|
-
* Operating on an entity. See enum EntityOperation for more details about each operation
|
|
7426
|
-
*/
|
|
7427
|
-
EntityOperation = 15,
|
|
7428
|
-
/**
|
|
7429
|
-
* HTML ContextMenu event
|
|
7430
|
-
*/
|
|
7431
|
-
ContextMenu = 16,
|
|
7432
|
-
/**
|
|
7433
|
-
* Editor has entered shadow edit mode
|
|
7434
|
-
*/
|
|
7435
|
-
EnteredShadowEdit = 17,
|
|
7436
|
-
/**
|
|
7437
|
-
* Editor is about to leave shadow edit mode
|
|
7438
|
-
*/
|
|
7439
|
-
LeavingShadowEdit = 18,
|
|
7440
|
-
/**
|
|
7441
|
-
* Content of image is being changed from client side
|
|
7442
|
-
*/
|
|
7443
|
-
EditImage = 19,
|
|
7444
|
-
/**
|
|
7445
|
-
* Content of editor is about to be cleared by SetContent API, handle this event to cache anything you need
|
|
7446
|
-
* before it is gone
|
|
7447
|
-
*/
|
|
7448
|
-
BeforeSetContent = 20,
|
|
7449
|
-
/**
|
|
7450
|
-
* Zoom scale value is changed, triggered by Editor.setZoomScale() when set a different scale number
|
|
7451
|
-
*/
|
|
7452
|
-
ZoomChanged = 21
|
|
7870
|
+
Customize = 5
|
|
7453
7871
|
}
|
|
7454
7872
|
|
|
7455
7873
|
/**
|
|
@@ -7470,6 +7888,36 @@ export enum CompatibleAlignment {
|
|
|
7470
7888
|
Right = 2
|
|
7471
7889
|
}
|
|
7472
7890
|
|
|
7891
|
+
/**
|
|
7892
|
+
* Enum used to control the different types of bullet list
|
|
7893
|
+
*/
|
|
7894
|
+
export enum CompatibleBulletListType {
|
|
7895
|
+
/**
|
|
7896
|
+
* Bullet triggered by *
|
|
7897
|
+
*/
|
|
7898
|
+
Disc = 0,
|
|
7899
|
+
/**
|
|
7900
|
+
* Bullet triggered by -
|
|
7901
|
+
*/
|
|
7902
|
+
Dash = 1,
|
|
7903
|
+
/**
|
|
7904
|
+
* Bullet triggered by --
|
|
7905
|
+
*/
|
|
7906
|
+
Square = 2,
|
|
7907
|
+
/**
|
|
7908
|
+
* Bullet triggered by >
|
|
7909
|
+
*/
|
|
7910
|
+
ShortArrow = 3,
|
|
7911
|
+
/**
|
|
7912
|
+
* Bullet triggered by -> or -->
|
|
7913
|
+
*/
|
|
7914
|
+
LongArrow = 4,
|
|
7915
|
+
/**
|
|
7916
|
+
* Bullet triggered by =>
|
|
7917
|
+
*/
|
|
7918
|
+
UnfilledArrow = 5
|
|
7919
|
+
}
|
|
7920
|
+
|
|
7473
7921
|
/**
|
|
7474
7922
|
* The enum used for controlling the capitalization of text.
|
|
7475
7923
|
* Used by changeCapitalization API
|
|
@@ -8074,6 +8522,92 @@ export enum CompatibleNodeType {
|
|
|
8074
8522
|
DocumentFragment = 11
|
|
8075
8523
|
}
|
|
8076
8524
|
|
|
8525
|
+
/**
|
|
8526
|
+
* Enum used to control the different types of numbering list
|
|
8527
|
+
*/
|
|
8528
|
+
export enum CompatibleNumberingListType {
|
|
8529
|
+
/**
|
|
8530
|
+
* Numbering triggered by 1.
|
|
8531
|
+
*/
|
|
8532
|
+
Decimal = 0,
|
|
8533
|
+
/**
|
|
8534
|
+
* Numbering triggered by 1-
|
|
8535
|
+
*/
|
|
8536
|
+
DecimalDash = 1,
|
|
8537
|
+
/**
|
|
8538
|
+
* Numbering triggered by 1)
|
|
8539
|
+
*/
|
|
8540
|
+
DecimalParenthesis = 2,
|
|
8541
|
+
/**
|
|
8542
|
+
* Numbering triggered by (1)
|
|
8543
|
+
*/
|
|
8544
|
+
DecimalDoubleParenthesis = 3,
|
|
8545
|
+
/**
|
|
8546
|
+
* Numbering triggered by a.
|
|
8547
|
+
*/
|
|
8548
|
+
LowerAlpha = 4,
|
|
8549
|
+
/**
|
|
8550
|
+
* Numbering triggered by a)
|
|
8551
|
+
*/
|
|
8552
|
+
LowerAlphaParenthesis = 5,
|
|
8553
|
+
/**
|
|
8554
|
+
* Numbering triggered by (a)
|
|
8555
|
+
*/
|
|
8556
|
+
LowerAlphaDoubleParenthesis = 6,
|
|
8557
|
+
/**
|
|
8558
|
+
* Numbering triggered by a-
|
|
8559
|
+
*/
|
|
8560
|
+
LowerAlphaDash = 7,
|
|
8561
|
+
/**
|
|
8562
|
+
* Numbering triggered by A.
|
|
8563
|
+
*/
|
|
8564
|
+
UpperAlpha = 8,
|
|
8565
|
+
/**
|
|
8566
|
+
* Numbering triggered by A)
|
|
8567
|
+
*/
|
|
8568
|
+
UpperAlphaParenthesis = 9,
|
|
8569
|
+
/**
|
|
8570
|
+
* Numbering triggered by (A)
|
|
8571
|
+
*/
|
|
8572
|
+
UpperAlphaDoubleParenthesis = 10,
|
|
8573
|
+
/**
|
|
8574
|
+
* Numbering triggered by A-
|
|
8575
|
+
*/
|
|
8576
|
+
UpperAlphaDash = 11,
|
|
8577
|
+
/**
|
|
8578
|
+
* Numbering triggered by i.
|
|
8579
|
+
*/
|
|
8580
|
+
LowerRoman = 12,
|
|
8581
|
+
/**
|
|
8582
|
+
* Numbering triggered by i)
|
|
8583
|
+
*/
|
|
8584
|
+
LowerRomanParenthesis = 13,
|
|
8585
|
+
/**
|
|
8586
|
+
* Numbering triggered by (i)
|
|
8587
|
+
*/
|
|
8588
|
+
LowerRomanDoubleParenthesis = 14,
|
|
8589
|
+
/**
|
|
8590
|
+
* Numbering triggered by i-
|
|
8591
|
+
*/
|
|
8592
|
+
LowerRomanDash = 15,
|
|
8593
|
+
/**
|
|
8594
|
+
* Numbering triggered by I.
|
|
8595
|
+
*/
|
|
8596
|
+
UpperRoman = 16,
|
|
8597
|
+
/**
|
|
8598
|
+
* Numbering triggered by I)
|
|
8599
|
+
*/
|
|
8600
|
+
UpperRomanParenthesis = 17,
|
|
8601
|
+
/**
|
|
8602
|
+
* Numbering triggered by (I)
|
|
8603
|
+
*/
|
|
8604
|
+
UpperRomanDoubleParenthesis = 18,
|
|
8605
|
+
/**
|
|
8606
|
+
* Numbering triggered by I-
|
|
8607
|
+
*/
|
|
8608
|
+
UpperRomanDash = 19
|
|
8609
|
+
}
|
|
8610
|
+
|
|
8077
8611
|
/**
|
|
8078
8612
|
* Represent the type of a position
|
|
8079
8613
|
*/
|
|
@@ -8435,6 +8969,7 @@ export class HyperLink implements EditorPlugin {
|
|
|
8435
8969
|
* ImageEdit plugin provides the ability to edit an inline image in editor, including image resizing, rotation and cropping
|
|
8436
8970
|
*/
|
|
8437
8971
|
export class ImageEdit implements EditorPlugin {
|
|
8972
|
+
private onShowResizeHandle?;
|
|
8438
8973
|
protected editor: IEditor;
|
|
8439
8974
|
protected options: ImageEditOptions;
|
|
8440
8975
|
private disposer;
|
|
@@ -8450,8 +8985,11 @@ export class ImageEdit implements EditorPlugin {
|
|
|
8450
8985
|
/**
|
|
8451
8986
|
* Create a new instance of ImageEdit
|
|
8452
8987
|
* @param options Image editing options
|
|
8988
|
+
* @param onShowResizeHandle An optional callback to allow customize resize handle element of image resizing.
|
|
8989
|
+
* To customize the resize handle element, add this callback and change the attributes of elementData then it
|
|
8990
|
+
* will be picked up by ImageEdit code
|
|
8453
8991
|
*/
|
|
8454
|
-
constructor(options?: ImageEditOptions);
|
|
8992
|
+
constructor(options?: ImageEditOptions, onShowResizeHandle?: OnShowResizeHandle);
|
|
8455
8993
|
/**
|
|
8456
8994
|
* Get a friendly name of this plugin
|
|
8457
8995
|
*/
|
|
@@ -8553,6 +9091,25 @@ export function isResizedTo(image: HTMLImageElement, percentage: number): boolea
|
|
|
8553
9091
|
*/
|
|
8554
9092
|
export function resetImage(editor: IEditor, image: HTMLImageElement): void;
|
|
8555
9093
|
|
|
9094
|
+
/**
|
|
9095
|
+
* An optional callback to allow customize resize handle element of image resizing.
|
|
9096
|
+
* To customize the resize handle element, add this callback and change the attributes of elementData then it
|
|
9097
|
+
* will be picked up by ImageEdit code
|
|
9098
|
+
*/
|
|
9099
|
+
export interface OnShowResizeHandle {
|
|
9100
|
+
(elementData: CreateElementData, x: DNDDirectionX, y: DnDDirectionY): void;
|
|
9101
|
+
}
|
|
9102
|
+
|
|
9103
|
+
/**
|
|
9104
|
+
* Horizontal direction types for image edit
|
|
9105
|
+
*/
|
|
9106
|
+
export type DNDDirectionX = 'w' | '' | 'e';
|
|
9107
|
+
|
|
9108
|
+
/**
|
|
9109
|
+
* Vertical direction types for image edit
|
|
9110
|
+
*/
|
|
9111
|
+
export type DnDDirectionY = 'n' | '' | 's';
|
|
9112
|
+
|
|
8556
9113
|
/**
|
|
8557
9114
|
* @deprecated Use ImageEdit plugin instead
|
|
8558
9115
|
*/
|
|
@@ -8833,3 +9390,29 @@ export class TableCellSelection implements EditorPlugin {
|
|
|
8833
9390
|
selectTable(): void;
|
|
8834
9391
|
}
|
|
8835
9392
|
|
|
9393
|
+
/**
|
|
9394
|
+
* Automatically transform -- into hyphen, if typed between two words.
|
|
9395
|
+
*/
|
|
9396
|
+
export class AutoFormat implements EditorPlugin {
|
|
9397
|
+
private editor;
|
|
9398
|
+
private lastKeyTyped;
|
|
9399
|
+
/**
|
|
9400
|
+
* Get a friendly name of this plugin
|
|
9401
|
+
*/
|
|
9402
|
+
getName(): string;
|
|
9403
|
+
/**
|
|
9404
|
+
* Initialize this plugin
|
|
9405
|
+
* @param editor The editor instance
|
|
9406
|
+
*/
|
|
9407
|
+
initialize(editor: IEditor): void;
|
|
9408
|
+
/**
|
|
9409
|
+
* Dispose this plugin
|
|
9410
|
+
*/
|
|
9411
|
+
dispose(): void;
|
|
9412
|
+
/**
|
|
9413
|
+
* Handle events triggered from editor
|
|
9414
|
+
* @param event PluginEvent object
|
|
9415
|
+
*/
|
|
9416
|
+
onPluginEvent(event: PluginEvent): void;
|
|
9417
|
+
}
|
|
9418
|
+
|