tinymce.d.ts 109 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546154715481549155015511552155315541555155615571558155915601561156215631564156515661567156815691570157115721573157415751576157715781579158015811582158315841585158615871588158915901591159215931594159515961597159815991600160116021603160416051606160716081609161016111612161316141615161616171618161916201621162216231624162516261627162816291630163116321633163416351636163716381639164016411642164316441645164616471648164916501651165216531654165516561657165816591660166116621663166416651666166716681669167016711672167316741675167616771678167916801681168216831684168516861687168816891690169116921693169416951696169716981699170017011702170317041705170617071708170917101711171217131714171517161717171817191720172117221723172417251726172717281729173017311732173317341735173617371738173917401741174217431744174517461747174817491750175117521753175417551756175717581759176017611762176317641765176617671768176917701771177217731774177517761777177817791780178117821783178417851786178717881789179017911792179317941795179617971798179918001801180218031804180518061807180818091810181118121813181418151816181718181819182018211822182318241825182618271828182918301831183218331834183518361837183818391840184118421843184418451846184718481849185018511852185318541855185618571858185918601861186218631864186518661867186818691870187118721873187418751876187718781879188018811882188318841885188618871888188918901891189218931894189518961897189818991900190119021903190419051906190719081909191019111912191319141915191619171918191919201921192219231924192519261927192819291930193119321933193419351936193719381939194019411942194319441945194619471948194919501951195219531954195519561957195819591960196119621963196419651966196719681969197019711972197319741975197619771978197919801981198219831984198519861987198819891990199119921993199419951996199719981999200020012002200320042005200620072008200920102011201220132014201520162017201820192020202120222023202420252026202720282029203020312032203320342035203620372038203920402041204220432044204520462047204820492050205120522053205420552056205720582059206020612062206320642065206620672068206920702071207220732074207520762077207820792080208120822083208420852086208720882089209020912092209320942095209620972098209921002101210221032104210521062107210821092110211121122113211421152116211721182119212021212122212321242125212621272128212921302131213221332134213521362137213821392140214121422143214421452146214721482149215021512152215321542155215621572158215921602161216221632164216521662167216821692170217121722173217421752176217721782179218021812182218321842185218621872188218921902191219221932194219521962197219821992200220122022203220422052206220722082209221022112212221322142215221622172218221922202221222222232224222522262227222822292230223122322233223422352236223722382239224022412242224322442245224622472248224922502251225222532254225522562257225822592260226122622263226422652266226722682269227022712272227322742275227622772278227922802281228222832284228522862287228822892290229122922293229422952296229722982299230023012302230323042305230623072308230923102311231223132314231523162317231823192320232123222323232423252326232723282329233023312332233323342335233623372338233923402341234223432344234523462347234823492350235123522353235423552356235723582359236023612362236323642365236623672368236923702371237223732374237523762377237823792380238123822383238423852386238723882389239023912392239323942395239623972398239924002401240224032404240524062407240824092410241124122413241424152416241724182419242024212422242324242425242624272428242924302431243224332434243524362437243824392440244124422443244424452446244724482449245024512452245324542455245624572458245924602461246224632464246524662467246824692470247124722473247424752476247724782479248024812482248324842485248624872488248924902491249224932494249524962497249824992500250125022503250425052506250725082509251025112512251325142515251625172518251925202521252225232524252525262527252825292530253125322533253425352536253725382539254025412542254325442545254625472548254925502551255225532554255525562557255825592560256125622563256425652566256725682569257025712572257325742575257625772578257925802581258225832584258525862587258825892590259125922593259425952596259725982599260026012602260326042605260626072608260926102611261226132614261526162617261826192620262126222623262426252626262726282629263026312632263326342635263626372638263926402641264226432644264526462647264826492650265126522653265426552656265726582659266026612662266326642665266626672668266926702671267226732674267526762677267826792680268126822683268426852686268726882689269026912692269326942695269626972698269927002701270227032704270527062707270827092710271127122713271427152716271727182719272027212722272327242725272627272728272927302731273227332734273527362737273827392740274127422743274427452746274727482749275027512752275327542755275627572758275927602761276227632764276527662767276827692770277127722773277427752776277727782779278027812782278327842785278627872788278927902791279227932794279527962797279827992800280128022803280428052806280728082809281028112812281328142815281628172818281928202821282228232824282528262827282828292830283128322833283428352836283728382839284028412842284328442845284628472848284928502851285228532854285528562857285828592860286128622863286428652866286728682869287028712872287328742875287628772878
  1. interface StringPathBookmark {
  2. start: string;
  3. end?: string;
  4. }
  5. interface RangeBookmark {
  6. rng: Range;
  7. }
  8. interface IdBookmark {
  9. id: string;
  10. keep?: boolean;
  11. }
  12. interface IndexBookmark {
  13. name: string;
  14. index: number;
  15. }
  16. interface PathBookmark {
  17. start: number[];
  18. end?: number[];
  19. isFakeCaret?: boolean;
  20. }
  21. declare type Bookmark = StringPathBookmark | RangeBookmark | IdBookmark | IndexBookmark | PathBookmark;
  22. declare type NormalizedEvent<E, T = any> = E & {
  23. readonly type: string;
  24. readonly target: T;
  25. readonly isDefaultPrevented: () => boolean;
  26. readonly preventDefault: () => void;
  27. readonly isPropagationStopped: () => boolean;
  28. readonly stopPropagation: () => void;
  29. readonly isImmediatePropagationStopped: () => boolean;
  30. readonly stopImmediatePropagation: () => void;
  31. };
  32. declare type MappedEvent<T, K extends string> = K extends keyof T ? T[K] : any;
  33. interface NativeEventMap {
  34. 'beforepaste': Event;
  35. 'blur': FocusEvent;
  36. 'beforeinput': InputEvent;
  37. 'click': MouseEvent;
  38. 'compositionend': Event;
  39. 'compositionstart': Event;
  40. 'compositionupdate': Event;
  41. 'contextmenu': PointerEvent;
  42. 'copy': ClipboardEvent;
  43. 'cut': ClipboardEvent;
  44. 'dblclick': MouseEvent;
  45. 'drag': DragEvent;
  46. 'dragdrop': DragEvent;
  47. 'dragend': DragEvent;
  48. 'draggesture': DragEvent;
  49. 'dragover': DragEvent;
  50. 'dragstart': DragEvent;
  51. 'drop': DragEvent;
  52. 'focus': FocusEvent;
  53. 'focusin': FocusEvent;
  54. 'focusout': FocusEvent;
  55. 'input': InputEvent;
  56. 'keydown': KeyboardEvent;
  57. 'keypress': KeyboardEvent;
  58. 'keyup': KeyboardEvent;
  59. 'mousedown': MouseEvent;
  60. 'mouseenter': MouseEvent;
  61. 'mouseleave': MouseEvent;
  62. 'mousemove': MouseEvent;
  63. 'mouseout': MouseEvent;
  64. 'mouseover': MouseEvent;
  65. 'mouseup': MouseEvent;
  66. 'paste': ClipboardEvent;
  67. 'selectionchange': Event;
  68. 'submit': Event;
  69. 'touchend': TouchEvent;
  70. 'touchmove': TouchEvent;
  71. 'touchstart': TouchEvent;
  72. 'touchcancel': TouchEvent;
  73. 'wheel': WheelEvent;
  74. }
  75. declare type EditorEvent<T> = NormalizedEvent<T>;
  76. interface EventDispatcherSettings {
  77. scope?: any;
  78. toggleEvent?: (name: string, state: boolean) => void | boolean;
  79. beforeFire?: <T>(args: EditorEvent<T>) => void;
  80. }
  81. interface EventDispatcherConstructor<T extends NativeEventMap> {
  82. readonly prototype: EventDispatcher<T>;
  83. new (settings?: EventDispatcherSettings): EventDispatcher<T>;
  84. isNative: (name: string) => boolean;
  85. }
  86. declare class EventDispatcher<T> {
  87. static isNative(name: string): boolean;
  88. private readonly settings;
  89. private readonly scope;
  90. private readonly toggleEvent;
  91. private bindings;
  92. constructor(settings?: Record<string, any>);
  93. fire<K extends string, U extends MappedEvent<T, K>>(name: K, args?: U): EditorEvent<U>;
  94. dispatch<K extends string, U extends MappedEvent<T, K>>(name: K, args?: U): EditorEvent<U>;
  95. on<K extends string>(name: K, callback: false | ((event: EditorEvent<MappedEvent<T, K>>) => void), prepend?: boolean, extra?: {}): this;
  96. off<K extends string>(name?: K, callback?: (event: EditorEvent<MappedEvent<T, K>>) => void): this;
  97. once<K extends string>(name: K, callback: (event: EditorEvent<MappedEvent<T, K>>) => void, prepend?: boolean): this;
  98. has(name: string): boolean;
  99. }
  100. declare const enum UndoLevelType {
  101. Fragmented = "fragmented",
  102. Complete = "complete"
  103. }
  104. interface UndoLevel {
  105. type: UndoLevelType;
  106. fragments: string[];
  107. content: string;
  108. bookmark: Bookmark;
  109. beforeBookmark: Bookmark;
  110. }
  111. interface UndoManager {
  112. data: UndoLevel[];
  113. typing: boolean;
  114. add: (level?: UndoLevel, event?: EditorEvent<any>) => UndoLevel;
  115. beforeChange: () => void;
  116. undo: () => UndoLevel;
  117. redo: () => UndoLevel;
  118. clear: () => void;
  119. reset: () => void;
  120. hasUndo: () => boolean;
  121. hasRedo: () => boolean;
  122. transact: (callback: () => void) => UndoLevel;
  123. ignore: (callback: () => void) => void;
  124. extra: (callback1: () => void, callback2: () => void) => void;
  125. }
  126. declare type SchemaType = 'html4' | 'html5' | 'html5-strict';
  127. interface SchemaSettings {
  128. custom_elements?: string;
  129. extended_valid_elements?: string;
  130. invalid_elements?: string;
  131. invalid_styles?: string | Record<string, string>;
  132. schema?: SchemaType;
  133. valid_children?: string;
  134. valid_classes?: string | Record<string, string>;
  135. valid_elements?: string;
  136. valid_styles?: string | Record<string, string>;
  137. verify_html?: boolean;
  138. padd_empty_block_inline_children?: boolean;
  139. }
  140. interface Attribute {
  141. required?: boolean;
  142. defaultValue?: string;
  143. forcedValue?: string;
  144. validValues?: Record<string, {}>;
  145. }
  146. interface DefaultAttribute {
  147. name: string;
  148. value: string;
  149. }
  150. interface AttributePattern {
  151. defaultValue?: string;
  152. forcedValue?: string;
  153. pattern: RegExp;
  154. required?: boolean;
  155. validValues?: Record<string, {}>;
  156. }
  157. interface ElementRule {
  158. attributes: Record<string, Attribute>;
  159. attributesDefault?: DefaultAttribute[];
  160. attributesForced?: DefaultAttribute[];
  161. attributesOrder: string[];
  162. attributePatterns?: AttributePattern[];
  163. attributesRequired?: string[];
  164. paddEmpty?: boolean;
  165. removeEmpty?: boolean;
  166. removeEmptyAttrs?: boolean;
  167. paddInEmptyBlock?: boolean;
  168. }
  169. interface SchemaElement extends ElementRule {
  170. outputName?: string;
  171. parentsRequired?: string[];
  172. pattern?: RegExp;
  173. }
  174. interface SchemaMap {
  175. [name: string]: {};
  176. }
  177. interface SchemaRegExpMap {
  178. [name: string]: RegExp;
  179. }
  180. interface Schema {
  181. type: SchemaType;
  182. children: Record<string, SchemaMap>;
  183. elements: Record<string, SchemaElement>;
  184. getValidStyles: () => Record<string, string[]> | undefined;
  185. getValidClasses: () => Record<string, SchemaMap> | undefined;
  186. getBlockElements: () => SchemaMap;
  187. getInvalidStyles: () => Record<string, SchemaMap> | undefined;
  188. getVoidElements: () => SchemaMap;
  189. getTextBlockElements: () => SchemaMap;
  190. getTextInlineElements: () => SchemaMap;
  191. getBoolAttrs: () => SchemaMap;
  192. getElementRule: (name: string) => SchemaElement | undefined;
  193. getSelfClosingElements: () => SchemaMap;
  194. getNonEmptyElements: () => SchemaMap;
  195. getMoveCaretBeforeOnEnterElements: () => SchemaMap;
  196. getWhitespaceElements: () => SchemaMap;
  197. getSpecialElements: () => SchemaRegExpMap;
  198. isValidChild: (name: string, child: string) => boolean;
  199. isValid: (name: string, attr?: string) => boolean;
  200. getCustomElements: () => SchemaMap;
  201. addValidElements: (validElements: string) => void;
  202. setValidElements: (validElements: string) => void;
  203. addCustomElements: (customElements: string) => void;
  204. addValidChildren: (validChildren: any) => void;
  205. }
  206. declare type Attributes$1 = Array<{
  207. name: string;
  208. value: string;
  209. }> & {
  210. map: Record<string, string>;
  211. };
  212. interface AstNodeConstructor {
  213. readonly prototype: AstNode;
  214. new (name: string, type: number): AstNode;
  215. create(name: string, attrs?: Record<string, string>): AstNode;
  216. }
  217. declare class AstNode {
  218. static create(name: string, attrs?: Record<string, string>): AstNode;
  219. name: string;
  220. type: number;
  221. attributes?: Attributes$1;
  222. value?: string;
  223. parent?: AstNode;
  224. firstChild?: AstNode;
  225. lastChild?: AstNode;
  226. next?: AstNode;
  227. prev?: AstNode;
  228. raw?: boolean;
  229. constructor(name: string, type: number);
  230. replace(node: AstNode): AstNode;
  231. attr(name: string, value: string | null): AstNode | undefined;
  232. attr(name: Record<string, string | null>): AstNode | undefined;
  233. attr(name: string): string | undefined;
  234. clone(): AstNode;
  235. wrap(wrapper: AstNode): AstNode;
  236. unwrap(): void;
  237. remove(): AstNode;
  238. append(node: AstNode): AstNode;
  239. insert(node: AstNode, refNode: AstNode, before?: boolean): AstNode;
  240. getAll(name: string): AstNode[];
  241. children(): AstNode[];
  242. empty(): AstNode;
  243. isEmpty(elements: SchemaMap, whitespace?: SchemaMap, predicate?: (node: AstNode) => boolean): boolean;
  244. walk(prev?: boolean): AstNode;
  245. }
  246. declare type Content = string | AstNode;
  247. declare type ContentFormat = 'raw' | 'text' | 'html' | 'tree';
  248. interface GetContentArgs {
  249. format: ContentFormat;
  250. get: boolean;
  251. getInner: boolean;
  252. no_events?: boolean;
  253. save?: boolean;
  254. source_view?: boolean;
  255. [key: string]: any;
  256. }
  257. interface SetContentArgs {
  258. format: string;
  259. set: boolean;
  260. content: Content;
  261. no_events?: boolean;
  262. no_selection?: boolean;
  263. paste?: boolean;
  264. }
  265. interface GetSelectionContentArgs extends GetContentArgs {
  266. selection?: boolean;
  267. contextual?: boolean;
  268. }
  269. interface SetSelectionContentArgs extends SetContentArgs {
  270. content: string;
  271. selection?: boolean;
  272. }
  273. interface BlobInfoData {
  274. id?: string;
  275. name?: string;
  276. filename?: string;
  277. blob: Blob;
  278. base64: string;
  279. blobUri?: string;
  280. uri?: string;
  281. }
  282. interface BlobInfo {
  283. id: () => string;
  284. name: () => string;
  285. filename: () => string;
  286. blob: () => Blob;
  287. base64: () => string;
  288. blobUri: () => string;
  289. uri: () => string | undefined;
  290. }
  291. interface BlobCache {
  292. create: (o: string | BlobInfoData, blob?: Blob, base64?: string, name?: string, filename?: string) => BlobInfo;
  293. add: (blobInfo: BlobInfo) => void;
  294. get: (id: string) => BlobInfo | undefined;
  295. getByUri: (blobUri: string) => BlobInfo | undefined;
  296. getByData: (base64: string, type: string) => BlobInfo | undefined;
  297. findFirst: (predicate: (blobInfo: BlobInfo) => boolean) => BlobInfo | undefined;
  298. removeByUri: (blobUri: string) => void;
  299. destroy: () => void;
  300. }
  301. interface BlobInfoImagePair {
  302. image: HTMLImageElement;
  303. blobInfo: BlobInfo;
  304. }
  305. declare class NodeChange {
  306. private readonly editor;
  307. private lastPath;
  308. constructor(editor: Editor);
  309. nodeChanged(args?: any): void;
  310. private isSameElementPath;
  311. }
  312. interface SelectionOverrides {
  313. showCaret: (direction: number, node: Element, before: boolean, scrollIntoView?: boolean) => Range | null;
  314. showBlockCaretContainer: (blockCaretContainer: Element) => void;
  315. hideFakeCaret: () => void;
  316. destroy: () => void;
  317. }
  318. interface Quirks {
  319. refreshContentEditable(): void;
  320. isHidden(): boolean;
  321. }
  322. declare type DecoratorData = Record<string, any>;
  323. declare type Decorator = (uid: string, data: DecoratorData) => {
  324. attributes?: {};
  325. classes?: string[];
  326. };
  327. declare type AnnotationListener = (state: boolean, name: string, data?: {
  328. uid: string;
  329. nodes: any[];
  330. }) => void;
  331. declare type AnnotationListenerApi = AnnotationListener;
  332. interface AnnotatorSettings {
  333. decorate: Decorator;
  334. persistent?: boolean;
  335. }
  336. interface Annotator {
  337. register: (name: string, settings: AnnotatorSettings) => void;
  338. annotate: (name: string, data: DecoratorData) => void;
  339. annotationChanged: (name: string, f: AnnotationListenerApi) => void;
  340. remove: (name: string) => void;
  341. removeAll: (name: string) => void;
  342. getAll: (name: string) => Record<string, Element[]>;
  343. }
  344. interface GeomRect {
  345. readonly x: number;
  346. readonly y: number;
  347. readonly w: number;
  348. readonly h: number;
  349. }
  350. interface Rect {
  351. inflate: (rect: GeomRect, w: number, h: number) => GeomRect;
  352. relativePosition: (rect: GeomRect, targetRect: GeomRect, rel: string) => GeomRect;
  353. findBestRelativePosition: (rect: GeomRect, targetRect: GeomRect, constrainRect: GeomRect, rels: string[]) => string | null;
  354. intersect: (rect: GeomRect, cropRect: GeomRect) => GeomRect | null;
  355. clamp: (rect: GeomRect, clampRect: GeomRect, fixedSize?: boolean) => GeomRect;
  356. create: (x: number, y: number, w: number, h: number) => GeomRect;
  357. fromClientRect: (clientRect: DOMRect) => GeomRect;
  358. }
  359. interface NotificationManagerImpl {
  360. open: (spec: NotificationSpec, closeCallback?: () => void) => NotificationApi;
  361. close: <T extends NotificationApi>(notification: T) => void;
  362. getArgs: <T extends NotificationApi>(notification: T) => NotificationSpec;
  363. }
  364. interface NotificationSpec {
  365. type?: 'info' | 'warning' | 'error' | 'success';
  366. text: string;
  367. icon?: string;
  368. progressBar?: boolean;
  369. timeout?: number;
  370. closeButton?: boolean;
  371. }
  372. interface NotificationApi {
  373. close: () => void;
  374. progressBar: {
  375. value: (percent: number) => void;
  376. };
  377. text: (text: string) => void;
  378. reposition: () => void;
  379. getEl: () => HTMLElement;
  380. settings: NotificationSpec;
  381. }
  382. interface NotificationManager {
  383. open: (spec: NotificationSpec) => NotificationApi;
  384. close: () => void;
  385. getNotifications: () => NotificationApi[];
  386. }
  387. interface UploadFailure {
  388. message: string;
  389. remove?: boolean;
  390. }
  391. declare type ProgressFn = (percent: number) => void;
  392. declare type UploadHandler = (blobInfo: BlobInfo, progress: ProgressFn) => Promise<string>;
  393. interface UploadResult$2 {
  394. url: string;
  395. blobInfo: BlobInfo;
  396. status: boolean;
  397. error?: UploadFailure;
  398. }
  399. interface RawPattern {
  400. start?: any;
  401. end?: any;
  402. format?: any;
  403. cmd?: any;
  404. value?: any;
  405. replacement?: any;
  406. }
  407. interface InlineBasePattern {
  408. readonly start: string;
  409. readonly end: string;
  410. }
  411. interface InlineFormatPattern extends InlineBasePattern {
  412. readonly type: 'inline-format';
  413. readonly format: string[];
  414. }
  415. interface InlineCmdPattern extends InlineBasePattern {
  416. readonly type: 'inline-command';
  417. readonly cmd: string;
  418. readonly value?: any;
  419. }
  420. declare type InlinePattern = InlineFormatPattern | InlineCmdPattern;
  421. interface BlockBasePattern {
  422. readonly start: string;
  423. }
  424. interface BlockFormatPattern extends BlockBasePattern {
  425. readonly type: 'block-format';
  426. readonly format: string;
  427. }
  428. interface BlockCmdPattern extends BlockBasePattern {
  429. readonly type: 'block-command';
  430. readonly cmd: string;
  431. readonly value?: any;
  432. }
  433. declare type BlockPattern = BlockFormatPattern | BlockCmdPattern;
  434. declare type Pattern = InlinePattern | BlockPattern;
  435. interface AlertBannerSpec {
  436. type: 'alertbanner';
  437. level: 'info' | 'warn' | 'error' | 'success';
  438. text: string;
  439. icon: string;
  440. url?: string;
  441. }
  442. interface ButtonSpec {
  443. type: 'button';
  444. text: string;
  445. enabled?: boolean;
  446. primary?: boolean;
  447. name?: string;
  448. icon?: string;
  449. borderless?: boolean;
  450. buttonType?: 'primary' | 'secondary' | 'toolbar';
  451. }
  452. interface FormComponentSpec {
  453. type: string;
  454. name: string;
  455. }
  456. interface FormComponentWithLabelSpec extends FormComponentSpec {
  457. label?: string;
  458. }
  459. interface CheckboxSpec extends FormComponentSpec {
  460. type: 'checkbox';
  461. label: string;
  462. enabled?: boolean;
  463. }
  464. interface CollectionSpec extends FormComponentWithLabelSpec {
  465. type: 'collection';
  466. }
  467. interface CollectionItem {
  468. value: string;
  469. text: string;
  470. icon: string;
  471. }
  472. interface ColorInputSpec extends FormComponentWithLabelSpec {
  473. type: 'colorinput';
  474. }
  475. interface ColorPickerSpec extends FormComponentWithLabelSpec {
  476. type: 'colorpicker';
  477. }
  478. interface CustomEditorInit {
  479. setValue: (value: string) => void;
  480. getValue: () => string;
  481. destroy: () => void;
  482. }
  483. declare type CustomEditorInitFn = (elm: HTMLElement, settings: any) => Promise<CustomEditorInit>;
  484. interface CustomEditorOldSpec extends FormComponentSpec {
  485. type: 'customeditor';
  486. tag?: string;
  487. init: (e: HTMLElement) => Promise<CustomEditorInit>;
  488. }
  489. interface CustomEditorNewSpec extends FormComponentSpec {
  490. type: 'customeditor';
  491. tag?: string;
  492. scriptId: string;
  493. scriptUrl: string;
  494. settings?: any;
  495. }
  496. declare type CustomEditorSpec = CustomEditorOldSpec | CustomEditorNewSpec;
  497. interface DropZoneSpec extends FormComponentWithLabelSpec {
  498. type: 'dropzone';
  499. }
  500. interface GridSpec {
  501. type: 'grid';
  502. columns: number;
  503. items: BodyComponentSpec[];
  504. }
  505. interface HtmlPanelSpec {
  506. type: 'htmlpanel';
  507. html: string;
  508. presets?: 'presentation' | 'document';
  509. }
  510. interface IframeSpec extends FormComponentWithLabelSpec {
  511. type: 'iframe';
  512. sandboxed?: boolean;
  513. }
  514. interface ImagePreviewSpec extends FormComponentSpec {
  515. type: 'imagepreview';
  516. height?: string;
  517. }
  518. interface InputSpec extends FormComponentWithLabelSpec {
  519. type: 'input';
  520. inputMode?: string;
  521. placeholder?: string;
  522. maximized?: boolean;
  523. enabled?: boolean;
  524. }
  525. interface LabelSpec {
  526. type: 'label';
  527. label: string;
  528. items: BodyComponentSpec[];
  529. }
  530. interface ListBoxSingleItemSpec {
  531. text: string;
  532. value: string;
  533. }
  534. interface ListBoxNestedItemSpec {
  535. text: string;
  536. items: ListBoxItemSpec[];
  537. }
  538. declare type ListBoxItemSpec = ListBoxNestedItemSpec | ListBoxSingleItemSpec;
  539. interface ListBoxSpec extends FormComponentWithLabelSpec {
  540. type: 'listbox';
  541. items: ListBoxItemSpec[];
  542. disabled?: boolean;
  543. }
  544. interface PanelSpec {
  545. type: 'panel';
  546. classes?: string[];
  547. items: BodyComponentSpec[];
  548. }
  549. interface SelectBoxItemSpec {
  550. text: string;
  551. value: string;
  552. }
  553. interface SelectBoxSpec extends FormComponentWithLabelSpec {
  554. type: 'selectbox';
  555. items: SelectBoxItemSpec[];
  556. size?: number;
  557. enabled?: boolean;
  558. }
  559. interface SizeInputSpec extends FormComponentWithLabelSpec {
  560. type: 'sizeinput';
  561. constrain?: boolean;
  562. enabled?: boolean;
  563. }
  564. interface SliderSpec extends FormComponentSpec {
  565. type: 'slider';
  566. label: string;
  567. min?: number;
  568. max?: number;
  569. }
  570. interface TableSpec {
  571. type: 'table';
  572. header: string[];
  573. cells: string[][];
  574. }
  575. interface TextAreaSpec extends FormComponentWithLabelSpec {
  576. type: 'textarea';
  577. placeholder?: string;
  578. maximized?: boolean;
  579. enabled?: boolean;
  580. }
  581. interface UrlInputSpec extends FormComponentWithLabelSpec {
  582. type: 'urlinput';
  583. filetype?: 'image' | 'media' | 'file';
  584. enabled?: boolean;
  585. }
  586. interface UrlInputData {
  587. value: string;
  588. meta: {
  589. text?: string;
  590. };
  591. }
  592. declare type BodyComponentSpec = BarSpec | ButtonSpec | CheckboxSpec | TextAreaSpec | InputSpec | ListBoxSpec | SelectBoxSpec | SizeInputSpec | SliderSpec | IframeSpec | HtmlPanelSpec | UrlInputSpec | DropZoneSpec | ColorInputSpec | GridSpec | ColorPickerSpec | ImagePreviewSpec | AlertBannerSpec | CollectionSpec | LabelSpec | TableSpec | PanelSpec | CustomEditorSpec;
  593. interface BarSpec {
  594. type: 'bar';
  595. items: BodyComponentSpec[];
  596. }
  597. interface CommonMenuItemSpec {
  598. enabled?: boolean;
  599. text?: string;
  600. value?: string;
  601. meta?: Record<string, any>;
  602. shortcut?: string;
  603. }
  604. interface CommonMenuItemInstanceApi {
  605. isEnabled: () => boolean;
  606. setEnabled: (state: boolean) => void;
  607. }
  608. interface DialogToggleMenuItemSpec extends CommonMenuItemSpec {
  609. type?: 'togglemenuitem';
  610. name: string;
  611. }
  612. declare type DialogFooterMenuButtonItemSpec = DialogToggleMenuItemSpec;
  613. interface BaseDialogFooterButtonSpec {
  614. name?: string;
  615. align?: 'start' | 'end';
  616. primary?: boolean;
  617. enabled?: boolean;
  618. icon?: string;
  619. buttonType?: 'primary' | 'secondary';
  620. }
  621. interface DialogFooterNormalButtonSpec extends BaseDialogFooterButtonSpec {
  622. type: 'submit' | 'cancel' | 'custom';
  623. text: string;
  624. }
  625. interface DialogFooterMenuButtonSpec extends BaseDialogFooterButtonSpec {
  626. type: 'menu';
  627. text?: string;
  628. tooltip?: string;
  629. icon?: string;
  630. items: DialogFooterMenuButtonItemSpec[];
  631. }
  632. declare type DialogFooterButtonSpec = DialogFooterNormalButtonSpec | DialogFooterMenuButtonSpec;
  633. interface TabSpec {
  634. name?: string;
  635. title: string;
  636. items: BodyComponentSpec[];
  637. }
  638. interface TabPanelSpec {
  639. type: 'tabpanel';
  640. tabs: TabSpec[];
  641. }
  642. declare type DialogDataItem = any;
  643. declare type DialogData = Record<string, DialogDataItem>;
  644. interface DialogInstanceApi<T extends DialogData> {
  645. getData: () => T;
  646. setData: (data: Partial<T>) => void;
  647. setEnabled: (name: string, state: boolean) => void;
  648. focus: (name: string) => void;
  649. showTab: (name: string) => void;
  650. redial: (nu: DialogSpec<T>) => void;
  651. block: (msg: string) => void;
  652. unblock: () => void;
  653. close: () => void;
  654. }
  655. interface DialogActionDetails {
  656. name: string;
  657. value?: any;
  658. }
  659. interface DialogChangeDetails<T> {
  660. name: keyof T;
  661. }
  662. interface DialogTabChangeDetails {
  663. newTabName: string;
  664. oldTabName: string;
  665. }
  666. declare type DialogActionHandler<T> = (api: DialogInstanceApi<T>, details: DialogActionDetails) => void;
  667. declare type DialogChangeHandler<T> = (api: DialogInstanceApi<T>, details: DialogChangeDetails<T>) => void;
  668. declare type DialogSubmitHandler<T> = (api: DialogInstanceApi<T>) => void;
  669. declare type DialogCloseHandler = () => void;
  670. declare type DialogCancelHandler<T> = (api: DialogInstanceApi<T>) => void;
  671. declare type DialogTabChangeHandler<T> = (api: DialogInstanceApi<T>, details: DialogTabChangeDetails) => void;
  672. declare type DialogSize = 'normal' | 'medium' | 'large';
  673. interface DialogSpec<T extends DialogData> {
  674. title: string;
  675. size?: DialogSize;
  676. body: TabPanelSpec | PanelSpec;
  677. buttons: DialogFooterButtonSpec[];
  678. initialData?: Partial<T>;
  679. onAction?: DialogActionHandler<T>;
  680. onChange?: DialogChangeHandler<T>;
  681. onSubmit?: DialogSubmitHandler<T>;
  682. onClose?: DialogCloseHandler;
  683. onCancel?: DialogCancelHandler<T>;
  684. onTabChange?: DialogTabChangeHandler<T>;
  685. }
  686. interface UrlDialogInstanceApi {
  687. block: (msg: string) => void;
  688. unblock: () => void;
  689. close: () => void;
  690. sendMessage: (msg: any) => void;
  691. }
  692. interface UrlDialogActionDetails {
  693. name: string;
  694. value?: any;
  695. }
  696. interface UrlDialogMessage {
  697. mceAction: string;
  698. [key: string]: any;
  699. }
  700. declare type UrlDialogActionHandler = (api: UrlDialogInstanceApi, actions: UrlDialogActionDetails) => void;
  701. declare type UrlDialogCloseHandler = () => void;
  702. declare type UrlDialogCancelHandler = (api: UrlDialogInstanceApi) => void;
  703. declare type UrlDialogMessageHandler = (api: UrlDialogInstanceApi, message: UrlDialogMessage) => void;
  704. interface UrlDialogFooterButtonSpec extends DialogFooterNormalButtonSpec {
  705. type: 'cancel' | 'custom';
  706. }
  707. interface UrlDialogSpec {
  708. title: string;
  709. url: string;
  710. height?: number;
  711. width?: number;
  712. buttons?: UrlDialogFooterButtonSpec[];
  713. onAction?: UrlDialogActionHandler;
  714. onClose?: UrlDialogCloseHandler;
  715. onCancel?: UrlDialogCancelHandler;
  716. onMessage?: UrlDialogMessageHandler;
  717. }
  718. declare type CardContainerDirection = 'vertical' | 'horizontal';
  719. declare type CardContainerAlign = 'left' | 'right';
  720. declare type CardContainerValign = 'top' | 'middle' | 'bottom';
  721. interface CardContainerSpec {
  722. type: 'cardcontainer';
  723. items: CardItemSpec[];
  724. direction?: CardContainerDirection;
  725. align?: CardContainerAlign;
  726. valign?: CardContainerValign;
  727. }
  728. interface CardImageSpec {
  729. type: 'cardimage';
  730. src: string;
  731. alt?: string;
  732. classes?: string[];
  733. }
  734. interface CardTextSpec {
  735. type: 'cardtext';
  736. text: string;
  737. name?: string;
  738. classes?: string[];
  739. }
  740. declare type CardItemSpec = CardContainerSpec | CardImageSpec | CardTextSpec;
  741. interface CardMenuItemInstanceApi extends CommonMenuItemInstanceApi {
  742. }
  743. interface CardMenuItemSpec extends Omit<CommonMenuItemSpec, 'text' | 'shortcut'> {
  744. type: 'cardmenuitem';
  745. label?: string;
  746. items: CardItemSpec[];
  747. onSetup?: (api: CardMenuItemInstanceApi) => (api: CardMenuItemInstanceApi) => void;
  748. onAction?: (api: CardMenuItemInstanceApi) => void;
  749. }
  750. interface SeparatorMenuItemSpec {
  751. type?: 'separator';
  752. text?: string;
  753. }
  754. declare type ColumnTypes$1 = number | 'auto';
  755. declare type SeparatorItemSpec = SeparatorMenuItemSpec;
  756. interface AutocompleterItemSpec {
  757. type?: 'autocompleteitem';
  758. value: string;
  759. text?: string;
  760. icon?: string;
  761. meta?: Record<string, any>;
  762. }
  763. declare type AutocompleterContents = SeparatorItemSpec | AutocompleterItemSpec | CardMenuItemSpec;
  764. interface AutocompleterSpec {
  765. type?: 'autocompleter';
  766. ch: string;
  767. minChars?: number;
  768. columns?: ColumnTypes$1;
  769. matches?: (rng: Range, text: string, pattern: string) => boolean;
  770. fetch: (pattern: string, maxResults: number, fetchOptions: Record<string, any>) => Promise<AutocompleterContents[]>;
  771. onAction: (autocompleterApi: AutocompleterInstanceApi, rng: Range, value: string, meta: Record<string, any>) => void;
  772. maxResults?: number;
  773. highlightOn?: string[];
  774. }
  775. interface AutocompleterInstanceApi {
  776. hide: () => void;
  777. reload: (fetchOptions: Record<string, any>) => void;
  778. }
  779. declare type ContextPosition = 'node' | 'selection' | 'line';
  780. declare type ContextScope = 'node' | 'editor';
  781. interface ContextBarSpec {
  782. predicate?: (elem: Element) => boolean;
  783. position?: ContextPosition;
  784. scope?: ContextScope;
  785. }
  786. interface BaseToolbarButtonSpec<I extends BaseToolbarButtonInstanceApi> {
  787. enabled?: boolean;
  788. tooltip?: string;
  789. icon?: string;
  790. text?: string;
  791. onSetup?: (api: I) => (api: I) => void;
  792. }
  793. interface BaseToolbarButtonInstanceApi {
  794. isEnabled: () => boolean;
  795. setEnabled: (state: boolean) => void;
  796. }
  797. interface ToolbarButtonSpec extends BaseToolbarButtonSpec<ToolbarButtonInstanceApi> {
  798. type?: 'button';
  799. onAction: (api: ToolbarButtonInstanceApi) => void;
  800. }
  801. interface ToolbarButtonInstanceApi extends BaseToolbarButtonInstanceApi {
  802. }
  803. interface BaseToolbarToggleButtonSpec<I extends BaseToolbarButtonInstanceApi> extends BaseToolbarButtonSpec<I> {
  804. active?: boolean;
  805. }
  806. interface BaseToolbarToggleButtonInstanceApi extends BaseToolbarButtonInstanceApi {
  807. isActive: () => boolean;
  808. setActive: (state: boolean) => void;
  809. }
  810. interface ToolbarToggleButtonSpec extends BaseToolbarToggleButtonSpec<ToolbarToggleButtonInstanceApi> {
  811. type?: 'togglebutton';
  812. onAction: (api: ToolbarToggleButtonInstanceApi) => void;
  813. }
  814. interface ToolbarToggleButtonInstanceApi extends BaseToolbarToggleButtonInstanceApi {
  815. }
  816. interface ContextFormLaunchButtonApi extends BaseToolbarButtonSpec<BaseToolbarButtonInstanceApi> {
  817. type: 'contextformbutton';
  818. }
  819. interface ContextFormLaunchToggleButtonSpec extends BaseToolbarToggleButtonSpec<BaseToolbarToggleButtonInstanceApi> {
  820. type: 'contextformtogglebutton';
  821. }
  822. interface ContextFormButtonInstanceApi extends BaseToolbarButtonInstanceApi {
  823. }
  824. interface ContextFormToggleButtonInstanceApi extends BaseToolbarToggleButtonInstanceApi {
  825. }
  826. interface ContextFormButtonSpec extends BaseToolbarButtonSpec<ContextFormButtonInstanceApi> {
  827. type?: 'contextformbutton';
  828. primary?: boolean;
  829. onAction: (formApi: ContextFormInstanceApi, api: ContextFormButtonInstanceApi) => void;
  830. }
  831. interface ContextFormToggleButtonSpec extends BaseToolbarToggleButtonSpec<ContextFormToggleButtonInstanceApi> {
  832. type?: 'contextformtogglebutton';
  833. onAction: (formApi: ContextFormInstanceApi, buttonApi: ContextFormToggleButtonInstanceApi) => void;
  834. primary?: boolean;
  835. }
  836. interface ContextFormInstanceApi {
  837. hide: () => void;
  838. getValue: () => string;
  839. }
  840. interface ContextFormSpec extends ContextBarSpec {
  841. type?: 'contextform';
  842. initValue?: () => string;
  843. label?: string;
  844. launch?: ContextFormLaunchButtonApi | ContextFormLaunchToggleButtonSpec;
  845. commands: Array<ContextFormToggleButtonSpec | ContextFormButtonSpec>;
  846. }
  847. interface ContextToolbarSpec extends ContextBarSpec {
  848. type?: 'contexttoolbar';
  849. items: string;
  850. }
  851. interface ChoiceMenuItemSpec extends CommonMenuItemSpec {
  852. type?: 'choiceitem';
  853. icon?: string;
  854. }
  855. interface ChoiceMenuItemInstanceApi extends CommonMenuItemInstanceApi {
  856. isActive: () => boolean;
  857. setActive: (state: boolean) => void;
  858. }
  859. interface ContextMenuItem extends CommonMenuItemSpec {
  860. text: string;
  861. icon?: string;
  862. type?: 'item';
  863. onAction: () => void;
  864. }
  865. interface ContextSubMenu extends CommonMenuItemSpec {
  866. type: 'submenu';
  867. text: string;
  868. icon?: string;
  869. getSubmenuItems: () => string | Array<ContextMenuContents>;
  870. }
  871. declare type ContextMenuContents = string | ContextMenuItem | SeparatorMenuItemSpec | ContextSubMenu;
  872. interface ContextMenuApi {
  873. update: (element: Element) => string | Array<ContextMenuContents>;
  874. }
  875. interface FancyActionArgsMap {
  876. 'inserttable': {
  877. numRows: number;
  878. numColumns: number;
  879. };
  880. 'colorswatch': {
  881. value: string;
  882. };
  883. }
  884. interface BaseFancyMenuItemSpec<T extends keyof FancyActionArgsMap> {
  885. type: 'fancymenuitem';
  886. fancytype: T;
  887. initData?: Record<string, unknown>;
  888. onAction?: (data: FancyActionArgsMap[T]) => void;
  889. }
  890. interface InsertTableMenuItemSpec extends BaseFancyMenuItemSpec<'inserttable'> {
  891. fancytype: 'inserttable';
  892. initData?: {};
  893. }
  894. interface ColorSwatchMenuItemSpec extends BaseFancyMenuItemSpec<'colorswatch'> {
  895. fancytype: 'colorswatch';
  896. initData?: {
  897. allowCustomColors?: boolean;
  898. colors: ChoiceMenuItemSpec[];
  899. };
  900. }
  901. declare type FancyMenuItemSpec = InsertTableMenuItemSpec | ColorSwatchMenuItemSpec;
  902. interface MenuItemSpec extends CommonMenuItemSpec {
  903. type?: 'menuitem';
  904. icon?: string;
  905. onSetup?: (api: MenuItemInstanceApi) => (api: MenuItemInstanceApi) => void;
  906. onAction?: (api: MenuItemInstanceApi) => void;
  907. }
  908. interface MenuItemInstanceApi extends CommonMenuItemInstanceApi {
  909. }
  910. declare type NestedMenuItemContents = string | MenuItemSpec | NestedMenuItemSpec | ToggleMenuItemSpec | SeparatorMenuItemSpec | FancyMenuItemSpec;
  911. interface NestedMenuItemSpec extends CommonMenuItemSpec {
  912. type?: 'nestedmenuitem';
  913. icon?: string;
  914. getSubmenuItems: () => string | Array<NestedMenuItemContents>;
  915. onSetup?: (api: NestedMenuItemInstanceApi) => (api: NestedMenuItemInstanceApi) => void;
  916. }
  917. interface NestedMenuItemInstanceApi extends CommonMenuItemInstanceApi {
  918. }
  919. interface ToggleMenuItemSpec extends CommonMenuItemSpec {
  920. type?: 'togglemenuitem';
  921. icon?: string;
  922. active?: boolean;
  923. onSetup?: (api: ToggleMenuItemInstanceApi) => void;
  924. onAction: (api: ToggleMenuItemInstanceApi) => void;
  925. }
  926. interface ToggleMenuItemInstanceApi extends CommonMenuItemInstanceApi {
  927. isActive: () => boolean;
  928. setActive: (state: boolean) => void;
  929. }
  930. type PublicDialog_d_AlertBannerSpec = AlertBannerSpec;
  931. type PublicDialog_d_BarSpec = BarSpec;
  932. type PublicDialog_d_BodyComponentSpec = BodyComponentSpec;
  933. type PublicDialog_d_ButtonSpec = ButtonSpec;
  934. type PublicDialog_d_CheckboxSpec = CheckboxSpec;
  935. type PublicDialog_d_CollectionItem = CollectionItem;
  936. type PublicDialog_d_CollectionSpec = CollectionSpec;
  937. type PublicDialog_d_ColorInputSpec = ColorInputSpec;
  938. type PublicDialog_d_ColorPickerSpec = ColorPickerSpec;
  939. type PublicDialog_d_CustomEditorSpec = CustomEditorSpec;
  940. type PublicDialog_d_CustomEditorInit = CustomEditorInit;
  941. type PublicDialog_d_CustomEditorInitFn = CustomEditorInitFn;
  942. type PublicDialog_d_DialogData = DialogData;
  943. type PublicDialog_d_DialogSize = DialogSize;
  944. type PublicDialog_d_DialogSpec<_0> = DialogSpec<_0>;
  945. type PublicDialog_d_DialogInstanceApi<_0> = DialogInstanceApi<_0>;
  946. type PublicDialog_d_DialogFooterButtonSpec = DialogFooterButtonSpec;
  947. type PublicDialog_d_DialogActionDetails = DialogActionDetails;
  948. type PublicDialog_d_DialogChangeDetails<_0> = DialogChangeDetails<_0>;
  949. type PublicDialog_d_DialogTabChangeDetails = DialogTabChangeDetails;
  950. type PublicDialog_d_DropZoneSpec = DropZoneSpec;
  951. type PublicDialog_d_GridSpec = GridSpec;
  952. type PublicDialog_d_HtmlPanelSpec = HtmlPanelSpec;
  953. type PublicDialog_d_IframeSpec = IframeSpec;
  954. type PublicDialog_d_ImagePreviewSpec = ImagePreviewSpec;
  955. type PublicDialog_d_InputSpec = InputSpec;
  956. type PublicDialog_d_LabelSpec = LabelSpec;
  957. type PublicDialog_d_ListBoxSpec = ListBoxSpec;
  958. type PublicDialog_d_ListBoxItemSpec = ListBoxItemSpec;
  959. type PublicDialog_d_ListBoxNestedItemSpec = ListBoxNestedItemSpec;
  960. type PublicDialog_d_ListBoxSingleItemSpec = ListBoxSingleItemSpec;
  961. type PublicDialog_d_PanelSpec = PanelSpec;
  962. type PublicDialog_d_SelectBoxSpec = SelectBoxSpec;
  963. type PublicDialog_d_SelectBoxItemSpec = SelectBoxItemSpec;
  964. type PublicDialog_d_SizeInputSpec = SizeInputSpec;
  965. type PublicDialog_d_SliderSpec = SliderSpec;
  966. type PublicDialog_d_TableSpec = TableSpec;
  967. type PublicDialog_d_TabSpec = TabSpec;
  968. type PublicDialog_d_TabPanelSpec = TabPanelSpec;
  969. type PublicDialog_d_TextAreaSpec = TextAreaSpec;
  970. type PublicDialog_d_UrlInputData = UrlInputData;
  971. type PublicDialog_d_UrlInputSpec = UrlInputSpec;
  972. type PublicDialog_d_UrlDialogSpec = UrlDialogSpec;
  973. type PublicDialog_d_UrlDialogFooterButtonSpec = UrlDialogFooterButtonSpec;
  974. type PublicDialog_d_UrlDialogInstanceApi = UrlDialogInstanceApi;
  975. type PublicDialog_d_UrlDialogActionDetails = UrlDialogActionDetails;
  976. type PublicDialog_d_UrlDialogMessage = UrlDialogMessage;
  977. declare namespace PublicDialog_d {
  978. export { PublicDialog_d_AlertBannerSpec as AlertBannerSpec, PublicDialog_d_BarSpec as BarSpec, PublicDialog_d_BodyComponentSpec as BodyComponentSpec, PublicDialog_d_ButtonSpec as ButtonSpec, PublicDialog_d_CheckboxSpec as CheckboxSpec, PublicDialog_d_CollectionItem as CollectionItem, PublicDialog_d_CollectionSpec as CollectionSpec, PublicDialog_d_ColorInputSpec as ColorInputSpec, PublicDialog_d_ColorPickerSpec as ColorPickerSpec, PublicDialog_d_CustomEditorSpec as CustomEditorSpec, PublicDialog_d_CustomEditorInit as CustomEditorInit, PublicDialog_d_CustomEditorInitFn as CustomEditorInitFn, PublicDialog_d_DialogData as DialogData, PublicDialog_d_DialogSize as DialogSize, PublicDialog_d_DialogSpec as DialogSpec, PublicDialog_d_DialogInstanceApi as DialogInstanceApi, PublicDialog_d_DialogFooterButtonSpec as DialogFooterButtonSpec, PublicDialog_d_DialogActionDetails as DialogActionDetails, PublicDialog_d_DialogChangeDetails as DialogChangeDetails, PublicDialog_d_DialogTabChangeDetails as DialogTabChangeDetails, PublicDialog_d_DropZoneSpec as DropZoneSpec, PublicDialog_d_GridSpec as GridSpec, PublicDialog_d_HtmlPanelSpec as HtmlPanelSpec, PublicDialog_d_IframeSpec as IframeSpec, PublicDialog_d_ImagePreviewSpec as ImagePreviewSpec, PublicDialog_d_InputSpec as InputSpec, PublicDialog_d_LabelSpec as LabelSpec, PublicDialog_d_ListBoxSpec as ListBoxSpec, PublicDialog_d_ListBoxItemSpec as ListBoxItemSpec, PublicDialog_d_ListBoxNestedItemSpec as ListBoxNestedItemSpec, PublicDialog_d_ListBoxSingleItemSpec as ListBoxSingleItemSpec, PublicDialog_d_PanelSpec as PanelSpec, PublicDialog_d_SelectBoxSpec as SelectBoxSpec, PublicDialog_d_SelectBoxItemSpec as SelectBoxItemSpec, PublicDialog_d_SizeInputSpec as SizeInputSpec, PublicDialog_d_SliderSpec as SliderSpec, PublicDialog_d_TableSpec as TableSpec, PublicDialog_d_TabSpec as TabSpec, PublicDialog_d_TabPanelSpec as TabPanelSpec, PublicDialog_d_TextAreaSpec as TextAreaSpec, PublicDialog_d_UrlInputData as UrlInputData, PublicDialog_d_UrlInputSpec as UrlInputSpec, PublicDialog_d_UrlDialogSpec as UrlDialogSpec, PublicDialog_d_UrlDialogFooterButtonSpec as UrlDialogFooterButtonSpec, PublicDialog_d_UrlDialogInstanceApi as UrlDialogInstanceApi, PublicDialog_d_UrlDialogActionDetails as UrlDialogActionDetails, PublicDialog_d_UrlDialogMessage as UrlDialogMessage, };
  979. }
  980. type PublicInlineContent_d_AutocompleterSpec = AutocompleterSpec;
  981. type PublicInlineContent_d_AutocompleterItemSpec = AutocompleterItemSpec;
  982. type PublicInlineContent_d_AutocompleterContents = AutocompleterContents;
  983. type PublicInlineContent_d_AutocompleterInstanceApi = AutocompleterInstanceApi;
  984. type PublicInlineContent_d_ContextPosition = ContextPosition;
  985. type PublicInlineContent_d_ContextScope = ContextScope;
  986. type PublicInlineContent_d_ContextFormSpec = ContextFormSpec;
  987. type PublicInlineContent_d_ContextFormInstanceApi = ContextFormInstanceApi;
  988. type PublicInlineContent_d_ContextFormButtonSpec = ContextFormButtonSpec;
  989. type PublicInlineContent_d_ContextFormButtonInstanceApi = ContextFormButtonInstanceApi;
  990. type PublicInlineContent_d_ContextFormToggleButtonSpec = ContextFormToggleButtonSpec;
  991. type PublicInlineContent_d_ContextFormToggleButtonInstanceApi = ContextFormToggleButtonInstanceApi;
  992. type PublicInlineContent_d_ContextToolbarSpec = ContextToolbarSpec;
  993. type PublicInlineContent_d_SeparatorItemSpec = SeparatorItemSpec;
  994. declare namespace PublicInlineContent_d {
  995. export { PublicInlineContent_d_AutocompleterSpec as AutocompleterSpec, PublicInlineContent_d_AutocompleterItemSpec as AutocompleterItemSpec, PublicInlineContent_d_AutocompleterContents as AutocompleterContents, PublicInlineContent_d_AutocompleterInstanceApi as AutocompleterInstanceApi, PublicInlineContent_d_ContextPosition as ContextPosition, PublicInlineContent_d_ContextScope as ContextScope, PublicInlineContent_d_ContextFormSpec as ContextFormSpec, PublicInlineContent_d_ContextFormInstanceApi as ContextFormInstanceApi, PublicInlineContent_d_ContextFormButtonSpec as ContextFormButtonSpec, PublicInlineContent_d_ContextFormButtonInstanceApi as ContextFormButtonInstanceApi, PublicInlineContent_d_ContextFormToggleButtonSpec as ContextFormToggleButtonSpec, PublicInlineContent_d_ContextFormToggleButtonInstanceApi as ContextFormToggleButtonInstanceApi, PublicInlineContent_d_ContextToolbarSpec as ContextToolbarSpec, PublicInlineContent_d_SeparatorItemSpec as SeparatorItemSpec, };
  996. }
  997. type PublicMenu_d_MenuItemSpec = MenuItemSpec;
  998. type PublicMenu_d_MenuItemInstanceApi = MenuItemInstanceApi;
  999. type PublicMenu_d_NestedMenuItemContents = NestedMenuItemContents;
  1000. type PublicMenu_d_NestedMenuItemSpec = NestedMenuItemSpec;
  1001. type PublicMenu_d_NestedMenuItemInstanceApi = NestedMenuItemInstanceApi;
  1002. type PublicMenu_d_FancyMenuItemSpec = FancyMenuItemSpec;
  1003. type PublicMenu_d_ColorSwatchMenuItemSpec = ColorSwatchMenuItemSpec;
  1004. type PublicMenu_d_InsertTableMenuItemSpec = InsertTableMenuItemSpec;
  1005. type PublicMenu_d_ToggleMenuItemSpec = ToggleMenuItemSpec;
  1006. type PublicMenu_d_ToggleMenuItemInstanceApi = ToggleMenuItemInstanceApi;
  1007. type PublicMenu_d_ChoiceMenuItemSpec = ChoiceMenuItemSpec;
  1008. type PublicMenu_d_ChoiceMenuItemInstanceApi = ChoiceMenuItemInstanceApi;
  1009. type PublicMenu_d_SeparatorMenuItemSpec = SeparatorMenuItemSpec;
  1010. type PublicMenu_d_ContextMenuApi = ContextMenuApi;
  1011. type PublicMenu_d_ContextMenuContents = ContextMenuContents;
  1012. type PublicMenu_d_ContextMenuItem = ContextMenuItem;
  1013. type PublicMenu_d_ContextSubMenu = ContextSubMenu;
  1014. type PublicMenu_d_CardMenuItemSpec = CardMenuItemSpec;
  1015. type PublicMenu_d_CardMenuItemInstanceApi = CardMenuItemInstanceApi;
  1016. type PublicMenu_d_CardItemSpec = CardItemSpec;
  1017. type PublicMenu_d_CardContainerSpec = CardContainerSpec;
  1018. type PublicMenu_d_CardImageSpec = CardImageSpec;
  1019. type PublicMenu_d_CardTextSpec = CardTextSpec;
  1020. declare namespace PublicMenu_d {
  1021. export { PublicMenu_d_MenuItemSpec as MenuItemSpec, PublicMenu_d_MenuItemInstanceApi as MenuItemInstanceApi, PublicMenu_d_NestedMenuItemContents as NestedMenuItemContents, PublicMenu_d_NestedMenuItemSpec as NestedMenuItemSpec, PublicMenu_d_NestedMenuItemInstanceApi as NestedMenuItemInstanceApi, PublicMenu_d_FancyMenuItemSpec as FancyMenuItemSpec, PublicMenu_d_ColorSwatchMenuItemSpec as ColorSwatchMenuItemSpec, PublicMenu_d_InsertTableMenuItemSpec as InsertTableMenuItemSpec, PublicMenu_d_ToggleMenuItemSpec as ToggleMenuItemSpec, PublicMenu_d_ToggleMenuItemInstanceApi as ToggleMenuItemInstanceApi, PublicMenu_d_ChoiceMenuItemSpec as ChoiceMenuItemSpec, PublicMenu_d_ChoiceMenuItemInstanceApi as ChoiceMenuItemInstanceApi, PublicMenu_d_SeparatorMenuItemSpec as SeparatorMenuItemSpec, PublicMenu_d_ContextMenuApi as ContextMenuApi, PublicMenu_d_ContextMenuContents as ContextMenuContents, PublicMenu_d_ContextMenuItem as ContextMenuItem, PublicMenu_d_ContextSubMenu as ContextSubMenu, PublicMenu_d_CardMenuItemSpec as CardMenuItemSpec, PublicMenu_d_CardMenuItemInstanceApi as CardMenuItemInstanceApi, PublicMenu_d_CardItemSpec as CardItemSpec, PublicMenu_d_CardContainerSpec as CardContainerSpec, PublicMenu_d_CardImageSpec as CardImageSpec, PublicMenu_d_CardTextSpec as CardTextSpec, };
  1022. }
  1023. interface SidebarInstanceApi {
  1024. element: () => HTMLElement;
  1025. }
  1026. interface SidebarSpec {
  1027. icon?: string;
  1028. tooltip?: string;
  1029. onShow?: (api: SidebarInstanceApi) => void;
  1030. onSetup?: (api: SidebarInstanceApi) => (api: SidebarInstanceApi) => void;
  1031. onHide?: (api: SidebarInstanceApi) => void;
  1032. }
  1033. type PublicSidebar_d_SidebarSpec = SidebarSpec;
  1034. type PublicSidebar_d_SidebarInstanceApi = SidebarInstanceApi;
  1035. declare namespace PublicSidebar_d {
  1036. export { PublicSidebar_d_SidebarSpec as SidebarSpec, PublicSidebar_d_SidebarInstanceApi as SidebarInstanceApi, };
  1037. }
  1038. interface ToolbarGroupSetting {
  1039. name: string;
  1040. items: string[];
  1041. }
  1042. declare type ToolbarConfig = string | ToolbarGroupSetting[];
  1043. interface GroupToolbarButtonInstanceApi extends BaseToolbarButtonInstanceApi {
  1044. }
  1045. interface GroupToolbarButtonSpec extends BaseToolbarButtonSpec<GroupToolbarButtonInstanceApi> {
  1046. type?: 'grouptoolbarbutton';
  1047. items?: ToolbarConfig;
  1048. }
  1049. declare type MenuButtonItemTypes = NestedMenuItemContents;
  1050. declare type SuccessCallback$1 = (menu: string | MenuButtonItemTypes[]) => void;
  1051. interface BaseMenuButtonSpec {
  1052. text?: string;
  1053. tooltip?: string;
  1054. icon?: string;
  1055. fetch: (success: SuccessCallback$1) => void;
  1056. onSetup?: (api: BaseMenuButtonInstanceApi) => (api: BaseMenuButtonInstanceApi) => void;
  1057. }
  1058. interface BaseMenuButtonInstanceApi {
  1059. isEnabled: () => boolean;
  1060. setEnabled: (state: boolean) => void;
  1061. isActive: () => boolean;
  1062. setActive: (state: boolean) => void;
  1063. }
  1064. interface ToolbarMenuButtonSpec extends BaseMenuButtonSpec {
  1065. type?: 'menubutton';
  1066. onSetup?: (api: ToolbarMenuButtonInstanceApi) => (api: ToolbarMenuButtonInstanceApi) => void;
  1067. }
  1068. interface ToolbarMenuButtonInstanceApi extends BaseMenuButtonInstanceApi {
  1069. }
  1070. declare type ToolbarSplitButtonItemTypes = ChoiceMenuItemSpec | SeparatorMenuItemSpec;
  1071. declare type SuccessCallback = (menu: ToolbarSplitButtonItemTypes[]) => void;
  1072. declare type SelectPredicate = (value: string) => boolean;
  1073. declare type PresetTypes = 'color' | 'normal' | 'listpreview';
  1074. declare type ColumnTypes = number | 'auto';
  1075. interface ToolbarSplitButtonSpec {
  1076. type?: 'splitbutton';
  1077. tooltip?: string;
  1078. icon?: string;
  1079. text?: string;
  1080. select?: SelectPredicate;
  1081. presets?: PresetTypes;
  1082. columns?: ColumnTypes;
  1083. fetch: (success: SuccessCallback) => void;
  1084. onSetup?: (api: ToolbarSplitButtonInstanceApi) => (api: ToolbarSplitButtonInstanceApi) => void;
  1085. onAction: (api: ToolbarSplitButtonInstanceApi) => void;
  1086. onItemAction: (api: ToolbarSplitButtonInstanceApi, value: string) => void;
  1087. }
  1088. interface ToolbarSplitButtonInstanceApi {
  1089. isEnabled: () => boolean;
  1090. setEnabled: (state: boolean) => void;
  1091. setIconFill: (id: string, value: string) => void;
  1092. isActive: () => boolean;
  1093. setActive: (state: boolean) => void;
  1094. }
  1095. type PublicToolbar_d_ToolbarButtonSpec = ToolbarButtonSpec;
  1096. type PublicToolbar_d_ToolbarButtonInstanceApi = ToolbarButtonInstanceApi;
  1097. type PublicToolbar_d_ToolbarSplitButtonSpec = ToolbarSplitButtonSpec;
  1098. type PublicToolbar_d_ToolbarSplitButtonInstanceApi = ToolbarSplitButtonInstanceApi;
  1099. type PublicToolbar_d_ToolbarMenuButtonSpec = ToolbarMenuButtonSpec;
  1100. type PublicToolbar_d_ToolbarMenuButtonInstanceApi = ToolbarMenuButtonInstanceApi;
  1101. type PublicToolbar_d_ToolbarToggleButtonSpec = ToolbarToggleButtonSpec;
  1102. type PublicToolbar_d_ToolbarToggleButtonInstanceApi = ToolbarToggleButtonInstanceApi;
  1103. type PublicToolbar_d_GroupToolbarButtonSpec = GroupToolbarButtonSpec;
  1104. type PublicToolbar_d_GroupToolbarButtonInstanceApi = GroupToolbarButtonInstanceApi;
  1105. declare namespace PublicToolbar_d {
  1106. export { PublicToolbar_d_ToolbarButtonSpec as ToolbarButtonSpec, PublicToolbar_d_ToolbarButtonInstanceApi as ToolbarButtonInstanceApi, PublicToolbar_d_ToolbarSplitButtonSpec as ToolbarSplitButtonSpec, PublicToolbar_d_ToolbarSplitButtonInstanceApi as ToolbarSplitButtonInstanceApi, PublicToolbar_d_ToolbarMenuButtonSpec as ToolbarMenuButtonSpec, PublicToolbar_d_ToolbarMenuButtonInstanceApi as ToolbarMenuButtonInstanceApi, PublicToolbar_d_ToolbarToggleButtonSpec as ToolbarToggleButtonSpec, PublicToolbar_d_ToolbarToggleButtonInstanceApi as ToolbarToggleButtonInstanceApi, PublicToolbar_d_GroupToolbarButtonSpec as GroupToolbarButtonSpec, PublicToolbar_d_GroupToolbarButtonInstanceApi as GroupToolbarButtonInstanceApi, };
  1107. }
  1108. interface Registry$1 {
  1109. addButton: (name: string, spec: ToolbarButtonSpec) => void;
  1110. addGroupToolbarButton: (name: string, spec: GroupToolbarButtonSpec) => void;
  1111. addToggleButton: (name: string, spec: ToolbarToggleButtonSpec) => void;
  1112. addMenuButton: (name: string, spec: ToolbarMenuButtonSpec) => void;
  1113. addSplitButton: (name: string, spec: ToolbarSplitButtonSpec) => void;
  1114. addMenuItem: (name: string, spec: MenuItemSpec) => void;
  1115. addNestedMenuItem: (name: string, spec: NestedMenuItemSpec) => void;
  1116. addToggleMenuItem: (name: string, spec: ToggleMenuItemSpec) => void;
  1117. addContextMenu: (name: string, spec: ContextMenuApi) => void;
  1118. addContextToolbar: (name: string, spec: ContextToolbarSpec) => void;
  1119. addContextForm: (name: string, spec: ContextFormSpec) => void;
  1120. addIcon: (name: string, svgData: string) => void;
  1121. addAutocompleter: (name: string, spec: AutocompleterSpec) => void;
  1122. addSidebar: (name: string, spec: SidebarSpec) => void;
  1123. getAll: () => {
  1124. buttons: Record<string, ToolbarButtonSpec | GroupToolbarButtonSpec | ToolbarMenuButtonSpec | ToolbarSplitButtonSpec | ToolbarToggleButtonSpec>;
  1125. menuItems: Record<string, MenuItemSpec | NestedMenuItemSpec | ToggleMenuItemSpec>;
  1126. popups: Record<string, AutocompleterSpec>;
  1127. contextMenus: Record<string, ContextMenuApi>;
  1128. contextToolbars: Record<string, ContextToolbarSpec | ContextFormSpec>;
  1129. icons: Record<string, string>;
  1130. sidebars: Record<string, SidebarSpec>;
  1131. };
  1132. }
  1133. interface AutocompleteLookupData {
  1134. readonly matchText: string;
  1135. readonly items: AutocompleterContents[];
  1136. readonly columns: ColumnTypes$1;
  1137. readonly onAction: (autoApi: AutocompleterInstanceApi, rng: Range, value: string, meta: Record<string, any>) => void;
  1138. readonly highlightOn: string[];
  1139. }
  1140. interface AutocompleterEventArgs {
  1141. readonly lookupData: AutocompleteLookupData[];
  1142. }
  1143. interface RangeLikeObject {
  1144. startContainer: Node;
  1145. startOffset: number;
  1146. endContainer: Node;
  1147. endOffset: number;
  1148. }
  1149. declare type ApplyFormat = BlockFormat | InlineFormat | SelectorFormat;
  1150. declare type RemoveFormat = RemoveBlockFormat | RemoveInlineFormat | RemoveSelectorFormat;
  1151. declare type Format = ApplyFormat | RemoveFormat;
  1152. declare type Formats = Record<string, Format | Format[]>;
  1153. declare type FormatAttrOrStyleValue = string | ((vars?: FormatVars) => string);
  1154. declare type FormatVars = Record<string, string | null>;
  1155. interface BaseFormat<T> {
  1156. ceFalseOverride?: boolean;
  1157. classes?: string | string[];
  1158. collapsed?: boolean;
  1159. exact?: boolean;
  1160. expand?: boolean;
  1161. links?: boolean;
  1162. mixed?: boolean;
  1163. block_expand?: boolean;
  1164. onmatch?: (node: Node, fmt: T, itemName: string) => boolean;
  1165. remove?: 'none' | 'empty' | 'all';
  1166. remove_similar?: boolean;
  1167. split?: boolean;
  1168. deep?: boolean;
  1169. preserve_attributes?: string[];
  1170. }
  1171. interface Block {
  1172. block: string;
  1173. list_block?: string;
  1174. wrapper?: boolean;
  1175. }
  1176. interface Inline {
  1177. inline: string;
  1178. }
  1179. interface Selector {
  1180. selector: string;
  1181. inherit?: boolean;
  1182. }
  1183. interface CommonFormat<T> extends BaseFormat<T> {
  1184. attributes?: Record<string, FormatAttrOrStyleValue>;
  1185. styles?: Record<string, FormatAttrOrStyleValue>;
  1186. toggle?: boolean;
  1187. preview?: string | false;
  1188. onformat?: (elm: Node, fmt: T, vars?: FormatVars, node?: Node | RangeLikeObject) => void;
  1189. clear_child_styles?: boolean;
  1190. merge_siblings?: boolean;
  1191. merge_with_parents?: boolean;
  1192. }
  1193. interface BlockFormat extends Block, CommonFormat<BlockFormat> {
  1194. }
  1195. interface InlineFormat extends Inline, CommonFormat<InlineFormat> {
  1196. }
  1197. interface SelectorFormat extends Selector, CommonFormat<SelectorFormat> {
  1198. }
  1199. interface CommonRemoveFormat<T> extends BaseFormat<T> {
  1200. attributes?: string[] | Record<string, FormatAttrOrStyleValue>;
  1201. styles?: string[] | Record<string, FormatAttrOrStyleValue>;
  1202. }
  1203. interface RemoveBlockFormat extends Block, CommonRemoveFormat<RemoveBlockFormat> {
  1204. }
  1205. interface RemoveInlineFormat extends Inline, CommonRemoveFormat<RemoveInlineFormat> {
  1206. }
  1207. interface RemoveSelectorFormat extends Selector, CommonRemoveFormat<RemoveSelectorFormat> {
  1208. }
  1209. interface ParserArgs {
  1210. getInner?: boolean | number;
  1211. forced_root_block?: boolean | string;
  1212. context?: string;
  1213. isRootContent?: boolean;
  1214. format?: string;
  1215. invalid?: boolean;
  1216. no_events?: boolean;
  1217. [key: string]: any;
  1218. }
  1219. declare type ParserFilterCallback = (nodes: AstNode[], name: string, args: ParserArgs) => void;
  1220. interface ParserFilter {
  1221. name: string;
  1222. callbacks: ParserFilterCallback[];
  1223. }
  1224. interface DomParserSettings {
  1225. allow_html_data_urls?: boolean;
  1226. allow_svg_data_urls?: boolean;
  1227. allow_conditional_comments?: boolean;
  1228. allow_html_in_named_anchor?: boolean;
  1229. allow_script_urls?: boolean;
  1230. allow_unsafe_link_target?: boolean;
  1231. convert_fonts_to_spans?: boolean;
  1232. fix_list_elements?: boolean;
  1233. font_size_legacy_values?: string;
  1234. forced_root_block?: boolean | string;
  1235. forced_root_block_attrs?: Record<string, string>;
  1236. preserve_cdata?: boolean;
  1237. remove_trailing_brs?: boolean;
  1238. root_name?: string;
  1239. validate?: boolean;
  1240. inline_styles?: boolean;
  1241. blob_cache?: BlobCache;
  1242. document?: Document;
  1243. }
  1244. interface DomParser {
  1245. schema: Schema;
  1246. addAttributeFilter: (name: string, callback: (nodes: AstNode[], name: string, args: ParserArgs) => void) => void;
  1247. getAttributeFilters: () => ParserFilter[];
  1248. addNodeFilter: (name: string, callback: (nodes: AstNode[], name: string, args: ParserArgs) => void) => void;
  1249. getNodeFilters: () => ParserFilter[];
  1250. parse: (html: string, args?: ParserArgs) => AstNode;
  1251. }
  1252. interface StyleSheetLoaderSettings {
  1253. maxLoadTime?: number;
  1254. contentCssCors?: boolean;
  1255. referrerPolicy?: ReferrerPolicy;
  1256. }
  1257. interface StyleSheetLoader {
  1258. load: (url: string) => Promise<void>;
  1259. loadAll: (urls: string[]) => Promise<string[]>;
  1260. unload: (url: string) => void;
  1261. unloadAll: (urls: string[]) => void;
  1262. _setReferrerPolicy: (referrerPolicy: ReferrerPolicy) => void;
  1263. }
  1264. declare type Registry = Registry$1;
  1265. interface EditorUiApi {
  1266. show: () => void;
  1267. hide: () => void;
  1268. setEnabled: (state: boolean) => void;
  1269. isEnabled: () => boolean;
  1270. }
  1271. interface EditorUi extends EditorUiApi {
  1272. registry: Registry;
  1273. styleSheetLoader: StyleSheetLoader;
  1274. }
  1275. type Ui_d_Registry = Registry;
  1276. type Ui_d_EditorUiApi = EditorUiApi;
  1277. type Ui_d_EditorUi = EditorUi;
  1278. declare namespace Ui_d {
  1279. export { Ui_d_Registry as Registry, PublicDialog_d as Dialog, PublicInlineContent_d as InlineContent, PublicMenu_d as Menu, PublicSidebar_d as Sidebar, PublicToolbar_d as Toolbar, Ui_d_EditorUiApi as EditorUiApi, Ui_d_EditorUi as EditorUi, };
  1280. }
  1281. interface WindowParams {
  1282. readonly inline?: 'cursor' | 'toolbar';
  1283. readonly ariaAttrs?: boolean;
  1284. }
  1285. declare type InstanceApi<T> = UrlDialogInstanceApi | DialogInstanceApi<T>;
  1286. interface WindowManagerImpl {
  1287. open: <T>(config: DialogSpec<T>, params: WindowParams, closeWindow: (dialog: DialogInstanceApi<T>) => void) => DialogInstanceApi<T>;
  1288. openUrl: (config: UrlDialogSpec, closeWindow: (dialog: UrlDialogInstanceApi) => void) => UrlDialogInstanceApi;
  1289. alert: (message: string, callback: () => void) => void;
  1290. confirm: (message: string, callback: (state: boolean) => void) => void;
  1291. close: (dialog: InstanceApi<any>) => void;
  1292. }
  1293. interface WindowManager {
  1294. open: <T>(config: DialogSpec<T>, params?: WindowParams) => DialogInstanceApi<T>;
  1295. openUrl: (config: UrlDialogSpec) => UrlDialogInstanceApi;
  1296. alert: (message: string, callback?: () => void, scope?: any) => void;
  1297. confirm: (message: string, callback?: (state: boolean) => void, scope?: any) => void;
  1298. close: () => void;
  1299. }
  1300. interface ExecCommandEvent {
  1301. command: string;
  1302. ui?: boolean;
  1303. value?: any;
  1304. }
  1305. interface BeforeGetContentEvent extends GetContentArgs {
  1306. selection?: boolean;
  1307. }
  1308. interface GetContentEvent extends BeforeGetContentEvent {
  1309. content: string;
  1310. }
  1311. interface BeforeSetContentEvent extends SetContentArgs {
  1312. content: string;
  1313. selection?: boolean;
  1314. }
  1315. interface SetContentEvent extends BeforeSetContentEvent {
  1316. content: string;
  1317. }
  1318. interface NewBlockEvent {
  1319. newBlock: Element;
  1320. }
  1321. interface NodeChangeEvent {
  1322. element: Element;
  1323. parents: Node[];
  1324. selectionChange?: boolean;
  1325. initial?: boolean;
  1326. }
  1327. interface FormatEvent {
  1328. format: string;
  1329. vars?: FormatVars;
  1330. node?: Node | RangeLikeObject;
  1331. }
  1332. interface ObjectResizeEvent {
  1333. target: HTMLElement;
  1334. width: number;
  1335. height: number;
  1336. origin: string;
  1337. }
  1338. interface ObjectSelectedEvent {
  1339. target: Node;
  1340. targetClone?: Node;
  1341. }
  1342. interface ScrollIntoViewEvent {
  1343. elm: HTMLElement;
  1344. alignToTop: boolean;
  1345. }
  1346. interface SetSelectionRangeEvent {
  1347. range: Range;
  1348. forward: boolean;
  1349. }
  1350. interface ShowCaretEvent {
  1351. target: Node;
  1352. direction: number;
  1353. before: boolean;
  1354. }
  1355. interface SwitchModeEvent {
  1356. mode: string;
  1357. }
  1358. interface AddUndoEvent {
  1359. level: UndoLevel;
  1360. lastLevel: UndoLevel;
  1361. originalEvent: Event;
  1362. }
  1363. interface UndoRedoEvent {
  1364. level: UndoLevel;
  1365. }
  1366. interface WindowEvent<T extends DialogData> {
  1367. dialog: InstanceApi<T>;
  1368. }
  1369. interface ProgressStateEvent {
  1370. state: boolean;
  1371. time?: number;
  1372. }
  1373. interface AfterProgressStateEvent {
  1374. state: boolean;
  1375. }
  1376. interface PlaceholderToggleEvent {
  1377. state: boolean;
  1378. }
  1379. interface LoadErrorEvent {
  1380. message: string;
  1381. }
  1382. interface PreProcessEvent extends ParserArgs {
  1383. node: Element;
  1384. }
  1385. interface PostProcessEvent extends ParserArgs {
  1386. content: string;
  1387. }
  1388. interface PastePlainTextToggleEvent {
  1389. state: boolean;
  1390. }
  1391. interface PastePreProcessEvent {
  1392. content: string;
  1393. readonly internal: boolean;
  1394. }
  1395. interface PastePostProcessEvent {
  1396. node: HTMLElement;
  1397. readonly internal: boolean;
  1398. }
  1399. interface NewTableRowEvent {
  1400. node: HTMLTableRowElement;
  1401. }
  1402. interface NewTableCellEvent {
  1403. node: HTMLTableCellElement;
  1404. }
  1405. interface TableEventData {
  1406. readonly structure: boolean;
  1407. readonly style: boolean;
  1408. }
  1409. interface TableModifiedEvent extends TableEventData {
  1410. readonly table: HTMLTableElement;
  1411. }
  1412. interface EditorEventMap extends Omit<NativeEventMap, 'blur' | 'focus'> {
  1413. 'activate': {
  1414. relatedTarget: Editor;
  1415. };
  1416. 'deactivate': {
  1417. relatedTarget: Editor;
  1418. };
  1419. 'focus': {
  1420. blurredEditor: Editor;
  1421. };
  1422. 'blur': {
  1423. focusedEditor: Editor;
  1424. };
  1425. 'resize': UIEvent;
  1426. 'scroll': UIEvent;
  1427. 'detach': {};
  1428. 'remove': {};
  1429. 'init': {};
  1430. 'ScrollIntoView': ScrollIntoViewEvent;
  1431. 'AfterScrollIntoView': ScrollIntoViewEvent;
  1432. 'ObjectResized': ObjectResizeEvent;
  1433. 'ObjectResizeStart': ObjectResizeEvent;
  1434. 'SwitchMode': SwitchModeEvent;
  1435. 'ScrollWindow': UIEvent;
  1436. 'ResizeWindow': UIEvent;
  1437. 'SkinLoaded': {};
  1438. 'SkinLoadError': LoadErrorEvent;
  1439. 'PluginLoadError': LoadErrorEvent;
  1440. 'ModelLoadError': LoadErrorEvent;
  1441. 'IconsLoadError': LoadErrorEvent;
  1442. 'ThemeLoadError': LoadErrorEvent;
  1443. 'LanguageLoadError': LoadErrorEvent;
  1444. 'BeforeExecCommand': ExecCommandEvent;
  1445. 'ExecCommand': ExecCommandEvent;
  1446. 'NodeChange': NodeChangeEvent;
  1447. 'FormatApply': FormatEvent;
  1448. 'FormatRemove': FormatEvent;
  1449. 'ShowCaret': ShowCaretEvent;
  1450. 'SelectionChange': {};
  1451. 'ObjectSelected': ObjectSelectedEvent;
  1452. 'BeforeObjectSelected': ObjectSelectedEvent;
  1453. 'GetSelectionRange': {
  1454. range: Range;
  1455. };
  1456. 'SetSelectionRange': SetSelectionRangeEvent;
  1457. 'AfterSetSelectionRange': SetSelectionRangeEvent;
  1458. 'BeforeGetContent': BeforeGetContentEvent;
  1459. 'GetContent': GetContentEvent;
  1460. 'BeforeSetContent': BeforeSetContentEvent;
  1461. 'SetContent': SetContentEvent;
  1462. 'LoadContent': {};
  1463. 'PreviewFormats': {};
  1464. 'AfterPreviewFormats': {};
  1465. 'ScriptsLoaded': {};
  1466. 'PreInit': {};
  1467. 'PostRender': {};
  1468. 'NewBlock': NewBlockEvent;
  1469. 'ClearUndos': {};
  1470. 'TypingUndo': {};
  1471. 'Redo': UndoRedoEvent;
  1472. 'Undo': UndoRedoEvent;
  1473. 'BeforeAddUndo': AddUndoEvent;
  1474. 'AddUndo': AddUndoEvent;
  1475. 'CloseWindow': WindowEvent<any>;
  1476. 'OpenWindow': WindowEvent<any>;
  1477. 'ProgressState': ProgressStateEvent;
  1478. 'AfterProgressState': AfterProgressStateEvent;
  1479. 'PlaceholderToggle': PlaceholderToggleEvent;
  1480. 'tap': TouchEvent;
  1481. 'longpress': TouchEvent;
  1482. 'longpresscancel': {};
  1483. 'PreProcess': PreProcessEvent;
  1484. 'PostProcess': PostProcessEvent;
  1485. 'AutocompleterStart': AutocompleterEventArgs;
  1486. 'AutocompleterUpdate': AutocompleterEventArgs;
  1487. 'AutocompleterEnd': {};
  1488. 'PastePlainTextToggle': PastePlainTextToggleEvent;
  1489. 'PastePreProcess': PastePreProcessEvent;
  1490. 'PastePostProcess': PastePostProcessEvent;
  1491. 'TableModified': TableModifiedEvent;
  1492. 'NewRow': NewTableRowEvent;
  1493. 'NewCell': NewTableCellEvent;
  1494. }
  1495. interface EditorManagerEventMap {
  1496. 'AddEditor': {
  1497. editor: Editor;
  1498. };
  1499. 'RemoveEditor': {
  1500. editor: Editor;
  1501. };
  1502. 'BeforeUnload': {
  1503. returnValue: any;
  1504. };
  1505. }
  1506. type EventTypes_d_ExecCommandEvent = ExecCommandEvent;
  1507. type EventTypes_d_BeforeGetContentEvent = BeforeGetContentEvent;
  1508. type EventTypes_d_GetContentEvent = GetContentEvent;
  1509. type EventTypes_d_BeforeSetContentEvent = BeforeSetContentEvent;
  1510. type EventTypes_d_SetContentEvent = SetContentEvent;
  1511. type EventTypes_d_NewBlockEvent = NewBlockEvent;
  1512. type EventTypes_d_NodeChangeEvent = NodeChangeEvent;
  1513. type EventTypes_d_FormatEvent = FormatEvent;
  1514. type EventTypes_d_ObjectResizeEvent = ObjectResizeEvent;
  1515. type EventTypes_d_ObjectSelectedEvent = ObjectSelectedEvent;
  1516. type EventTypes_d_ScrollIntoViewEvent = ScrollIntoViewEvent;
  1517. type EventTypes_d_SetSelectionRangeEvent = SetSelectionRangeEvent;
  1518. type EventTypes_d_ShowCaretEvent = ShowCaretEvent;
  1519. type EventTypes_d_SwitchModeEvent = SwitchModeEvent;
  1520. type EventTypes_d_AddUndoEvent = AddUndoEvent;
  1521. type EventTypes_d_UndoRedoEvent = UndoRedoEvent;
  1522. type EventTypes_d_WindowEvent<_0> = WindowEvent<_0>;
  1523. type EventTypes_d_ProgressStateEvent = ProgressStateEvent;
  1524. type EventTypes_d_AfterProgressStateEvent = AfterProgressStateEvent;
  1525. type EventTypes_d_PlaceholderToggleEvent = PlaceholderToggleEvent;
  1526. type EventTypes_d_LoadErrorEvent = LoadErrorEvent;
  1527. type EventTypes_d_PreProcessEvent = PreProcessEvent;
  1528. type EventTypes_d_PostProcessEvent = PostProcessEvent;
  1529. type EventTypes_d_PastePlainTextToggleEvent = PastePlainTextToggleEvent;
  1530. type EventTypes_d_PastePreProcessEvent = PastePreProcessEvent;
  1531. type EventTypes_d_PastePostProcessEvent = PastePostProcessEvent;
  1532. type EventTypes_d_NewTableRowEvent = NewTableRowEvent;
  1533. type EventTypes_d_NewTableCellEvent = NewTableCellEvent;
  1534. type EventTypes_d_TableEventData = TableEventData;
  1535. type EventTypes_d_TableModifiedEvent = TableModifiedEvent;
  1536. type EventTypes_d_EditorEventMap = EditorEventMap;
  1537. type EventTypes_d_EditorManagerEventMap = EditorManagerEventMap;
  1538. declare namespace EventTypes_d {
  1539. export { EventTypes_d_ExecCommandEvent as ExecCommandEvent, EventTypes_d_BeforeGetContentEvent as BeforeGetContentEvent, EventTypes_d_GetContentEvent as GetContentEvent, EventTypes_d_BeforeSetContentEvent as BeforeSetContentEvent, EventTypes_d_SetContentEvent as SetContentEvent, EventTypes_d_NewBlockEvent as NewBlockEvent, EventTypes_d_NodeChangeEvent as NodeChangeEvent, EventTypes_d_FormatEvent as FormatEvent, EventTypes_d_ObjectResizeEvent as ObjectResizeEvent, EventTypes_d_ObjectSelectedEvent as ObjectSelectedEvent, EventTypes_d_ScrollIntoViewEvent as ScrollIntoViewEvent, EventTypes_d_SetSelectionRangeEvent as SetSelectionRangeEvent, EventTypes_d_ShowCaretEvent as ShowCaretEvent, EventTypes_d_SwitchModeEvent as SwitchModeEvent, EventTypes_d_AddUndoEvent as AddUndoEvent, EventTypes_d_UndoRedoEvent as UndoRedoEvent, EventTypes_d_WindowEvent as WindowEvent, EventTypes_d_ProgressStateEvent as ProgressStateEvent, EventTypes_d_AfterProgressStateEvent as AfterProgressStateEvent, EventTypes_d_PlaceholderToggleEvent as PlaceholderToggleEvent, EventTypes_d_LoadErrorEvent as LoadErrorEvent, EventTypes_d_PreProcessEvent as PreProcessEvent, EventTypes_d_PostProcessEvent as PostProcessEvent, EventTypes_d_PastePlainTextToggleEvent as PastePlainTextToggleEvent, EventTypes_d_PastePreProcessEvent as PastePreProcessEvent, EventTypes_d_PastePostProcessEvent as PastePostProcessEvent, EventTypes_d_NewTableRowEvent as NewTableRowEvent, EventTypes_d_NewTableCellEvent as NewTableCellEvent, EventTypes_d_TableEventData as TableEventData, EventTypes_d_TableModifiedEvent as TableModifiedEvent, EventTypes_d_EditorEventMap as EditorEventMap, EventTypes_d_EditorManagerEventMap as EditorManagerEventMap, };
  1540. }
  1541. type Format_d_Formats = Formats;
  1542. type Format_d_Format = Format;
  1543. type Format_d_ApplyFormat = ApplyFormat;
  1544. type Format_d_BlockFormat = BlockFormat;
  1545. type Format_d_InlineFormat = InlineFormat;
  1546. type Format_d_SelectorFormat = SelectorFormat;
  1547. type Format_d_RemoveFormat = RemoveFormat;
  1548. type Format_d_RemoveBlockFormat = RemoveBlockFormat;
  1549. type Format_d_RemoveInlineFormat = RemoveInlineFormat;
  1550. type Format_d_RemoveSelectorFormat = RemoveSelectorFormat;
  1551. declare namespace Format_d {
  1552. export { Format_d_Formats as Formats, Format_d_Format as Format, Format_d_ApplyFormat as ApplyFormat, Format_d_BlockFormat as BlockFormat, Format_d_InlineFormat as InlineFormat, Format_d_SelectorFormat as SelectorFormat, Format_d_RemoveFormat as RemoveFormat, Format_d_RemoveBlockFormat as RemoveBlockFormat, Format_d_RemoveInlineFormat as RemoveInlineFormat, Format_d_RemoveSelectorFormat as RemoveSelectorFormat, };
  1553. }
  1554. declare type StyleFormat = BlockStyleFormat | InlineStyleFormat | SelectorStyleFormat;
  1555. declare type AllowedFormat = Separator | FormatReference | StyleFormat | NestedFormatting;
  1556. interface Separator {
  1557. title: string;
  1558. }
  1559. interface FormatReference {
  1560. title: string;
  1561. format: string;
  1562. icon?: string;
  1563. }
  1564. interface NestedFormatting {
  1565. title: string;
  1566. items: Array<FormatReference | StyleFormat>;
  1567. }
  1568. interface CommonStyleFormat {
  1569. name?: string;
  1570. title: string;
  1571. icon?: string;
  1572. }
  1573. interface BlockStyleFormat extends BlockFormat, CommonStyleFormat {
  1574. }
  1575. interface InlineStyleFormat extends InlineFormat, CommonStyleFormat {
  1576. }
  1577. interface SelectorStyleFormat extends SelectorFormat, CommonStyleFormat {
  1578. }
  1579. declare type EntityEncoding = 'named' | 'numeric' | 'raw' | 'named,numeric' | 'named+numeric' | 'numeric,named' | 'numeric+named';
  1580. interface ContentLanguage {
  1581. readonly title: string;
  1582. readonly code: string;
  1583. readonly customCode?: string;
  1584. }
  1585. declare type ThemeInitFunc = (editor: Editor, elm: HTMLElement) => {
  1586. editorContainer: HTMLElement;
  1587. iframeContainer: HTMLElement;
  1588. height?: number;
  1589. iframeHeight?: number;
  1590. api?: EditorUiApi;
  1591. };
  1592. declare type SetupCallback = (editor: Editor) => void;
  1593. declare type FilePickerCallback = (callback: Function, value: any, meta: Record<string, any>) => void;
  1594. declare type FilePickerValidationStatus = 'valid' | 'unknown' | 'invalid' | 'none';
  1595. declare type FilePickerValidationCallback = (info: {
  1596. type: string;
  1597. url: string;
  1598. }, callback: (validation: {
  1599. status: FilePickerValidationStatus;
  1600. message: string;
  1601. }) => void) => void;
  1602. declare type PastePreProcessFn = (editor: Editor, args: PastePreProcessEvent) => void;
  1603. declare type PastePostProcessFn = (editor: Editor, args: PastePostProcessEvent) => void;
  1604. declare type URLConverter = (url: string, name: string, elm?: HTMLElement) => string;
  1605. declare type URLConverterCallback = (url: string, node: Node, on_save: boolean, name: string) => string;
  1606. interface ToolbarGroup {
  1607. name?: string;
  1608. items: string[];
  1609. }
  1610. declare type ToolbarMode = 'floating' | 'sliding' | 'scrolling' | 'wrap';
  1611. interface BaseEditorOptions {
  1612. a11y_advanced_options?: boolean;
  1613. add_form_submit_trigger?: boolean;
  1614. add_unload_trigger?: boolean;
  1615. allow_conditional_comments?: boolean;
  1616. allow_html_data_urls?: boolean;
  1617. allow_html_in_named_anchor?: boolean;
  1618. allow_script_urls?: boolean;
  1619. allow_svg_data_urls?: boolean;
  1620. allow_unsafe_link_target?: boolean;
  1621. anchor_bottom?: false | string;
  1622. anchor_top?: false | string;
  1623. auto_focus?: string | true;
  1624. automatic_uploads?: boolean;
  1625. base_url?: string;
  1626. block_formats?: string;
  1627. block_unsupported_drop?: boolean;
  1628. body_id?: string;
  1629. body_class?: string;
  1630. br_in_pre?: boolean;
  1631. br_newline_selector?: string;
  1632. browser_spellcheck?: boolean;
  1633. branding?: boolean;
  1634. cache_suffix?: string;
  1635. color_cols?: number;
  1636. color_map?: string[];
  1637. content_css?: boolean | string | string[];
  1638. content_css_cors?: boolean;
  1639. content_security_policy?: string;
  1640. content_style?: string;
  1641. content_langs?: ContentLanguage[];
  1642. contextmenu?: string | string[] | false;
  1643. contextmenu_never_use_native?: boolean;
  1644. convert_fonts_to_spans?: boolean;
  1645. convert_urls?: boolean;
  1646. custom_colors?: boolean;
  1647. custom_elements?: string;
  1648. custom_ui_selector?: string;
  1649. custom_undo_redo_levels?: number;
  1650. deprecation_warnings?: boolean;
  1651. directionality?: 'ltr' | 'rtl';
  1652. doctype?: string;
  1653. document_base_url?: string;
  1654. editable_class?: string;
  1655. element_format?: 'xhtml' | 'html';
  1656. elementpath?: boolean;
  1657. encoding?: string;
  1658. end_container_on_empty_block?: boolean;
  1659. entities?: string;
  1660. entity_encoding?: EntityEncoding;
  1661. extended_valid_elements?: string;
  1662. event_root?: string;
  1663. file_picker_callback?: FilePickerCallback;
  1664. file_picker_types?: string;
  1665. file_picker_validator_handler?: FilePickerValidationCallback;
  1666. fix_list_elements?: boolean;
  1667. fixed_toolbar_container?: string;
  1668. fixed_toolbar_container_target?: HTMLElement;
  1669. font_css?: string | string[];
  1670. font_family_formats?: string;
  1671. font_size_classes?: string;
  1672. font_size_legacy_values?: string;
  1673. font_size_style_values?: string;
  1674. font_size_formats?: string;
  1675. forced_root_block?: string;
  1676. forced_root_block_attrs?: Record<string, string>;
  1677. formats?: Formats;
  1678. height?: number | string;
  1679. hidden_input?: boolean;
  1680. icons?: string;
  1681. icons_url?: string;
  1682. id?: string;
  1683. iframe_aria_text?: string;
  1684. iframe_attrs?: Record<string, string>;
  1685. images_file_types?: string;
  1686. images_replace_blob_uris?: boolean;
  1687. images_reuse_filename?: boolean;
  1688. images_upload_base_path?: string;
  1689. images_upload_credentials?: boolean;
  1690. images_upload_handler?: UploadHandler;
  1691. images_upload_url?: string;
  1692. indent?: boolean;
  1693. indent_after?: string;
  1694. indent_before?: string;
  1695. indent_use_margin?: boolean;
  1696. indentation?: string;
  1697. init_instance_callback?: SetupCallback;
  1698. inline?: boolean;
  1699. inline_boundaries?: boolean;
  1700. inline_boundaries_selector?: string;
  1701. inline_styles?: boolean;
  1702. invalid_elements?: string;
  1703. invalid_styles?: string | Record<string, string>;
  1704. keep_styles?: boolean;
  1705. language?: string;
  1706. language_load?: boolean;
  1707. language_url?: string;
  1708. line_height_formats?: string;
  1709. max_height?: number;
  1710. max_width?: number;
  1711. menu?: Record<string, {
  1712. title: string;
  1713. items: string;
  1714. }>;
  1715. menubar?: boolean | string;
  1716. min_height?: number;
  1717. min_width?: number;
  1718. model?: string;
  1719. model_url?: string;
  1720. no_newline_selector?: string;
  1721. noneditable_class?: string;
  1722. noneditable_regexp?: RegExp | RegExp[];
  1723. nowrap?: boolean;
  1724. object_resizing?: boolean | string;
  1725. paste_as_text?: boolean;
  1726. paste_block_drop?: boolean;
  1727. paste_data_images?: boolean;
  1728. paste_merge_formats?: boolean;
  1729. paste_postprocess?: PastePostProcessFn;
  1730. paste_preprocess?: PastePreProcessFn;
  1731. paste_remove_styles_if_webkit?: boolean;
  1732. paste_tab_spaces?: number;
  1733. paste_webkit_styles?: string;
  1734. placeholder?: string;
  1735. preserve_cdata?: boolean;
  1736. preview_styles?: false | string;
  1737. protect?: RegExp[];
  1738. readonly?: boolean;
  1739. referrer_policy?: ReferrerPolicy;
  1740. relative_urls?: boolean;
  1741. remove_script_host?: boolean;
  1742. remove_trailing_brs?: boolean;
  1743. removed_menuitems?: string;
  1744. resize?: boolean | 'both';
  1745. resize_img_proportional?: boolean;
  1746. root_name?: string;
  1747. schema?: SchemaType;
  1748. selector?: string;
  1749. setup?: SetupCallback;
  1750. skin?: boolean | string;
  1751. skin_url?: string;
  1752. smart_paste?: boolean;
  1753. statusbar?: boolean;
  1754. style_formats?: AllowedFormat[];
  1755. style_formats_autohide?: boolean;
  1756. style_formats_merge?: boolean;
  1757. submit_patch?: boolean;
  1758. suffix?: string;
  1759. table_tab_navigation?: boolean;
  1760. target?: HTMLElement;
  1761. text_patterns?: RawPattern[] | false;
  1762. theme?: string | ThemeInitFunc | false;
  1763. theme_url?: string;
  1764. toolbar?: boolean | string | string[] | Array<ToolbarGroup>;
  1765. toolbar1?: string;
  1766. toolbar2?: string;
  1767. toolbar3?: string;
  1768. toolbar4?: string;
  1769. toolbar5?: string;
  1770. toolbar6?: string;
  1771. toolbar7?: string;
  1772. toolbar8?: string;
  1773. toolbar9?: string;
  1774. toolbar_mode?: ToolbarMode;
  1775. toolbar_sticky?: boolean;
  1776. toolbar_sticky_offset?: number;
  1777. typeahead_urls?: boolean;
  1778. url_converter?: URLConverter;
  1779. url_converter_scope?: any;
  1780. urlconverter_callback?: URLConverterCallback;
  1781. valid_children?: string;
  1782. valid_classes?: string | Record<string, string>;
  1783. valid_elements?: string;
  1784. valid_styles?: string | Record<string, string>;
  1785. verify_html?: boolean;
  1786. visual?: boolean;
  1787. visual_anchor_class?: string;
  1788. visual_table_class?: string;
  1789. width?: number | string;
  1790. disable_nodechange?: boolean;
  1791. forced_plugins?: string | string[];
  1792. plugin_base_urls?: Record<string, string>;
  1793. service_message?: string;
  1794. [key: string]: any;
  1795. }
  1796. interface RawEditorOptions extends BaseEditorOptions {
  1797. external_plugins?: Record<string, string>;
  1798. mobile?: RawEditorOptions;
  1799. plugins?: string | string[];
  1800. }
  1801. interface NormalizedEditorOptions extends BaseEditorOptions {
  1802. external_plugins: Record<string, string>;
  1803. forced_plugins: string[];
  1804. plugins: string[];
  1805. }
  1806. interface EditorOptions extends NormalizedEditorOptions {
  1807. content_css: string[];
  1808. contextmenu: string[];
  1809. font_css: string[];
  1810. forced_root_block: string;
  1811. forced_root_block_attrs: Record<string, string>;
  1812. noneditable_regexp: RegExp[];
  1813. object_resizing?: string;
  1814. preview_styles?: string;
  1815. text_patterns?: Pattern[];
  1816. }
  1817. declare type StyleMap = Record<string, string | number>;
  1818. interface StylesSettings {
  1819. allow_script_urls?: boolean;
  1820. allow_svg_data_urls?: boolean;
  1821. url_converter?: URLConverter;
  1822. url_converter_scope?: any;
  1823. }
  1824. interface Styles {
  1825. parse: (css: string) => Record<string, string>;
  1826. serialize: (styles: StyleMap, elementName?: string) => string;
  1827. }
  1828. declare type EventUtilsCallback<T> = (event: EventUtilsEvent<T>) => void;
  1829. declare type EventUtilsEvent<T> = NormalizedEvent<T> & {
  1830. metaKey: boolean;
  1831. };
  1832. interface EventUtilsConstructor {
  1833. readonly prototype: EventUtils;
  1834. new (): EventUtils;
  1835. Event: EventUtils;
  1836. }
  1837. declare class EventUtils {
  1838. static Event: EventUtils;
  1839. domLoaded: boolean;
  1840. events: Record<string, any>;
  1841. private readonly expando;
  1842. private hasFocusIn;
  1843. private hasMouseEnterLeave;
  1844. private mouseEnterLeave;
  1845. private count;
  1846. constructor();
  1847. bind<K extends keyof HTMLElementEventMap>(target: any, name: K, callback: EventUtilsCallback<HTMLElementEventMap[K]>, scope?: any): EventUtilsCallback<HTMLElementEventMap[K]>;
  1848. bind<T = any>(target: any, names: string, callback: EventUtilsCallback<T>, scope?: any): EventUtilsCallback<T>;
  1849. unbind<K extends keyof HTMLElementEventMap>(target: any, name: K, callback?: EventUtilsCallback<HTMLElementEventMap[K]>): this;
  1850. unbind<T = any>(target: any, names: string, callback?: EventUtilsCallback<T>): this;
  1851. unbind(target: any): this;
  1852. fire(target: any, name: string, args?: {}): this;
  1853. dispatch(target: any, name: string, args?: {}): this;
  1854. clean(target: any): this;
  1855. destroy(): void;
  1856. cancel<T = any>(e: EventUtilsEvent<T>): boolean;
  1857. private executeHandlers;
  1858. }
  1859. interface DOMUtilsSettings {
  1860. schema: Schema;
  1861. url_converter: URLConverter;
  1862. url_converter_scope: any;
  1863. ownEvents: boolean;
  1864. keep_values: boolean;
  1865. update_styles: boolean;
  1866. root_element: HTMLElement;
  1867. collect: Function;
  1868. onSetAttrib: Function;
  1869. contentCssCors: boolean;
  1870. referrerPolicy: ReferrerPolicy;
  1871. }
  1872. declare type Target = Node | Window;
  1873. declare type RunArguments<T extends Node = Node> = string | T | Array<string | T>;
  1874. declare type BoundEvent = [
  1875. Target,
  1876. string,
  1877. EventUtilsCallback<any>,
  1878. any
  1879. ];
  1880. declare type Callback<K extends string> = EventUtilsCallback<MappedEvent<HTMLElementEventMap, K>>;
  1881. declare type RunResult<T, R> = T extends Array<any> ? false | R[] : false | R;
  1882. interface DOMUtils {
  1883. doc: Document;
  1884. settings: Partial<DOMUtilsSettings>;
  1885. win: Window;
  1886. files: Record<string, boolean>;
  1887. stdMode: boolean;
  1888. boxModel: boolean;
  1889. styleSheetLoader: StyleSheetLoader;
  1890. boundEvents: BoundEvent[];
  1891. styles: Styles;
  1892. schema: Schema;
  1893. events: EventUtils;
  1894. root: Node;
  1895. isBlock: (node: string | Node) => boolean;
  1896. clone: (node: Node, deep: boolean) => Node;
  1897. getRoot: () => HTMLElement;
  1898. getViewPort: (argWin?: Window) => GeomRect;
  1899. getRect: (elm: string | HTMLElement) => GeomRect;
  1900. getSize: (elm: string | HTMLElement) => {
  1901. w: number;
  1902. h: number;
  1903. };
  1904. getParent: {
  1905. <K extends keyof HTMLElementTagNameMap>(node: string | Node, selector: K, root?: Node): HTMLElementTagNameMap[K] | null;
  1906. <T extends HTMLElement>(node: string | Node, selector: (node: HTMLElement) => node is T, root?: Node): T | null;
  1907. <T extends Element = Element>(node: string | Node, selector?: string | ((node: HTMLElement) => boolean | void), root?: Node): T | null;
  1908. };
  1909. getParents: {
  1910. <K extends keyof HTMLElementTagNameMap>(elm: string | Node, selector: K, root?: Node, collect?: boolean): Array<HTMLElementTagNameMap[K]>;
  1911. <T extends HTMLElement>(node: string | Node, selector: (node: HTMLElement) => node is T, root?: Node): T[];
  1912. <T extends Element = Element>(elm: string | Node, selector?: string | ((node: HTMLElement) => boolean | void), root?: Node, collect?: boolean): T[];
  1913. };
  1914. get: (elm: string | Node) => HTMLElement | null;
  1915. getNext: (node: Node, selector: string | ((node: Node) => boolean)) => Node | null;
  1916. getPrev: (node: Node, selector: string | ((node: Node) => boolean)) => Node | null;
  1917. select: {
  1918. <K extends keyof HTMLElementTagNameMap>(selector: K, scope?: string | Node): Array<HTMLElementTagNameMap[K]>;
  1919. <T extends HTMLElement = HTMLElement>(selector: string, scope?: string | Node): T[];
  1920. };
  1921. is: (elm: Node | Node[], selector: string) => boolean;
  1922. add: (parentElm: RunArguments, name: string | Node, attrs?: Record<string, string | boolean | number>, html?: string | Node, create?: boolean) => HTMLElement;
  1923. create: {
  1924. <K extends keyof HTMLElementTagNameMap>(name: K, attrs?: Record<string, string | boolean | number>, html?: string | Node): HTMLElementTagNameMap[K];
  1925. (name: string, attrs?: Record<string, string | boolean | number>, html?: string | Node): HTMLElement;
  1926. };
  1927. createHTML: (name: string, attrs?: Record<string, string>, html?: string) => string;
  1928. createFragment: (html?: string) => DocumentFragment;
  1929. remove: <T extends Node>(node: string | T | T[], keepChildren?: boolean) => RunResult<typeof node, T>;
  1930. setStyle: (elm: string | Node | Node[], name: string, value: string | number | null) => void;
  1931. getStyle: (elm: string | Node, name: string, computed?: boolean) => string | undefined;
  1932. setStyles: (elm: string | Node | Node[], stylesArg: StyleMap) => void;
  1933. removeAllAttribs: (e: RunArguments<Element>) => void;
  1934. setAttrib: (elm: string | Node | Node[], name: string, value: string | boolean | number | null) => void;
  1935. setAttribs: (elm: string | Node | Node[], attrs: Record<string, string | boolean | number | null>) => void;
  1936. getAttrib: (elm: string | Node, name: string, defaultVal?: string) => string;
  1937. getPos: (elm: string | Node, rootElm?: Node) => {
  1938. x: number;
  1939. y: number;
  1940. };
  1941. parseStyle: (cssText: string) => Record<string, string>;
  1942. serializeStyle: (stylesArg: StyleMap, name?: string) => string;
  1943. addStyle: (cssText: string) => void;
  1944. loadCSS: (url: string) => void;
  1945. addClass: (elm: string | Node | Node[], cls: string) => void;
  1946. removeClass: (elm: string | Node | Node[], cls: string) => void;
  1947. hasClass: (elm: string | Node, cls: string) => boolean;
  1948. toggleClass: (elm: string | Node | Node[], cls: string, state?: boolean) => void;
  1949. show: (elm: string | Node | Node[]) => void;
  1950. hide: (elm: string | Node | Node[]) => void;
  1951. isHidden: (elm: string | Node) => boolean;
  1952. uniqueId: (prefix?: string) => string;
  1953. setHTML: (elm: string | Node | Node[], html: string) => void;
  1954. getOuterHTML: (elm: string | Node) => string;
  1955. setOuterHTML: (elm: string | Node | Node[], html: string) => void;
  1956. decode: (text: string) => string;
  1957. encode: (text: string) => string;
  1958. insertAfter: {
  1959. <T extends Node>(node: T | T[], reference: string | Node): T;
  1960. <T extends Node>(node: RunArguments<T>, reference: string | Node): RunResult<typeof node, T>;
  1961. };
  1962. replace: {
  1963. <T extends Node>(newElm: Node, oldElm: T | T[], keepChildren?: boolean): T;
  1964. <T extends Node>(newElm: Node, oldElm: RunArguments<T>, keepChildren?: boolean): false | T;
  1965. };
  1966. rename: {
  1967. <K extends keyof HTMLElementTagNameMap>(elm: Element, name: K): HTMLElementTagNameMap[K];
  1968. (elm: Element, name: string): Element;
  1969. };
  1970. findCommonAncestor: (a: Node, b: Node) => Node;
  1971. run<R, T extends Node>(this: DOMUtils, elm: T | T[], func: (node: T) => R, scope?: any): typeof elm extends Array<any> ? R[] : R;
  1972. run<R, T extends Node>(this: DOMUtils, elm: RunArguments<T>, func: (node: T) => R, scope?: any): RunResult<typeof elm, R>;
  1973. getAttribs: (elm: string | Node) => NamedNodeMap | Attr[];
  1974. isEmpty: (node: Node, elements?: Record<string, any>) => boolean;
  1975. createRng: () => Range;
  1976. nodeIndex: (node: Node, normalized?: boolean) => number;
  1977. split: {
  1978. <T extends Node>(parentElm: Node, splitElm: Node, replacementElm: T): T;
  1979. <T extends Node>(parentElm: Node, splitElm: T): T;
  1980. };
  1981. bind: {
  1982. <K extends string>(target: Target, name: K, func: Callback<K>, scope?: any): Callback<K>;
  1983. <K extends string>(target: Target[], name: K, func: Callback<K>, scope?: any): Callback<K>[];
  1984. };
  1985. unbind: {
  1986. <K extends string>(target: Target, name?: K, func?: EventUtilsCallback<MappedEvent<HTMLElementEventMap, K>>): EventUtils;
  1987. <K extends string>(target: Target[], name?: K, func?: EventUtilsCallback<MappedEvent<HTMLElementEventMap, K>>): EventUtils[];
  1988. };
  1989. fire: (target: Node | Window, name: string, evt?: {}) => EventUtils;
  1990. dispatch: (target: Node | Window, name: string, evt?: {}) => EventUtils;
  1991. getContentEditable: (node: Node) => string | null;
  1992. getContentEditableParent: (node: Node) => string | null;
  1993. destroy: () => void;
  1994. isChildOf: (node: Node, parent: Node) => boolean;
  1995. dumpRng: (r: Range) => string;
  1996. }
  1997. interface ClientRect {
  1998. left: number;
  1999. top: number;
  2000. bottom: number;
  2001. right: number;
  2002. width: number;
  2003. height: number;
  2004. }
  2005. interface BookmarkManager {
  2006. getBookmark: (type: number, normalized?: boolean) => Bookmark;
  2007. moveToBookmark: (bookmark: Bookmark) => void;
  2008. }
  2009. interface ControlSelection {
  2010. isResizable: (elm: Element) => boolean;
  2011. showResizeRect: (elm: Element) => void;
  2012. hideResizeRect: () => void;
  2013. updateResizeRect: (evt: EditorEvent<any>) => void;
  2014. destroy: () => void;
  2015. }
  2016. interface WriterSettings {
  2017. element_format?: 'xhtml' | 'html';
  2018. entities?: string;
  2019. entity_encoding?: EntityEncoding;
  2020. indent?: boolean;
  2021. indent_after?: string;
  2022. indent_before?: string;
  2023. }
  2024. declare type Attributes = Array<{
  2025. name: string;
  2026. value: string;
  2027. }>;
  2028. interface Writer {
  2029. cdata: (text: string) => void;
  2030. comment: (text: string) => void;
  2031. doctype: (text: string) => void;
  2032. end: (name: string) => void;
  2033. getContent: () => string;
  2034. pi: (name: string, text?: string) => void;
  2035. reset: () => void;
  2036. start: (name: string, attrs?: Attributes, empty?: boolean) => void;
  2037. text: (text: string, raw?: boolean) => void;
  2038. }
  2039. interface HtmlSerializerSettings extends WriterSettings {
  2040. inner?: boolean;
  2041. validate?: boolean;
  2042. }
  2043. interface HtmlSerializer {
  2044. serialize: (node: AstNode) => string;
  2045. }
  2046. interface DomSerializerSettings extends DomParserSettings, WriterSettings, SchemaSettings, HtmlSerializerSettings {
  2047. url_converter?: URLConverter;
  2048. url_converter_scope?: {};
  2049. }
  2050. interface DomSerializerImpl {
  2051. schema: Schema;
  2052. addNodeFilter: (name: string, callback: (nodes: AstNode[], name: string, args: ParserArgs) => void) => void;
  2053. addAttributeFilter: (name: string, callback: (nodes: AstNode[], name: string, args: ParserArgs) => void) => void;
  2054. getNodeFilters: () => ParserFilter[];
  2055. getAttributeFilters: () => ParserFilter[];
  2056. serialize: {
  2057. (node: Element, parserArgs: {
  2058. format: 'tree';
  2059. } & ParserArgs): AstNode;
  2060. (node: Element, parserArgs?: ParserArgs): string;
  2061. };
  2062. addRules: (rules: string) => void;
  2063. setRules: (rules: string) => void;
  2064. addTempAttr: (name: string) => void;
  2065. getTempAttrs: () => string[];
  2066. }
  2067. interface DomSerializer extends DomSerializerImpl {
  2068. }
  2069. interface EditorSelection {
  2070. bookmarkManager: BookmarkManager;
  2071. controlSelection: ControlSelection;
  2072. dom: DOMUtils;
  2073. win: Window;
  2074. serializer: DomSerializer;
  2075. editor: Editor;
  2076. collapse: (toStart?: boolean) => void;
  2077. setCursorLocation: {
  2078. (node: Node, offset: number): void;
  2079. (): void;
  2080. };
  2081. getContent: {
  2082. (args: {
  2083. format: 'tree';
  2084. } & Partial<GetSelectionContentArgs>): AstNode;
  2085. (args?: Partial<GetSelectionContentArgs>): string;
  2086. };
  2087. setContent: (content: string, args?: Partial<SetSelectionContentArgs>) => void;
  2088. getBookmark: (type?: number, normalized?: boolean) => Bookmark;
  2089. moveToBookmark: (bookmark: Bookmark) => void;
  2090. select: (node: Node, content?: boolean) => Node;
  2091. isCollapsed: () => boolean;
  2092. isForward: () => boolean;
  2093. setNode: (elm: Element) => Element;
  2094. getNode: () => Element;
  2095. getSel: () => Selection | null;
  2096. setRng: (rng: Range, forward?: boolean) => void;
  2097. getRng: () => Range;
  2098. getStart: (real?: boolean) => Element;
  2099. getEnd: (real?: boolean) => Element;
  2100. getSelectedBlocks: (startElm?: Element, endElm?: Element) => Element[];
  2101. normalize: () => Range;
  2102. selectorChanged: (selector: string, callback: (active: boolean, args: {
  2103. node: Node;
  2104. selector: String;
  2105. parents: Element[];
  2106. }) => void) => EditorSelection;
  2107. selectorChangedWithUnbind: (selector: string, callback: (active: boolean, args: {
  2108. node: Node;
  2109. selector: String;
  2110. parents: Element[];
  2111. }) => void) => {
  2112. unbind: () => void;
  2113. };
  2114. getScrollContainer: () => HTMLElement;
  2115. scrollIntoView: (elm?: HTMLElement, alignToTop?: boolean) => void;
  2116. placeCaretAt: (clientX: number, clientY: number) => void;
  2117. getBoundingClientRect: () => ClientRect | DOMRect;
  2118. destroy: () => void;
  2119. }
  2120. declare type EditorCommandCallback = (ui: boolean, value: any) => void;
  2121. declare type EditorCommandsCallback = (command: string, ui: boolean, value: any) => void;
  2122. interface Commands {
  2123. state: Record<string, (command: string) => boolean>;
  2124. exec: Record<string, EditorCommandsCallback>;
  2125. value: Record<string, (command: string) => string>;
  2126. }
  2127. interface ExecCommandArgs {
  2128. skip_focus?: boolean;
  2129. }
  2130. interface EditorCommandsConstructor {
  2131. readonly prototype: EditorCommands;
  2132. new (editor: Editor): EditorCommands;
  2133. }
  2134. declare class EditorCommands {
  2135. private readonly editor;
  2136. private commands;
  2137. constructor(editor: Editor);
  2138. execCommand(command: string, ui?: boolean, value?: any, args?: ExecCommandArgs): boolean;
  2139. queryCommandState(command: string): boolean;
  2140. queryCommandValue(command: string): string;
  2141. addCommands<K extends keyof Commands>(commandList: Commands[K], type: K): void;
  2142. addCommands(commandList: Record<string, EditorCommandsCallback>): void;
  2143. addCommand(command: string, callback: EditorCommandCallback, scope?: any): void;
  2144. queryCommandSupported(command: string): boolean;
  2145. addQueryStateHandler(command: string, callback: () => boolean, scope?: any): void;
  2146. addQueryValueHandler(command: string, callback: () => string, scope?: any): void;
  2147. }
  2148. interface RawString {
  2149. raw: string;
  2150. }
  2151. declare type Primitive = string | number | boolean | Record<string | number, any> | Function;
  2152. declare type TokenisedString = [
  2153. string,
  2154. ...Primitive[]
  2155. ];
  2156. declare type Untranslated = Primitive | TokenisedString | RawString;
  2157. declare type TranslatedString = string;
  2158. interface I18n {
  2159. getData: () => Record<string, Record<string, string>>;
  2160. setCode: (newCode: string) => void;
  2161. getCode: () => string;
  2162. add: (code: string, items: Record<string, string>) => void;
  2163. translate: (text: Untranslated) => TranslatedString;
  2164. isRtl: () => boolean;
  2165. hasCode: (code: string) => boolean;
  2166. }
  2167. interface Observable<T> {
  2168. fire<K extends string, U extends MappedEvent<T, K>>(name: K, args?: U, bubble?: boolean): EditorEvent<U>;
  2169. dispatch<K extends string, U extends MappedEvent<T, K>>(name: K, args?: U, bubble?: boolean): EditorEvent<U>;
  2170. on<K extends string>(name: K, callback: (event: EditorEvent<MappedEvent<T, K>>) => void, prepend?: boolean): EventDispatcher<T>;
  2171. off<K extends string>(name?: K, callback?: (event: EditorEvent<MappedEvent<T, K>>) => void): EventDispatcher<T>;
  2172. once<K extends string>(name: K, callback: (event: EditorEvent<MappedEvent<T, K>>) => void): EventDispatcher<T>;
  2173. hasEventListeners(name: string): boolean;
  2174. }
  2175. interface URISettings {
  2176. base_uri?: URI;
  2177. }
  2178. interface URIConstructor {
  2179. readonly prototype: URI;
  2180. new (url: string, settings?: URISettings): URI;
  2181. getDocumentBaseUrl: (loc: {
  2182. protocol: string;
  2183. host?: string;
  2184. href?: string;
  2185. pathname?: string;
  2186. }) => string;
  2187. parseDataUri: (uri: string) => {
  2188. type: string;
  2189. data: string;
  2190. };
  2191. }
  2192. interface SafeUriOptions {
  2193. readonly allow_html_data_urls?: boolean;
  2194. readonly allow_script_urls?: boolean;
  2195. readonly allow_svg_data_urls?: boolean;
  2196. }
  2197. declare class URI {
  2198. static parseDataUri(uri: string): {
  2199. type: string;
  2200. data: string;
  2201. };
  2202. static isDomSafe(uri: string, context?: string, options?: SafeUriOptions): boolean;
  2203. static getDocumentBaseUrl(loc: {
  2204. protocol: string;
  2205. host?: string;
  2206. href?: string;
  2207. pathname?: string;
  2208. }): string;
  2209. source: string;
  2210. protocol: string;
  2211. authority: string;
  2212. userInfo: string;
  2213. user: string;
  2214. password: string;
  2215. host: string;
  2216. port: string;
  2217. relative: string;
  2218. path: string;
  2219. directory: string;
  2220. file: string;
  2221. query: string;
  2222. anchor: string;
  2223. settings: URISettings;
  2224. constructor(url: string, settings?: URISettings);
  2225. setPath(path: string): void;
  2226. toRelative(uri: string): string;
  2227. toAbsolute(uri: string, noHost?: boolean): string;
  2228. isSameOrigin(uri: URI): boolean;
  2229. toRelPath(base: string, path: string): string;
  2230. toAbsPath(base: string, path: string): string;
  2231. getURI(noProtoHost?: boolean): string;
  2232. }
  2233. interface EditorManager extends Observable<EditorManagerEventMap> {
  2234. defaultOptions: RawEditorOptions;
  2235. majorVersion: string;
  2236. minorVersion: string;
  2237. releaseDate: string;
  2238. activeEditor: Editor;
  2239. focusedEditor: Editor;
  2240. baseURI: URI;
  2241. baseURL: string;
  2242. documentBaseURL: string;
  2243. i18n: I18n;
  2244. suffix: string;
  2245. add(this: EditorManager, editor: Editor): Editor;
  2246. addI18n: (code: string, item: Record<string, string>) => void;
  2247. createEditor(this: EditorManager, id: string, options: RawEditorOptions): Editor;
  2248. execCommand(this: EditorManager, cmd: string, ui: boolean, value: any): boolean;
  2249. get(this: EditorManager): Editor[];
  2250. get(this: EditorManager, id: number | string): Editor;
  2251. init(this: EditorManager, options: RawEditorOptions): Promise<Editor[]>;
  2252. overrideDefaults(this: EditorManager, defaultOptions: Partial<RawEditorOptions>): void;
  2253. remove(this: EditorManager): void;
  2254. remove(this: EditorManager, selector: string | Editor): Editor | void;
  2255. setActive(this: EditorManager, editor: Editor): void;
  2256. setup(this: EditorManager): void;
  2257. translate: (text: Untranslated) => TranslatedString;
  2258. triggerSave: () => void;
  2259. _setBaseUrl(this: EditorManager, baseUrl: string): void;
  2260. }
  2261. interface EditorObservable extends Observable<EditorEventMap> {
  2262. bindPendingEventDelegates(this: Editor): void;
  2263. toggleNativeEvent(this: Editor, name: string, state: boolean): any;
  2264. unbindAllNativeEvents(this: Editor): void;
  2265. }
  2266. interface ProcessorSuccess<T> {
  2267. valid: true;
  2268. value: T;
  2269. }
  2270. interface ProcessorError {
  2271. valid: false;
  2272. message: string;
  2273. }
  2274. declare type SimpleProcessor = (value: unknown) => boolean;
  2275. declare type Processor<T> = (value: unknown) => ProcessorSuccess<T> | ProcessorError;
  2276. interface BuiltInOptionTypeMap {
  2277. 'string': string;
  2278. 'number': number;
  2279. 'boolean': boolean;
  2280. 'array': any[];
  2281. 'function': Function;
  2282. 'object': any;
  2283. 'string[]': string[];
  2284. 'object[]': any[];
  2285. 'regexp': RegExp;
  2286. }
  2287. declare type BuiltInOptionType = keyof BuiltInOptionTypeMap;
  2288. interface BaseOptionSpec {
  2289. immutable?: boolean;
  2290. deprecated?: boolean;
  2291. docsUrl?: string;
  2292. }
  2293. interface BuiltInOptionSpec<K extends BuiltInOptionType> extends BaseOptionSpec {
  2294. processor: K;
  2295. default?: BuiltInOptionTypeMap[K];
  2296. }
  2297. interface SimpleOptionSpec<T> extends BaseOptionSpec {
  2298. processor: SimpleProcessor;
  2299. default?: T;
  2300. }
  2301. interface OptionSpec<T, U> extends BaseOptionSpec {
  2302. processor: Processor<U>;
  2303. default?: T;
  2304. }
  2305. interface Options {
  2306. register: {
  2307. <K extends BuiltInOptionType>(name: string, spec: BuiltInOptionSpec<K>): void;
  2308. <K extends keyof NormalizedEditorOptions>(name: K, spec: OptionSpec<NormalizedEditorOptions[K], EditorOptions[K]> | SimpleOptionSpec<NormalizedEditorOptions[K]>): void;
  2309. <T, U>(name: string, spec: OptionSpec<T, U>): void;
  2310. <T>(name: string, spec: SimpleOptionSpec<T>): void;
  2311. };
  2312. isRegistered: (name: string) => boolean;
  2313. get: {
  2314. <K extends keyof EditorOptions>(name: K): EditorOptions[K] | undefined;
  2315. <T>(name: string): T | undefined;
  2316. };
  2317. set: <K extends string, T>(name: K, value: K extends keyof NormalizedEditorOptions ? NormalizedEditorOptions[K] : T) => boolean;
  2318. unset: (name: string) => boolean;
  2319. isSet: (name: string) => boolean;
  2320. }
  2321. interface UploadResult$1 {
  2322. element: HTMLImageElement;
  2323. status: boolean;
  2324. blobInfo: BlobInfo;
  2325. uploadUri: string;
  2326. removed: boolean;
  2327. }
  2328. interface EditorUpload {
  2329. blobCache: BlobCache;
  2330. addFilter: (filter: (img: HTMLImageElement) => boolean) => void;
  2331. uploadImages: () => Promise<UploadResult$1[]>;
  2332. uploadImagesAuto: () => Promise<UploadResult$1[]>;
  2333. scanForImages: () => Promise<BlobInfoImagePair[]>;
  2334. destroy: () => void;
  2335. }
  2336. declare type FormatChangeCallback = (state: boolean, data: {
  2337. node: Node;
  2338. format: string;
  2339. parents: any;
  2340. }) => void;
  2341. interface FormatRegistry {
  2342. get: {
  2343. (name: string): Format[] | undefined;
  2344. (): Record<string, Format[]>;
  2345. };
  2346. has: (name: string) => boolean;
  2347. register: (name: string | Formats, format?: Format[] | Format) => void;
  2348. unregister: (name: string) => Formats;
  2349. }
  2350. interface Formatter extends FormatRegistry {
  2351. apply: (name: string, vars?: FormatVars, node?: Node | RangeLikeObject) => void;
  2352. remove: (name: string, vars?: FormatVars, node?: Node | Range, similar?: boolean) => void;
  2353. toggle: (name: string, vars?: FormatVars, node?: Node) => void;
  2354. match: (name: string, vars?: FormatVars, node?: Node, similar?: boolean) => boolean;
  2355. closest: (names: string[]) => string | null;
  2356. matchAll: (names: string[], vars?: FormatVars) => string[];
  2357. matchNode: (node: Node, name: string, vars?: FormatVars, similar?: boolean) => Format | undefined;
  2358. canApply: (name: string) => boolean;
  2359. formatChanged: (names: string, callback: FormatChangeCallback, similar?: boolean, vars?: FormatVars) => {
  2360. unbind: () => void;
  2361. };
  2362. getCssText: (format: string | Format) => string;
  2363. }
  2364. interface EditorMode {
  2365. isReadOnly: () => boolean;
  2366. set: (mode: string) => void;
  2367. get: () => string;
  2368. register: (mode: string, api: EditorModeApi) => void;
  2369. }
  2370. interface EditorModeApi {
  2371. activate: () => void;
  2372. deactivate: () => void;
  2373. editorReadOnly: boolean;
  2374. }
  2375. interface Model {
  2376. readonly table: {
  2377. readonly getSelectedCells: () => HTMLTableCellElement[];
  2378. readonly clearSelectedCells: (container: Node) => void;
  2379. };
  2380. }
  2381. declare type ModelManager = AddOnManager<Model>;
  2382. interface Plugin {
  2383. getMetadata?: () => {
  2384. name: string;
  2385. url: string;
  2386. };
  2387. init?: (editor: Editor, url: string) => void;
  2388. [key: string]: any;
  2389. }
  2390. declare type PluginManager = AddOnManager<void | Plugin>;
  2391. interface ShortcutsConstructor {
  2392. readonly prototype: Shortcuts;
  2393. new (editor: Editor): Shortcuts;
  2394. }
  2395. declare type CommandFunc = string | [
  2396. string,
  2397. boolean,
  2398. any
  2399. ] | (() => void);
  2400. declare class Shortcuts {
  2401. private readonly editor;
  2402. private readonly shortcuts;
  2403. private pendingPatterns;
  2404. constructor(editor: Editor);
  2405. add(pattern: string, desc: string, cmdFunc: CommandFunc, scope?: any): boolean;
  2406. remove(pattern: string): boolean;
  2407. private normalizeCommandFunc;
  2408. private createShortcut;
  2409. private hasModifier;
  2410. private isFunctionKey;
  2411. private matchShortcut;
  2412. private executeShortcutAction;
  2413. }
  2414. interface Theme {
  2415. ui?: any;
  2416. inline?: any;
  2417. execCommand?: (command: string, ui?: boolean, value?: any) => boolean;
  2418. destroy?: () => void;
  2419. init?: (editor: Editor, url: string) => void;
  2420. renderUI?: () => {
  2421. iframeContainer?: HTMLIFrameElement;
  2422. editorContainer: HTMLElement;
  2423. api?: Partial<EditorUiApi>;
  2424. };
  2425. getNotificationManagerImpl?: () => NotificationManagerImpl;
  2426. getWindowManagerImpl?: () => WindowManagerImpl;
  2427. }
  2428. declare type ThemeManager = AddOnManager<void | Theme>;
  2429. interface EditorConstructor {
  2430. readonly prototype: Editor;
  2431. new (id: string, options: RawEditorOptions, editorManager: EditorManager): Editor;
  2432. }
  2433. declare class Editor implements EditorObservable {
  2434. documentBaseUrl: string;
  2435. baseUri: URI;
  2436. id: string;
  2437. plugins: Record<string, Plugin>;
  2438. documentBaseURI: URI;
  2439. baseURI: URI;
  2440. contentCSS: string[];
  2441. contentStyles: string[];
  2442. ui: EditorUi;
  2443. mode: EditorMode;
  2444. options: Options;
  2445. shortcuts: Shortcuts;
  2446. loadedCSS: Record<string, any>;
  2447. editorCommands: EditorCommands;
  2448. suffix: string;
  2449. editorManager: EditorManager;
  2450. inline: boolean;
  2451. isNotDirty: boolean;
  2452. annotator: Annotator;
  2453. bodyElement: HTMLElement;
  2454. bookmark: any;
  2455. composing: boolean;
  2456. container: HTMLElement;
  2457. contentAreaContainer: HTMLElement;
  2458. contentDocument: Document;
  2459. contentWindow: Window;
  2460. delegates: Record<string, (event: any) => void>;
  2461. destroyed: boolean;
  2462. dom: DOMUtils;
  2463. editorContainer: HTMLElement;
  2464. editorUpload: EditorUpload;
  2465. eventRoot?: Element;
  2466. formatter: Formatter;
  2467. formElement: HTMLElement;
  2468. formEventDelegate: (e: Event) => void;
  2469. hasHiddenInput: boolean;
  2470. hasVisual: boolean;
  2471. hidden: boolean;
  2472. iframeElement: HTMLIFrameElement | null;
  2473. iframeHTML: string;
  2474. initialized: boolean;
  2475. notificationManager: NotificationManager;
  2476. orgDisplay: string;
  2477. orgVisibility: string;
  2478. parser: DomParser;
  2479. quirks: Quirks;
  2480. readonly: boolean;
  2481. removed: boolean;
  2482. schema: Schema;
  2483. selection: EditorSelection;
  2484. serializer: DomSerializer;
  2485. startContent: string;
  2486. targetElm: HTMLElement;
  2487. theme: Theme;
  2488. model: Model;
  2489. undoManager: UndoManager;
  2490. windowManager: WindowManager;
  2491. _beforeUnload: () => void;
  2492. _eventDispatcher: EventDispatcher<NativeEventMap>;
  2493. _nodeChangeDispatcher: NodeChange;
  2494. _pendingNativeEvents: string[];
  2495. _selectionOverrides: SelectionOverrides;
  2496. _skinLoaded: boolean;
  2497. bindPendingEventDelegates: EditorObservable['bindPendingEventDelegates'];
  2498. toggleNativeEvent: EditorObservable['toggleNativeEvent'];
  2499. unbindAllNativeEvents: EditorObservable['unbindAllNativeEvents'];
  2500. fire: EditorObservable['fire'];
  2501. dispatch: EditorObservable['dispatch'];
  2502. on: EditorObservable['on'];
  2503. off: EditorObservable['off'];
  2504. once: EditorObservable['once'];
  2505. hasEventListeners: EditorObservable['hasEventListeners'];
  2506. constructor(id: string, options: RawEditorOptions, editorManager: EditorManager);
  2507. render(): void;
  2508. focus(skipFocus?: boolean): void;
  2509. hasFocus(): boolean;
  2510. translate(text: Untranslated): TranslatedString;
  2511. getParam<K extends BuiltInOptionType>(name: string, defaultVal: BuiltInOptionTypeMap[K], type: K): BuiltInOptionTypeMap[K];
  2512. getParam<K extends keyof NormalizedEditorOptions>(name: K, defaultVal?: NormalizedEditorOptions[K], type?: BuiltInOptionType): NormalizedEditorOptions[K];
  2513. getParam<T>(name: string, defaultVal: T, type?: BuiltInOptionType): T;
  2514. hasPlugin(name: string, loaded?: boolean): boolean;
  2515. nodeChanged(args?: any): void;
  2516. addCommand(name: string, callback: EditorCommandCallback, scope?: object): void;
  2517. addQueryStateHandler(name: string, callback: () => boolean, scope?: any): void;
  2518. addQueryValueHandler(name: string, callback: () => string, scope?: any): void;
  2519. addShortcut(pattern: string, desc: string, cmdFunc: string | [
  2520. string,
  2521. boolean,
  2522. any
  2523. ] | (() => void), scope?: any): void;
  2524. execCommand(cmd: string, ui?: boolean, value?: any, args?: ExecCommandArgs): boolean;
  2525. queryCommandState(cmd: string): boolean;
  2526. queryCommandValue(cmd: string): string;
  2527. queryCommandSupported(cmd: string): boolean;
  2528. show(): void;
  2529. hide(): void;
  2530. isHidden(): boolean;
  2531. setProgressState(state: boolean, time?: number): void;
  2532. load(args?: any): string;
  2533. save(args?: any): string;
  2534. setContent(content: string, args?: Partial<SetContentArgs>): string;
  2535. setContent(content: AstNode, args?: Partial<SetContentArgs>): AstNode;
  2536. setContent(content: Content, args?: Partial<SetContentArgs>): Content;
  2537. getContent(args: {
  2538. format: 'tree';
  2539. } & Partial<GetContentArgs>): AstNode;
  2540. getContent(args?: Partial<GetContentArgs>): string;
  2541. insertContent(content: string, args?: any): void;
  2542. resetContent(initialContent?: string): void;
  2543. isDirty(): boolean;
  2544. setDirty(state: boolean): void;
  2545. getContainer(): HTMLElement;
  2546. getContentAreaContainer(): HTMLElement;
  2547. getElement(): HTMLElement;
  2548. getWin(): Window;
  2549. getDoc(): Document;
  2550. getBody(): HTMLElement;
  2551. convertURL(url: string, name: string, elm?: any): string;
  2552. addVisual(elm?: HTMLElement): void;
  2553. remove(): void;
  2554. destroy(automatic?: boolean): void;
  2555. uploadImages(): Promise<UploadResult$1[]>;
  2556. _scanForImages(): Promise<BlobInfoImagePair[]>;
  2557. }
  2558. interface UrlObject {
  2559. prefix: string;
  2560. resource: string;
  2561. suffix: string;
  2562. }
  2563. declare type WaitState = 'added' | 'loaded';
  2564. declare type AddOnConstructor<T> = (editor: Editor, url: string) => T;
  2565. interface AddOnManager<T> {
  2566. items: AddOnConstructor<T>[];
  2567. urls: Record<string, string>;
  2568. lookup: Record<string, {
  2569. instance: AddOnConstructor<T>;
  2570. }>;
  2571. get: (name: string) => AddOnConstructor<T>;
  2572. requireLangPack: (name: string, languages: string) => void;
  2573. add: (id: string, addOn: AddOnConstructor<T>) => AddOnConstructor<T>;
  2574. remove: (name: string) => void;
  2575. createUrl: (baseUrl: UrlObject, dep: string | UrlObject) => UrlObject;
  2576. load: (name: string, addOnUrl: string | UrlObject) => Promise<void>;
  2577. waitFor: (name: string, state?: WaitState) => Promise<void>;
  2578. }
  2579. interface RangeUtils {
  2580. walk: (rng: Range, callback: (nodes: Node[]) => void) => void;
  2581. split: (rng: Range) => RangeLikeObject;
  2582. normalize: (rng: Range) => boolean;
  2583. }
  2584. interface ScriptLoaderSettings {
  2585. referrerPolicy?: ReferrerPolicy;
  2586. }
  2587. interface ScriptLoaderConstructor {
  2588. readonly prototype: ScriptLoader;
  2589. new (): ScriptLoader;
  2590. ScriptLoader: ScriptLoader;
  2591. }
  2592. declare class ScriptLoader {
  2593. static ScriptLoader: ScriptLoader;
  2594. private settings;
  2595. private states;
  2596. private queue;
  2597. private scriptLoadedCallbacks;
  2598. private queueLoadedCallbacks;
  2599. private loading;
  2600. constructor(settings?: ScriptLoaderSettings);
  2601. _setReferrerPolicy(referrerPolicy: ReferrerPolicy): void;
  2602. loadScript(url: string): Promise<void>;
  2603. isDone(url: string): boolean;
  2604. markDone(url: string): void;
  2605. add(url: string): Promise<void>;
  2606. load(url: string): Promise<void>;
  2607. remove(url: string): void;
  2608. loadQueue(): Promise<void>;
  2609. loadScripts(scripts: string[]): Promise<void>;
  2610. }
  2611. declare type TextProcessCallback = (node: Text, offset: number, text: string) => number;
  2612. interface Spot {
  2613. container: Text;
  2614. offset: number;
  2615. }
  2616. interface TextSeeker {
  2617. backwards: (node: Node, offset: number, process: TextProcessCallback, root?: Node) => Spot | null;
  2618. forwards: (node: Node, offset: number, process: TextProcessCallback, root?: Node) => Spot | null;
  2619. }
  2620. interface DomTreeWalkerConstructor {
  2621. readonly prototype: DomTreeWalker;
  2622. new (startNode: Node, rootNode: Node): DomTreeWalker;
  2623. }
  2624. declare class DomTreeWalker {
  2625. private readonly rootNode;
  2626. private node;
  2627. constructor(startNode: Node, rootNode: Node);
  2628. current(): Node;
  2629. next(shallow?: boolean): Node;
  2630. prev(shallow?: boolean): Node;
  2631. prev2(shallow?: boolean): Node;
  2632. private findSibling;
  2633. private findPreviousNode;
  2634. }
  2635. interface Version {
  2636. major: number;
  2637. minor: number;
  2638. }
  2639. interface Env {
  2640. transparentSrc: string;
  2641. documentMode: number;
  2642. cacheSuffix: any;
  2643. container: any;
  2644. canHaveCSP: boolean;
  2645. windowsPhone: boolean;
  2646. browser: {
  2647. current: string | undefined;
  2648. version: Version;
  2649. isEdge: () => boolean;
  2650. isChromium: () => boolean;
  2651. isIE: () => boolean;
  2652. isOpera: () => boolean;
  2653. isFirefox: () => boolean;
  2654. isSafari: () => boolean;
  2655. };
  2656. os: {
  2657. current: string | undefined;
  2658. version: Version;
  2659. isWindows: () => boolean;
  2660. isiOS: () => boolean;
  2661. isAndroid: () => boolean;
  2662. isMacOS: () => boolean;
  2663. isLinux: () => boolean;
  2664. isSolaris: () => boolean;
  2665. isFreeBSD: () => boolean;
  2666. isChromeOS: () => boolean;
  2667. };
  2668. deviceType: {
  2669. isiPad: () => boolean;
  2670. isiPhone: () => boolean;
  2671. isTablet: () => boolean;
  2672. isPhone: () => boolean;
  2673. isTouch: () => boolean;
  2674. isWebView: () => boolean;
  2675. isDesktop: () => boolean;
  2676. };
  2677. }
  2678. interface FakeClipboardItem {
  2679. readonly items: Record<string, any>;
  2680. readonly types: ReadonlyArray<string>;
  2681. readonly getType: <D = any>(type: string) => D | undefined;
  2682. }
  2683. interface FakeClipboard {
  2684. readonly FakeClipboardItem: (items: Record<string, any>) => FakeClipboardItem;
  2685. readonly write: (data: FakeClipboardItem[]) => void;
  2686. readonly read: () => FakeClipboardItem[] | undefined;
  2687. readonly clear: () => void;
  2688. }
  2689. interface FocusManager {
  2690. isEditorUIElement: (elm: Element) => boolean;
  2691. }
  2692. interface EntitiesMap {
  2693. [name: string]: string;
  2694. }
  2695. interface Entities {
  2696. encodeRaw: (text: string, attr?: boolean) => string;
  2697. encodeAllRaw: (text: string) => string;
  2698. encodeNumeric: (text: string, attr?: boolean) => string;
  2699. encodeNamed: (text: string, attr?: boolean, entities?: EntitiesMap) => string;
  2700. getEncodeFunc: (name: string, entities?: EntitiesMap | string) => (text: string, attr?: boolean) => string;
  2701. decode: (text: string) => string;
  2702. }
  2703. interface IconPack {
  2704. icons: Record<string, string>;
  2705. }
  2706. interface IconManager {
  2707. add: (id: string, iconPack: IconPack) => void;
  2708. get: (id: string) => IconPack;
  2709. has: (id: string) => boolean;
  2710. }
  2711. interface Resource {
  2712. load: <T = any>(id: string, url: string) => Promise<T>;
  2713. add: (id: string, data: any) => void;
  2714. unload: (id: string) => void;
  2715. }
  2716. interface Delay {
  2717. setEditorInterval: (editor: Editor, callback: () => void, time?: number) => number;
  2718. setEditorTimeout: (editor: Editor, callback: () => void, time?: number) => number;
  2719. }
  2720. declare type UploadResult = UploadResult$2;
  2721. interface ImageUploader {
  2722. upload: (blobInfos: BlobInfo[], showNotification?: boolean) => Promise<UploadResult[]>;
  2723. }
  2724. declare type ArrayCallback$1<T, R> = (x: T, i: number, xs: ReadonlyArray<T>) => R;
  2725. declare type ObjCallback$1<T, R> = (value: T, key: string, obj: Record<string, T>) => R;
  2726. declare type ArrayCallback<T, R> = ArrayCallback$1<T, R>;
  2727. declare type ObjCallback<T, R> = ObjCallback$1<T, R>;
  2728. interface Tools {
  2729. is: (obj: any, type: string) => boolean;
  2730. isArray: <T>(arr: any) => arr is Array<T>;
  2731. inArray: <T>(arr: ArrayLike<T>, value: T) => number;
  2732. grep: {
  2733. <T>(arr: ArrayLike<T> | null | undefined, pred?: ArrayCallback<T, boolean>): T[];
  2734. <T>(arr: Record<string, T> | null | undefined, pred?: ObjCallback<T, boolean>): T[];
  2735. };
  2736. trim: (str: string | null | undefined) => string;
  2737. toArray: <T>(obj: ArrayLike<T>) => T[];
  2738. hasOwn: (obj: any, name: string) => boolean;
  2739. makeMap: <T>(items: ArrayLike<T> | string, delim?: string | RegExp, map?: Record<string, T | string>) => Record<string, T | string>;
  2740. each: {
  2741. <T>(arr: ArrayLike<T> | null | undefined, cb: ArrayCallback<T, void | boolean>, scope?: any): boolean;
  2742. <T>(obj: Record<string, T> | null | undefined, cb: ObjCallback<T, void | boolean>, scope?: any): boolean;
  2743. };
  2744. map: {
  2745. <T, R>(arr: ArrayLike<T> | null | undefined, cb: ArrayCallback<T, R>): R[];
  2746. <T, R>(obj: Record<string, T> | null | undefined, cb: ObjCallback<T, R>): R[];
  2747. };
  2748. extend: (obj: Object, ext: Object, ...objs: Object[]) => any;
  2749. walk: <T = any>(obj: T, f: Function, n?: keyof T, scope?: any) => void;
  2750. resolve: (path: string, o?: Object) => any;
  2751. explode: (s: string, d?: string | RegExp) => string[];
  2752. _addCacheSuffix: (url: string) => string;
  2753. }
  2754. interface KeyboardLikeEvent {
  2755. shiftKey: boolean;
  2756. ctrlKey: boolean;
  2757. altKey: boolean;
  2758. metaKey: boolean;
  2759. }
  2760. interface VK {
  2761. BACKSPACE: number;
  2762. DELETE: number;
  2763. DOWN: number;
  2764. ENTER: number;
  2765. ESC: number;
  2766. LEFT: number;
  2767. RIGHT: number;
  2768. SPACEBAR: number;
  2769. TAB: number;
  2770. UP: number;
  2771. PAGE_UP: number;
  2772. PAGE_DOWN: number;
  2773. END: number;
  2774. HOME: number;
  2775. modifierPressed: (e: KeyboardLikeEvent) => boolean;
  2776. metaKeyPressed: (e: KeyboardLikeEvent) => boolean;
  2777. }
  2778. interface DOMUtilsNamespace {
  2779. (doc: Document, settings: Partial<DOMUtilsSettings>): DOMUtils;
  2780. DOM: DOMUtils;
  2781. nodeIndex: (node: Node, normalized?: boolean) => number;
  2782. }
  2783. interface RangeUtilsNamespace {
  2784. (dom: DOMUtils): RangeUtils;
  2785. compareRanges: (rng1: RangeLikeObject, rng2: RangeLikeObject) => boolean;
  2786. getCaretRangeFromPoint: (clientX: number, clientY: number, doc: Document) => Range;
  2787. getSelectedNode: (range: Range) => Node;
  2788. getNode: (container: Node, offset: number) => Node;
  2789. }
  2790. interface AddOnManagerNamespace {
  2791. <T>(): AddOnManager<T>;
  2792. language: string | undefined;
  2793. languageLoad: boolean;
  2794. baseURL: string;
  2795. PluginManager: PluginManager;
  2796. ThemeManager: ThemeManager;
  2797. ModelManager: ModelManager;
  2798. }
  2799. interface BookmarkManagerNamespace {
  2800. (selection: EditorSelection): BookmarkManager;
  2801. isBookmarkNode: (node: Node) => boolean;
  2802. }
  2803. interface TinyMCE extends EditorManager {
  2804. geom: {
  2805. Rect: Rect;
  2806. };
  2807. util: {
  2808. Delay: Delay;
  2809. Tools: Tools;
  2810. VK: VK;
  2811. URI: URIConstructor;
  2812. EventDispatcher: EventDispatcherConstructor<any>;
  2813. Observable: Observable<any>;
  2814. I18n: I18n;
  2815. LocalStorage: Storage;
  2816. ImageUploader: ImageUploader;
  2817. };
  2818. dom: {
  2819. EventUtils: EventUtilsConstructor;
  2820. TreeWalker: DomTreeWalkerConstructor;
  2821. TextSeeker: (dom: DOMUtils, isBlockBoundary?: (node: Node) => boolean) => TextSeeker;
  2822. DOMUtils: DOMUtilsNamespace;
  2823. ScriptLoader: ScriptLoaderConstructor;
  2824. RangeUtils: RangeUtilsNamespace;
  2825. Serializer: (settings: DomSerializerSettings, editor?: Editor) => DomSerializer;
  2826. ControlSelection: (selection: EditorSelection, editor: Editor) => ControlSelection;
  2827. BookmarkManager: BookmarkManagerNamespace;
  2828. Selection: (dom: DOMUtils, win: Window, serializer: DomSerializer, editor: Editor) => EditorSelection;
  2829. StyleSheetLoader: (documentOrShadowRoot: Document | ShadowRoot, settings: StyleSheetLoaderSettings) => StyleSheetLoader;
  2830. Event: EventUtils;
  2831. };
  2832. html: {
  2833. Styles: (settings?: StylesSettings, schema?: Schema) => Styles;
  2834. Entities: Entities;
  2835. Node: AstNodeConstructor;
  2836. Schema: (settings?: SchemaSettings) => Schema;
  2837. DomParser: (settings?: DomParserSettings, schema?: Schema) => DomParser;
  2838. Writer: (settings?: WriterSettings) => Writer;
  2839. Serializer: (settings?: HtmlSerializerSettings, schema?: Schema) => HtmlSerializer;
  2840. };
  2841. AddOnManager: AddOnManagerNamespace;
  2842. Annotator: (editor: Editor) => Annotator;
  2843. Editor: EditorConstructor;
  2844. EditorCommands: EditorCommandsConstructor;
  2845. EditorManager: EditorManager;
  2846. EditorObservable: EditorObservable;
  2847. Env: Env;
  2848. FocusManager: FocusManager;
  2849. Formatter: (editor: Editor) => Formatter;
  2850. NotificationManager: (editor: Editor) => NotificationManager;
  2851. Shortcuts: ShortcutsConstructor;
  2852. UndoManager: (editor: Editor) => UndoManager;
  2853. WindowManager: (editor: Editor) => WindowManager;
  2854. DOM: DOMUtils;
  2855. ScriptLoader: ScriptLoader;
  2856. PluginManager: PluginManager;
  2857. ThemeManager: ThemeManager;
  2858. ModelManager: ModelManager;
  2859. IconManager: IconManager;
  2860. Resource: Resource;
  2861. FakeClipboard: FakeClipboard;
  2862. trim: Tools['trim'];
  2863. isArray: Tools['isArray'];
  2864. is: Tools['is'];
  2865. toArray: Tools['toArray'];
  2866. makeMap: Tools['makeMap'];
  2867. each: Tools['each'];
  2868. map: Tools['map'];
  2869. grep: Tools['grep'];
  2870. inArray: Tools['inArray'];
  2871. extend: Tools['extend'];
  2872. walk: Tools['walk'];
  2873. resolve: Tools['resolve'];
  2874. explode: Tools['explode'];
  2875. _addCacheSuffix: Tools['_addCacheSuffix'];
  2876. }
  2877. declare const tinymce: TinyMCE;
  2878. export { AddOnManager, Annotator, AstNode, Bookmark, BookmarkManager, ControlSelection, DOMUtils, Delay, DomParser, DomParserSettings, DomSerializer, DomSerializerSettings, DomTreeWalker, Editor, EditorCommands, EditorEvent, EditorManager, EditorModeApi, EditorObservable, EditorOptions, EditorSelection, Entities, Env, EventDispatcher, EventUtils, EventTypes_d as Events, FakeClipboard, FocusManager, Format_d as Formats, Formatter, GeomRect, HtmlSerializer, HtmlSerializerSettings, I18n, IconManager, Model, ModelManager, NotificationApi, NotificationManager, NotificationSpec, Observable, Plugin, PluginManager, RangeUtils, RawEditorOptions, Rect, Resource, Schema, SchemaSettings, ScriptLoader, Shortcuts, StyleSheetLoader, Styles, TextSeeker, Theme, ThemeManager, TinyMCE, Tools, URI, Ui_d as Ui, UndoManager, VK, WindowManager, Writer, WriterSettings, tinymce as default };