@ebl-vue/editor-full 2.31.35 → 2.31.36

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (97) hide show
  1. package/.postcssrc.yml +33 -0
  2. package/dist/index.d.ts +3 -7
  3. package/dist/index.mjs +183 -182
  4. package/dist/index.mjs.map +1 -0
  5. package/package.json +1 -1
  6. package/postcss.config.js +15 -0
  7. package/src/components/Editor/Editor.vue +293 -0
  8. package/src/components/index.ts +27 -0
  9. package/src/constants/index.ts +1 -0
  10. package/src/i18n/zh-cn.ts +160 -0
  11. package/src/icons/index.ts +93 -0
  12. package/src/index.ts +21 -0
  13. package/src/installer.ts +21 -0
  14. package/src/plugins/alert/index.ts +455 -0
  15. package/src/plugins/block-alignment/index.ts +117 -0
  16. package/src/plugins/block-alignment/readme.md +1 -0
  17. package/src/plugins/code/LICENSE +21 -0
  18. package/src/plugins/code/index.ts +619 -0
  19. package/src/plugins/code/utils/string.ts +34 -0
  20. package/src/plugins/color-picker/index.ts +132 -0
  21. package/src/plugins/delimiter/index.ts +121 -0
  22. package/src/plugins/drag-drop/index.css +19 -0
  23. package/src/plugins/drag-drop/index.ts +151 -0
  24. package/src/plugins/drag-drop/readme.md +1 -0
  25. package/src/plugins/header/H1.ts +404 -0
  26. package/src/plugins/header/H2.ts +403 -0
  27. package/src/plugins/header/H3.ts +404 -0
  28. package/src/plugins/header/H4.ts +404 -0
  29. package/src/plugins/header/H5.ts +403 -0
  30. package/src/plugins/header/H6.ts +404 -0
  31. package/src/plugins/header/index.ts +15 -0
  32. package/src/plugins/header/types.d.ts +46 -0
  33. package/src/plugins/imageResizeCrop/ImageTune.ts +635 -0
  34. package/src/plugins/imageResizeCrop/index.css +230 -0
  35. package/src/plugins/imageResizeCrop/index.ts +5 -0
  36. package/src/plugins/imageResizeCrop/types.d.ts +23 -0
  37. package/src/plugins/imageTool/index.ts +510 -0
  38. package/src/plugins/imageTool/types/codexteam__ajax.d.ts +89 -0
  39. package/src/plugins/imageTool/types/types.ts +236 -0
  40. package/src/plugins/imageTool/ui.ts +313 -0
  41. package/src/plugins/imageTool/uploader.ts +287 -0
  42. package/src/plugins/imageTool/utils/dom.ts +24 -0
  43. package/src/plugins/imageTool/utils/index.ts +73 -0
  44. package/src/plugins/imageTool/utils/isPromise.ts +10 -0
  45. package/src/plugins/indent/index.ts +695 -0
  46. package/src/plugins/inline-code/index.ts +203 -0
  47. package/src/plugins/list/ListRenderer/ChecklistRenderer.ts +208 -0
  48. package/src/plugins/list/ListRenderer/ListRenderer.ts +73 -0
  49. package/src/plugins/list/ListRenderer/OrderedListRenderer.ts +123 -0
  50. package/src/plugins/list/ListRenderer/UnorderedListRenderer.ts +123 -0
  51. package/src/plugins/list/ListRenderer/index.ts +6 -0
  52. package/src/plugins/list/ListTabulator/index.ts +1179 -0
  53. package/src/plugins/list/index.ts +488 -0
  54. package/src/plugins/list/styles/CssPrefix.ts +4 -0
  55. package/src/plugins/list/types/Elements.ts +14 -0
  56. package/src/plugins/list/types/ItemMeta.ts +40 -0
  57. package/src/plugins/list/types/ListParams.ts +102 -0
  58. package/src/plugins/list/types/ListRenderer.ts +6 -0
  59. package/src/plugins/list/types/OlCounterType.ts +63 -0
  60. package/src/plugins/list/types/index.ts +14 -0
  61. package/src/plugins/list/utils/focusItem.ts +18 -0
  62. package/src/plugins/list/utils/getChildItems.ts +40 -0
  63. package/src/plugins/list/utils/getItemChildWrapper.ts +10 -0
  64. package/src/plugins/list/utils/getItemContentElement.ts +10 -0
  65. package/src/plugins/list/utils/getSiblings.ts +52 -0
  66. package/src/plugins/list/utils/isLastItem.ts +9 -0
  67. package/src/plugins/list/utils/itemHasSublist.ts +10 -0
  68. package/src/plugins/list/utils/normalizeData.ts +83 -0
  69. package/src/plugins/list/utils/removeChildWrapperIfEmpty.ts +31 -0
  70. package/src/plugins/list/utils/renderToolboxInput.ts +113 -0
  71. package/src/plugins/list/utils/stripNumbers.ts +7 -0
  72. package/src/plugins/list/utils/type-guards.ts +8 -0
  73. package/src/plugins/marker/index.ts +199 -0
  74. package/src/plugins/outline/index.ts +62 -0
  75. package/src/plugins/outline/outline.css +52 -0
  76. package/src/plugins/paragraph/index.ts +384 -0
  77. package/src/plugins/paragraph/types/icons.d.ts +4 -0
  78. package/src/plugins/paragraph/utils/makeFragment.ts +17 -0
  79. package/src/plugins/quote/index.ts +203 -0
  80. package/src/plugins/table/index.ts +4 -0
  81. package/src/plugins/table/plugin.ts +255 -0
  82. package/src/plugins/table/table.ts +1202 -0
  83. package/src/plugins/table/toolbox.ts +166 -0
  84. package/src/plugins/table/utils/dom.ts +130 -0
  85. package/src/plugins/table/utils/popover.ts +185 -0
  86. package/src/plugins/table/utils/throttled.ts +22 -0
  87. package/src/plugins/underline/index.ts +214 -0
  88. package/src/plugins/undo/index.ts +526 -0
  89. package/src/plugins/undo/observer.ts +101 -0
  90. package/src/plugins/undo/vanilla-caret-js.ts +102 -0
  91. package/src/style.css +139 -0
  92. package/src/types.ts +3 -0
  93. package/src/utils/AxiosService.ts +87 -0
  94. package/src/utils/index.ts +15 -0
  95. package/src/utils/install.ts +19 -0
  96. package/tsconfig.json +37 -0
  97. package/vite.config.ts +81 -0
@@ -0,0 +1,510 @@
1
+
2
+
3
+ import type { TunesMenuConfig } from '@ebl-vue/editorjs/types/tools';
4
+ import type { API, ToolboxConfig, PasteConfig, BlockToolConstructorOptions, BlockTool, BlockAPI, PasteEvent, FilePasteEventDetail } from '@ebl-vue/editorjs/types';
5
+ import '@ebl-vue/editor-render/styles/image.css';
6
+
7
+ import Ui from './ui';
8
+ import Uploader from './uploader';
9
+
10
+ import { IconAddBorder, IconStretch, IconAddBackground, IconPicture, IconText } from '../../icons';
11
+ import type { ActionConfig, UploadResponseFormat, ImageToolData, ImageConfig, HTMLPasteEventDetailExtended, ImageSetterParam, FeaturesConfig } from './types/types';
12
+
13
+ type ImageToolConstructorOptions = BlockToolConstructorOptions<ImageToolData, ImageConfig>;
14
+
15
+ /**
16
+ * Implementation of ImageTool class
17
+ */
18
+ export default class ImageTool implements BlockTool {
19
+ /**
20
+ * Editor.js API instance
21
+ */
22
+ private api: API;
23
+
24
+ /**
25
+ * Current Block API instance
26
+ */
27
+ private block: BlockAPI;
28
+
29
+ /**
30
+ * Configuration for the ImageTool
31
+ */
32
+ private config: ImageConfig;
33
+
34
+ /**
35
+ * Uploader module instance
36
+ */
37
+ private uploader: any;
38
+
39
+ /**
40
+ * UI module instance
41
+ */
42
+ private ui: Ui;
43
+
44
+ /**
45
+ * Stores current block data internally
46
+ */
47
+ private _data: ImageToolData;
48
+
49
+
50
+
51
+
52
+ /**
53
+ * Caption enabled state
54
+ * Null when user has not toggled the caption tune
55
+ * True when user has toggled the caption tune
56
+ * False when user has toggled the caption tune
57
+ */
58
+ private isCaptionEnabled: boolean | null = null;
59
+
60
+ /**
61
+ * @param tool - tool properties got from editor.js
62
+ * @param tool.data - previously saved data
63
+ * @param tool.config - user config for Tool
64
+ * @param tool.api - Editor.js API
65
+ * @param tool.readOnly - read-only mode flag
66
+ * @param tool.block - current Block API
67
+ */
68
+ constructor({ data, config, api, readOnly, block }: ImageToolConstructorOptions) {
69
+ this.api = api;
70
+ this.block = block;
71
+
72
+
73
+ /**
74
+ * Tool's initial config
75
+ */
76
+ this.config = {
77
+ endpoints: config!.endpoints,
78
+ additionalRequestData: config!.additionalRequestData,
79
+ additionalRequestHeaders: config!.additionalRequestHeaders,
80
+ field: config!.field,
81
+ types: config!.types,
82
+ captionPlaceholder: this.api.i18n.t(config!.captionPlaceholder ?? 'Caption'),
83
+ buttonContent: config!.buttonContent,
84
+ uploader: config!.uploader,
85
+ actions: config!.actions,
86
+ features: config!.features || {},
87
+ userStore: config!.userStore,
88
+ };
89
+ console.log("imageTool.config", this.config);
90
+
91
+ /**
92
+ * Module for file uploading
93
+ */
94
+ this.uploader = new Uploader({
95
+ config: this.config,
96
+ onUpload: (response: UploadResponseFormat) => this.onUpload(response),
97
+ onError: (error: string) => this.uploadingFailed(error),
98
+ });
99
+
100
+ /**
101
+ * Module for working with UI
102
+ */
103
+ this.ui = new Ui({
104
+ api,
105
+ config: this.config,
106
+ onSelectFile: () => {
107
+ this.uploader.uploadSelectedFile({
108
+ onPreview: (src: string) => {
109
+ this.ui.showPreloader(src);
110
+ },
111
+ noSelectedFile: () => {
112
+ this.noSelectedFile();
113
+ }
114
+ });
115
+ },
116
+ readOnly,
117
+ });
118
+
119
+ /**
120
+ * Set saved state
121
+ */
122
+ this._data = {
123
+ caption: '',
124
+ withBorder: false,
125
+ withBackground: false,
126
+ stretched: false,
127
+ file: {
128
+ url: '',
129
+ },
130
+ };
131
+ this.data = data;
132
+ }
133
+
134
+ private noSelectedFile(): void {
135
+ this.api.blocks.delete(this.api.blocks.getCurrentBlockIndex());
136
+ }
137
+ private deleteCurrentBlock() {
138
+ this.api.blocks.delete(this.api.blocks.getCurrentBlockIndex());
139
+ }
140
+ /**
141
+ * Notify core that read-only mode is supported
142
+ */
143
+ public static get isReadOnlySupported(): boolean {
144
+ return true;
145
+ }
146
+
147
+ /**
148
+ * Get Tool toolbox settings
149
+ * icon - Tool icon's SVG
150
+ * title - title to show in toolbox
151
+ */
152
+ public static get toolbox(): ToolboxConfig {
153
+ return {
154
+ icon: IconPicture,
155
+ title: 'Image',
156
+ };
157
+ }
158
+
159
+ /**
160
+ * Available image tools
161
+ */
162
+ public static get tunes(): Array<ActionConfig> {
163
+ return [
164
+ {
165
+ name: 'withBorder',
166
+ icon: IconAddBorder,
167
+ title: 'With border',
168
+ toggle: true,
169
+ },
170
+ {
171
+ name: 'stretched',
172
+ icon: IconStretch,
173
+ title: 'Stretch image',
174
+ toggle: true,
175
+ },
176
+ {
177
+ name: 'withBackground',
178
+ icon: IconAddBackground,
179
+ title: 'With background',
180
+ toggle: true,
181
+ },
182
+ ];
183
+ }
184
+
185
+ /**
186
+ * Renders Block content
187
+ */
188
+ public render(): HTMLDivElement {
189
+ if (this.config.features?.caption === true || this.config.features?.caption === undefined || (this.config.features?.caption === 'optional' && this.data.caption)) {
190
+ this.isCaptionEnabled = true;
191
+ this.ui.applyTune('caption', true);
192
+ }
193
+
194
+ return this.ui.render() as HTMLDivElement;
195
+ }
196
+
197
+ /**
198
+ * Validate data: check if Image exists
199
+ * @param savedData — data received after saving
200
+ * @returns false if saved data is not correct, otherwise true
201
+ */
202
+ public validate(savedData: ImageToolData): boolean {
203
+ return !!savedData.file.url;
204
+ }
205
+
206
+ /**
207
+ * Return Block data
208
+ */
209
+ public save(): ImageToolData {
210
+ const caption = this.ui.nodes.caption;
211
+
212
+ this._data.caption = caption.innerHTML;
213
+
214
+ return this.data;
215
+ }
216
+
217
+ /**
218
+ * Returns configuration for block tunes: add background, add border, stretch image
219
+ * @returns TunesMenuConfig
220
+ */
221
+ public renderSettings(): TunesMenuConfig {
222
+ // Merge default tunes with the ones that might be added by user
223
+ // @see https://github.com/editor-js/image/pull/49
224
+ const tunes = ImageTool.tunes.concat(this.config.actions || []);
225
+ const featureTuneMap: Record<string, string> = {
226
+ border: 'withBorder',
227
+ background: 'withBackground',
228
+ stretch: 'stretched',
229
+ caption: 'caption',
230
+ };
231
+
232
+ if (this.config.features?.caption === 'optional') {
233
+ tunes.push({
234
+ name: 'caption',
235
+ icon: IconText,
236
+ title: 'With caption',
237
+ toggle: true,
238
+ });
239
+ }
240
+
241
+ const availableTunes = tunes.filter((tune) => {
242
+ const featureKey = Object.keys(featureTuneMap).find(key => featureTuneMap[key] === tune.name);
243
+
244
+ if (featureKey === 'caption') {
245
+ return this.config.features?.caption !== false;
246
+ }
247
+
248
+ return featureKey == null || this.config.features?.[featureKey as keyof FeaturesConfig] !== false;
249
+ });
250
+
251
+ /**
252
+ * Check if the tune is active
253
+ * @param tune - tune to check
254
+ */
255
+ const isActive = (tune: ActionConfig): boolean => {
256
+ let currentState = this.data[tune.name as keyof ImageToolData] as boolean;
257
+
258
+ if (tune.name === 'caption') {
259
+ currentState = this.isCaptionEnabled ?? currentState;
260
+ }
261
+
262
+ return currentState;
263
+ };
264
+
265
+ return availableTunes.map(tune => ({
266
+ icon: tune.icon,
267
+ label: this.api.i18n.t(tune.title),
268
+ name: tune.name,
269
+ toggle: tune.toggle,
270
+ isActive: isActive(tune),
271
+ onActivate: () => {
272
+ /** If it'a user defined tune, execute it's callback stored in action property */
273
+ if (typeof tune.action === 'function') {
274
+ tune.action(tune.name);
275
+
276
+ return;
277
+ }
278
+ let newState = !isActive(tune);
279
+
280
+ /**
281
+ * For the caption tune, we can't rely on the this._data
282
+ * because it can be manualy toggled by user
283
+ */
284
+ if (tune.name === 'caption') {
285
+ this.isCaptionEnabled = !(this.isCaptionEnabled ?? false);
286
+ newState = this.isCaptionEnabled;
287
+ }
288
+
289
+ this.tuneToggled(tune.name as keyof ImageToolData, newState);
290
+ },
291
+ }));
292
+ }
293
+
294
+ /**
295
+ * Fires after clicks on the Toolbox Image Icon
296
+ * Initiates click on the Select File button
297
+ */
298
+ public appendCallback(): void {
299
+ this.ui.nodes.fileButton.click();
300
+ }
301
+
302
+ /**
303
+ * Specify paste substitutes
304
+ * @see {@link https://github.com/codex-team/editor.js/blob/master/docs/tools.md#paste-handling}
305
+ */
306
+ public static get pasteConfig(): PasteConfig {
307
+ return {
308
+ /**
309
+ * Paste HTML into Editor
310
+ */
311
+ tags: [
312
+ {
313
+ img: { src: true },
314
+ },
315
+ ],
316
+ /**
317
+ * Paste URL of image into the Editor
318
+ */
319
+ // patterns: {
320
+ // image: /https?:\/\/\S+\.(gif|jpe?g|png|webp)(\?[a-z0-9=]*)?$/i,
321
+ // },
322
+
323
+ /**
324
+ * Drag n drop file from into the Editor
325
+ */
326
+ files: {
327
+ mimeTypes: ['image/*'],
328
+ },
329
+ };
330
+ }
331
+
332
+ /**
333
+ * Specify paste handlers
334
+ * @see {@link https://github.com/codex-team/editor.js/blob/master/docs/tools.md#paste-handling}
335
+ * @param event - editor.js custom paste event
336
+ * {@link https://github.com/codex-team/editor.js/blob/master/types/tools/paste-events.d.ts}
337
+ */
338
+ public async onPaste(event: PasteEvent): Promise<void> {
339
+ switch (event.type) {
340
+ case 'tag': {
341
+ const image = (event.detail as HTMLPasteEventDetailExtended).data;
342
+
343
+ /** Images from PDF */
344
+ if (/^blob:/.test(image.src)) {
345
+ const response = await fetch(image.src);
346
+
347
+ const file = await response.blob();
348
+
349
+ this.uploadFile(file);
350
+ break;
351
+ }
352
+
353
+ this.uploadUrl(image.src);
354
+ break;
355
+ }
356
+ // case 'pattern': {
357
+ // const url = (event.detail as PatternPasteEventDetail).data;
358
+
359
+ // this.uploadUrl(url);
360
+ // break;
361
+ // }
362
+ case 'file': {
363
+ const file = (event.detail as FilePasteEventDetail).file;
364
+
365
+ this.uploadFile(file);
366
+ break;
367
+ }
368
+ }
369
+ }
370
+
371
+ /**
372
+ * Private methods
373
+ */
374
+
375
+ /**
376
+ * Stores all Tool's data
377
+ * @param data - data in Image Tool format
378
+ */
379
+ private set data(data: ImageToolData) {
380
+ this.image = data.file;
381
+
382
+ this._data.caption = data.caption || '';
383
+ this.ui.fillCaption(this._data.caption);
384
+
385
+ ImageTool.tunes.forEach(({ name: tune }) => {
386
+ const value = typeof data[tune as keyof ImageToolData] !== 'undefined' ? data[tune as keyof ImageToolData] === true || data[tune as keyof ImageToolData] === 'true' : false;
387
+
388
+ this.setTune(tune as keyof ImageToolData, value);
389
+ });
390
+
391
+ if (data.caption) {
392
+ this.setTune('caption', true);
393
+ } else if (this.config.features?.caption === true) {
394
+ this.setTune('caption', true);
395
+ }
396
+ }
397
+
398
+ /**
399
+ * Return Tool data
400
+ */
401
+ private get data(): ImageToolData {
402
+ return this._data;
403
+ }
404
+
405
+ /**
406
+ * Set new image file
407
+ * @param file - uploaded file data
408
+ */
409
+ private set image(file: ImageSetterParam | undefined) {
410
+ this._data.file = file || { url: '' };
411
+
412
+ if (file && file.url) {
413
+ this.ui.fillImage(file.url);
414
+ }
415
+ }
416
+
417
+ /**
418
+ * File uploading callback
419
+ * @param response - uploading server response
420
+ */
421
+ private onUpload(response: UploadResponseFormat): void {
422
+ if (response.success && Boolean(response.file)) {
423
+ this.image = response.file;
424
+ } else {
425
+ this.uploadingFailed('incorrect response: ' + JSON.stringify(response));
426
+ }
427
+ }
428
+
429
+ /**
430
+ * Handle uploader errors
431
+ * @param errorText - uploading error info
432
+ */
433
+ private uploadingFailed(errorText: string): void {
434
+ console.log('Image Tool: uploading failed because of', errorText);
435
+ let errorMessage = this.api.i18n.t('Couldn’t upload image. Please try another.');
436
+ if (errorText) {
437
+ errorMessage = this.api.i18n.t(errorText);
438
+ }
439
+ this.api.notifier.show({
440
+ message: errorMessage,
441
+ style: 'error',
442
+ });
443
+ this.ui.hidePreloader();
444
+ this.deleteCurrentBlock();
445
+ }
446
+
447
+ /**
448
+ * Callback fired when Block Tune is activated
449
+ * @param tuneName - tune that has been clicked
450
+ * @param state - new state
451
+ */
452
+ private tuneToggled(tuneName: keyof ImageToolData, state: boolean): void {
453
+ if (tuneName === 'caption') {
454
+ this.ui.applyTune(tuneName, state);
455
+
456
+ if (state == false) {
457
+ this._data.caption = '';
458
+ this.ui.fillCaption('');
459
+ }
460
+ } else {
461
+ /**
462
+ * Inverse tune state
463
+ */
464
+ this.setTune(tuneName, state);
465
+ }
466
+ }
467
+
468
+ /**
469
+ * Set one tune
470
+ * @param tuneName - {@link Tunes.tunes}
471
+ * @param value - tune state
472
+ */
473
+ private setTune(tuneName: keyof ImageToolData, value: boolean): void {
474
+ (this._data[tuneName] as boolean) = value;
475
+
476
+ this.ui.applyTune(tuneName, value);
477
+ if (tuneName === 'stretched') {
478
+ /**
479
+ * Wait until the API is ready
480
+ */
481
+ Promise.resolve().then(() => {
482
+ this.block.stretched = value;
483
+ })
484
+ .catch((err) => {
485
+ console.error(err);
486
+ });
487
+ }
488
+ }
489
+
490
+ /**
491
+ * Show preloader and upload image file
492
+ * @param file - file that is currently uploading (from paste)
493
+ */
494
+ private uploadFile(file: Blob): void {
495
+ this.uploader.uploadByFile(file, {
496
+ onPreview: (src: string) => {
497
+ this.ui.showPreloader(src);
498
+ },
499
+ });
500
+ }
501
+
502
+ /**
503
+ * Show preloader and upload image by target url
504
+ * @param url - url pasted
505
+ */
506
+ private uploadUrl(url: string): void {
507
+ this.ui.showPreloader(url);
508
+ this.uploader.uploadByUrl(url);
509
+ }
510
+ }
@@ -0,0 +1,89 @@
1
+ /**
2
+ * Module declaration for '@codexteam/ajax'.
3
+ */
4
+ declare module '@codexteam/ajax' {
5
+ /**
6
+ * Options for configuring an Ajax request.
7
+ */
8
+ export interface AjaxOptions {
9
+ /**
10
+ * The URL to which the request is sent.
11
+ */
12
+ url?: string;
13
+ /**
14
+ * The data to send with the request.
15
+ */
16
+ data?: object;
17
+ /**
18
+ * The MIME type of the request.
19
+ */
20
+ accept?: string;
21
+ /**
22
+ * The headers to send with the request.
23
+ */
24
+ headers?: object;
25
+ /**
26
+ * A function to call before the request is sent, with the files to be sent.
27
+ */
28
+ beforeSend?: (files: File[]) => void;
29
+ /**
30
+ * The name of the field in the form data to which the file should be assigned.
31
+ */
32
+ fieldName?: string;
33
+ /**
34
+ * The type of the request (e.g., 'POST', 'GET').
35
+ */
36
+ type?: string;
37
+ }
38
+
39
+ /**
40
+ * Parameter type of selectFiles function in AjaxOptions interface
41
+ */
42
+ export type AjaxFileOptionsParam = {
43
+ /**
44
+ * the accepted file types.
45
+ */
46
+ accept: string;
47
+ };
48
+
49
+ /**
50
+ * Represents the response from an Ajax request.
51
+ * @template T - The type of the response body.
52
+ */
53
+ export interface AjaxResponse<T = object> {
54
+ /** The body of the response. */
55
+ body: T;
56
+ }
57
+
58
+ /**
59
+ * Prompts the user to select files and returns a promise that resolves with the selected files.
60
+ * @param options - Options for file selection.
61
+ * @param options.accept - The accepted file types.
62
+ * @returns A promise that resolves with the selected files.
63
+ */
64
+ export function selectFiles(options: AjaxFileOptionsParam): Promise<File[]>;
65
+
66
+ /**
67
+ * Sends an Ajax request with the specified options.
68
+ * @param options - Options for the Ajax request.
69
+ * @returns A promise that resolves with the Ajax response.
70
+ */
71
+ export function transport(options: AjaxOptions): Promise<AjaxResponse>;
72
+
73
+ /**
74
+ * Sends a POST request with the specified options.
75
+ * @param options - Options for the POST request.
76
+ * @returns A promise that resolves with the Ajax response.
77
+ */
78
+ export function post(options: AjaxOptions): Promise<AjaxResponse>;
79
+
80
+ /**
81
+ * Represents common content types.
82
+ */
83
+ export const contentType: {
84
+ /**
85
+ * The MIME type for JSON content.
86
+ */
87
+ JSON: string;
88
+ };
89
+ }