@unlayer/types 1.386.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (42) hide show
  1. package/dist/containers/body.d.ts +162 -0
  2. package/dist/containers/column.d.ts +85 -0
  3. package/dist/containers/content.d.ts +62 -0
  4. package/dist/containers/footer.d.ts +79 -0
  5. package/dist/containers/header.d.ts +79 -0
  6. package/dist/containers/index.d.ts +6 -0
  7. package/dist/containers/row.d.ts +100 -0
  8. package/dist/design.d.ts +102 -0
  9. package/dist/editor/audit.d.ts +31 -0
  10. package/dist/editor/config.d.ts +41 -0
  11. package/dist/editor/design.d.ts +16 -0
  12. package/dist/editor/display-conditions.d.ts +5 -0
  13. package/dist/editor/editor.d.ts +467 -0
  14. package/dist/editor/export.d.ts +104 -0
  15. package/dist/editor/features.d.ts +122 -0
  16. package/dist/editor/font.d.ts +24 -0
  17. package/dist/editor/index.d.ts +15 -0
  18. package/dist/editor/intl.d.ts +16 -0
  19. package/dist/editor/link-types.d.ts +72 -0
  20. package/dist/editor/merge-tags.d.ts +28 -0
  21. package/dist/editor/style-guide.d.ts +20 -0
  22. package/dist/editor/theme.d.ts +775 -0
  23. package/dist/editor/types.d.ts +23 -0
  24. package/dist/editor/utils.d.ts +88 -0
  25. package/dist/index.d.ts +3 -0
  26. package/dist/tools/button.d.ts +111 -0
  27. package/dist/tools/carousel.d.ts +52 -0
  28. package/dist/tools/divider.d.ts +54 -0
  29. package/dist/tools/form.d.ts +159 -0
  30. package/dist/tools/heading.d.ts +79 -0
  31. package/dist/tools/html.d.ts +48 -0
  32. package/dist/tools/image.d.ts +75 -0
  33. package/dist/tools/index.d.ts +17 -0
  34. package/dist/tools/menu.d.ts +91 -0
  35. package/dist/tools/page-break.d.ts +57 -0
  36. package/dist/tools/paragraph.d.ts +76 -0
  37. package/dist/tools/social.d.ts +58 -0
  38. package/dist/tools/table.d.ts +178 -0
  39. package/dist/tools/text.d.ts +76 -0
  40. package/dist/tools/timer.d.ts +87 -0
  41. package/dist/tools/video.d.ts +72 -0
  42. package/package.json +44 -0
@@ -0,0 +1,31 @@
1
+ // Auto-generated by build-values-types.js. Do not edit manually.
2
+
3
+ import type { Location } from './types';
4
+
5
+ export type AuditTool = {
6
+ type: string;
7
+ name?: string;
8
+ slug?: string;
9
+ labelPath?: Rule['labelPath'];
10
+ };
11
+
12
+ export type Rule = {
13
+ id: string;
14
+ icon: string | string[] | undefined;
15
+ title: string;
16
+ description: string;
17
+ severity: 'ERROR' | 'WARNING';
18
+ dismissable?: boolean;
19
+ labelPath?: string | string[] | null;
20
+ };
21
+
22
+ export type Audit = {
23
+ location?: Location;
24
+ tool?: AuditTool;
25
+ } & Rule;
26
+
27
+ export type Validator = (info: {
28
+ [id: string]: unknown;
29
+ html?: string;
30
+ defaultErrors?: Audit[];
31
+ }) => Audit[] | Promise<Audit[]>;
@@ -0,0 +1,41 @@
1
+ // Auto-generated by build-values-types.js. Do not edit manually.
2
+
3
+ export interface EditorSettings {
4
+ minHeaders?: number;
5
+ maxHeaders?: number;
6
+ minFooters?: number;
7
+ maxFooters?: number;
8
+ minRows?: number;
9
+ maxRows?: number;
10
+ contentType?: 'page' | 'block';
11
+ autoSelectOnDrop: boolean;
12
+ columns?: boolean;
13
+ confirmOnDelete?: boolean;
14
+ title?: string;
15
+ }
16
+
17
+ // ───────────────────────────────────────────────────────────────────────────
18
+ // Core Types
19
+ // ───────────────────────────────────────────────────────────────────────────
20
+
21
+ export interface SafeHtmlOptions {
22
+ domPurifyOptions?: Record<string, any>;
23
+ }
24
+
25
+ export type Tabs = {
26
+ [tabName: string]: {
27
+ enabled?: boolean;
28
+ type?: string;
29
+ position?: number;
30
+ icon?: string;
31
+ active?: boolean;
32
+ };
33
+ };
34
+
35
+ export type User = {
36
+ id?: string | number;
37
+ name?: string | null | undefined;
38
+ avatar?: string | null | undefined;
39
+ email?: string;
40
+ signature?: string;
41
+ };
@@ -0,0 +1,16 @@
1
+ // Auto-generated by build-values-types.js. Do not edit manually.
2
+
3
+
4
+ export type { DesignBody, DesignColumn, DesignContentItem, DesignContentType, DesignRow, JSONTemplate } from '../design';
5
+
6
+ export type DesignMode = 'live' | 'edit';
7
+
8
+ export type DesignTag = string;
9
+
10
+ export interface DesignTags {
11
+ [name: string]: DesignTag;
12
+ }
13
+
14
+ export interface DesignTagsConfig {
15
+ delimiter: [string, string];
16
+ }
@@ -0,0 +1,5 @@
1
+ // Auto-generated by build-values-types.js. Do not edit manually.
2
+
3
+ export type DisplayCondition = Record<string, any>;
4
+
5
+ export type DisplayConditions = DisplayCondition[];
@@ -0,0 +1,467 @@
1
+ // Auto-generated by build-values-types.js. Do not edit manually.
2
+
3
+ import type { Audit, Validator } from './audit';
4
+ import type { EditorSettings, SafeHtmlOptions, Tabs, User } from './config';
5
+ import type { DesignMode, DesignTags, DesignTagsConfig, JSONTemplate } from './design';
6
+ import type { DisplayConditions } from './display-conditions';
7
+ import type { ExportFromApiResult, ExportHtmlOptions, ExportHtmlResult, ExportImageFromApiOptions, ExportLiveHtmlOptions, ExportLiveHtmlResult, ExportPdfFromApiOptions, ExportPlainTextOptions, ExportPlainTextResult, ExportZipFromApiOptions, SaveDesignOptions } from './export';
8
+ import type { ColorPicker, Features } from './features';
9
+ import type { Fonts } from './font';
10
+ import type { Language, Locale, TextDirection, Translations } from './intl';
11
+ import type { LinkTypes, LinkTypesSharedConfig, SpecialLink, SpecialLinks } from './link-types';
12
+ import type { MergeTags, MergeTagsConfig, MergeTagsValues } from './merge-tags';
13
+ import type { StyleGuideConfig } from './style-guide';
14
+ import type { AppearanceConfig, Theme } from './theme';
15
+ import type { Collection, Device, DisplayMode, Location, Variant } from './types';
16
+ import type { DeepPartial, LanguagesValue } from './utils';
17
+ import type { BodyValues } from '../containers/body';
18
+ import type { ColumnValues } from '../containers/column';
19
+ import type { RowValues } from '../containers/row';
20
+
21
+ export type Container = 'body' | 'row' | 'column' | 'content';
22
+
23
+ export interface ToolConfig {
24
+ enabled?: boolean | undefined;
25
+ position?: number | undefined;
26
+ properties?: object | undefined;
27
+ sections?: object | undefined;
28
+ validator?: Validator;
29
+ }
30
+
31
+ export interface ToolsConfig {
32
+ [key: string]: ToolConfig;
33
+ }
34
+
35
+ export type BodyContainerExporter = (innerHTML: string, bodyValues: Record<string, any>, // @deprecated use last param instead
36
+ meta: {
37
+ bodyValues: BodyValues;
38
+ type: string;
39
+ variant: Variant;
40
+ }) => string;
41
+
42
+ export type RowContainerExporter = (innerHTML: string, rowValues: RowValues, // @deprecated use last param instead
43
+ bodyValues: BodyValues, // @deprecated use last param instead
44
+ meta: {
45
+ rowIndex: number;
46
+ rowCells: number[];
47
+ rowValues: RowValues;
48
+ bodyValues: BodyValues;
49
+ variant: Variant | undefined;
50
+ language: string | undefined;
51
+ collection: Collection;
52
+ }) => string;
53
+
54
+ export type ColumnContainerExporter = (innerHTML: string, columnValues: Record<string, any>, // @deprecated use last param instead
55
+ columnIndex: number, // @deprecated use last param instead
56
+ rowCells: number[], // @deprecated use last param instead
57
+ bodyValues: BodyValues, // @deprecated use last param instead
58
+ rowValues: RowValues, // @deprecated use last param instead
59
+ meta: {
60
+ columnIndex: number;
61
+ columnValues: ColumnValues;
62
+ rowIndex: number;
63
+ rowCells: number[];
64
+ rowValues: RowValues;
65
+ bodyValues: BodyValues;
66
+ variant: Variant;
67
+ language: string;
68
+ }) => string;
69
+
70
+ export type ContentContainerExporter = (innerHTML: string, contentValues: Record<string, any>, // @deprecated use last param instead
71
+ bodyValues: BodyValues, // @deprecated use last param instead
72
+ meta: {
73
+ index: number;
74
+ columnIndex: number;
75
+ columnValues: ColumnValues;
76
+ rowIndex: number;
77
+ rowCells: number[];
78
+ rowValues: RowValues;
79
+ bodyValues: BodyValues;
80
+ variant: Variant | undefined;
81
+ language: string | undefined;
82
+ embeddedValues: Record<string, unknown>;
83
+ mergeTagState: {
84
+ mergeTagGroup: string;
85
+ mergeTagRule: string;
86
+ mergeTags: MergeTagsValues;
87
+ };
88
+ }) => string;
89
+
90
+ export type ItemExporter<TValues extends Record<string, unknown>> = (renderValues: TValues, index: number, // @deprecated use last param instead
91
+ columnIndex: number, // @deprecated use last param instead
92
+ rowCells: number[], // @deprecated use last param instead
93
+ bodyValues: BodyValues, // @deprecated use last param instead
94
+ rowValues: RowValues, // @deprecated use last param instead
95
+ embeddedValues: Record<string, unknown>, // @deprecated use last param instead
96
+ meta: {
97
+ index: number;
98
+ columnIndex: number;
99
+ columnValues: ColumnValues;
100
+ rowIndex: number;
101
+ rowCells: number[];
102
+ rowValues: RowValues;
103
+ bodyValues: BodyValues;
104
+ embeddedValues: Record<string, unknown>;
105
+ mergeTagState: {
106
+ mergeTagGroup: string;
107
+ mergeTagRule: string;
108
+ mergeTags: MergeTagsValues;
109
+ };
110
+ }) => string;
111
+
112
+ // ───────────────────────────────────────────────────────────────────────────
113
+ // Theme & Appearance
114
+ // ───────────────────────────────────────────────────────────────────────────
115
+
116
+ interface Config {
117
+ id?: string;
118
+ className?: string;
119
+ version?: string;
120
+ source?: {
121
+ name: string;
122
+ version: string;
123
+ };
124
+ offline?: boolean;
125
+ render?: boolean;
126
+ amp?: boolean;
127
+ defaultDevice?: Device;
128
+ devices?: Device[];
129
+ designId?: string;
130
+ designMode?: string;
131
+ displayMode?: DisplayMode;
132
+ env?: Record<'API_V1_BASE_URL' | 'API_V2_BASE_URL' | 'API_V3_BASE_URL' | 'EVENTS_API_BASE_URL' | 'TOOLS_API_V1_BASE_URL' | 'TOOLS_CDN_BASE_URL' | 'CONSOLE_BASE_URL', string | undefined>;
133
+ projectId?: number | null;
134
+ user?: User;
135
+ templateId?: number;
136
+ stockTemplateId?: string;
137
+ loadTimeout?: number;
138
+ safeHtml?: boolean | SafeHtmlOptions;
139
+ /** @deprecated use safeHtml instead */
140
+ safeHTML?: boolean | SafeHtmlOptions;
141
+ options?: object;
142
+ tools?: ToolsConfig;
143
+ excludeTools?: string[];
144
+ blocks?: object[];
145
+ editor?: Partial<EditorSettings>;
146
+ fonts?: Fonts;
147
+ linkTypes?: LinkTypes;
148
+ linkTypesSharedConfig?: LinkTypesSharedConfig;
149
+ mergeTags?: MergeTags;
150
+ displayConditions?: DisplayConditions;
151
+ specialLinks?: SpecialLinks;
152
+ designTags?: DesignTags;
153
+ customCSS?: string | string[];
154
+ customJS?: string | string[];
155
+ locale?: string;
156
+ textDirection?: TextDirection;
157
+ translations?: Record<string, Record<string, string>>;
158
+ appearance?: DeepPartial<AppearanceConfig>;
159
+ features?: Features;
160
+ designTagsConfig?: DesignTagsConfig;
161
+ mergeTagsConfig?: MergeTagsConfig;
162
+ validator?: (info: {
163
+ html: ExportHtmlResult;
164
+ design: JSONTemplate;
165
+ defaultErrors: Audit[];
166
+ }) => Audit[] | Promise<Audit[]>;
167
+ tabs?: Tabs;
168
+ }
169
+
170
+ type Message = object;
171
+
172
+ interface MessageData {
173
+ action: string;
174
+ callbackId: number;
175
+ doneId: number;
176
+ result: unknown | undefined;
177
+ resultArgs: unknown[] | undefined;
178
+ }
179
+
180
+ declare class Frame {
181
+ id: number;
182
+ ready: boolean;
183
+ iframe: HTMLIFrameElement | undefined;
184
+ messages: any[];
185
+ callbackId: number;
186
+ callbacks: {
187
+ [key: number]: ((...args: any[]) => any) | undefined;
188
+ };
189
+ constructor(src: string);
190
+ createIframe(src: string): HTMLIFrameElement;
191
+ destroy: () => void;
192
+ appendTo(el: Element): void;
193
+ onWindowMessage: (event: MessageEvent<any>) => void;
194
+ postMessage(action: string, message: Message): void;
195
+ withMessage(action: string, message: Message | undefined, callback?: (...args: any[]) => any): void;
196
+ _preprocessMessageFunctions(message: Message): Message;
197
+ preprocessMessage(message: Message): Message;
198
+ scheduleMessage(message: Message): void;
199
+ flushMessages(): void;
200
+ handleMessage({ action, callbackId, doneId, result: _result, resultArgs: _resultArgs, }: MessageData): void;
201
+ receiveMessage(event: any): void;
202
+ }
203
+
204
+ declare class EditorClass {
205
+ frame: Frame | null;
206
+ constructor(config?: Config);
207
+ init(config?: Config): void;
208
+ destroy(): void;
209
+ versions: {
210
+ current: string | undefined;
211
+ latest: string;
212
+ stable: string;
213
+ };
214
+ get version(): string;
215
+ loadEditor(config: Config): void;
216
+ renderEditor(config: Config): void;
217
+ initEditor(config: Config): void;
218
+ registerColumns(cells: number[]): void;
219
+ registerCallback(type: string, callback: (...args: any[]) => void): void;
220
+ unregisterCallback(type: string): void;
221
+ registerProvider(type: string, callback: (...args: any[]) => any): void;
222
+ unregisterProvider(type: string): void;
223
+ reloadProvider(type: string): void;
224
+ addEventListener(type: string, callback: (...args: any[]) => void): void;
225
+ removeEventListener(type: string): void;
226
+ setDesignId(id: string | null): void;
227
+ setDesignMode(designMode: DesignMode | null): void;
228
+ setDisplayMode(displayMode: DisplayMode): void;
229
+ loadProject(projectId: number): void;
230
+ loadUser(user: User): void;
231
+ loadTemplate(templateId: number): void;
232
+ loadStockTemplate(stockTemplateId: string): void;
233
+ setLinkTypes(linkTypes: LinkTypes): void;
234
+ setLinkTypesSharedConfig(linkTypesSharedConfig: LinkTypesSharedConfig | null): void;
235
+ setMergeTags(mergeTags: MergeTags): void;
236
+ setSpecialLinks(specialLinks: SpecialLink[]): void;
237
+ setDisplayConditions(displayConditions: DisplayConditions): void;
238
+ setLocale(locale: Locale | null): void;
239
+ setTextDirection(textDirection: TextDirection | null): void;
240
+ setTranslations(translations: Translations): void;
241
+ loadBlank(bodyValues?: object): void;
242
+ loadDesign<TDisplayMode extends DisplayMode | undefined = undefined>(design: JSONTemplate<TDisplayMode>): void;
243
+ saveDesign<TDisplayMode extends DisplayMode | undefined = undefined>(callback: (data: JSONTemplate<TDisplayMode>) => void, options?: SaveDesignOptions): void;
244
+ exportHtml<TDisplayMode extends DisplayMode | undefined = undefined>(callback: (data: ExportHtmlResult<TDisplayMode>) => void, options?: ExportHtmlOptions): void;
245
+ exportLiveHtml<TDisplayMode extends DisplayMode | undefined = undefined>(callback: (data: ExportLiveHtmlResult<TDisplayMode>) => void, options?: ExportLiveHtmlOptions): void;
246
+ exportPlainText<TDisplayMode extends DisplayMode | undefined = undefined>(callback: (data: ExportPlainTextResult<TDisplayMode>) => void, options?: ExportPlainTextOptions): void;
247
+ exportImage<TDisplayMode extends DisplayMode | undefined = undefined>(callback: (data: ExportFromApiResult<TDisplayMode>) => void, options?: ExportImageFromApiOptions): void;
248
+ exportPdf<TDisplayMode extends DisplayMode | undefined = undefined>(callback: (data: ExportFromApiResult<TDisplayMode>) => void, options?: ExportPdfFromApiOptions): void;
249
+ exportZip<TDisplayMode extends DisplayMode | undefined = undefined>(callback: (data: ExportFromApiResult<TDisplayMode>) => void, options?: ExportZipFromApiOptions): void;
250
+ setAppearance(appearance: DeepPartial<AppearanceConfig>): void;
251
+ setTheme(theme: AppearanceConfig['theme']): void;
252
+ setBodyValues(bodyValues: Partial<BodyValues>, bodyId?: number): void;
253
+ setStyleGuide(styleGuide: StyleGuideConfig): void;
254
+ setDesignTagsConfig(designTagsConfig: DesignTagsConfig): void;
255
+ setMergeTagsConfig(mergeTagsConfig: MergeTagsConfig): void;
256
+ showPreview(payload: {
257
+ device?: Device;
258
+ resolution?: number;
259
+ }): void;
260
+ hidePreview(): void;
261
+ canUndo(callback: (result: boolean) => void): void;
262
+ canRedo(callback: (result: boolean) => void): void;
263
+ undo(): void;
264
+ redo(): void;
265
+ audit(callback: (data: {
266
+ status: 'FAIL' | 'PASS';
267
+ errors: Audit[];
268
+ }) => void): void;
269
+ setValidator(validator: Validator | null): void;
270
+ setToolValidator(tool: string, validator: Validator | null): void;
271
+ updateTabs(tabs: Tabs): void;
272
+ clearValidators(): void;
273
+ setCurrentLanguage(language: string): void;
274
+ setLanguages(languages: Language[]): void;
275
+ setColorPickerConfig(colorPickerConfig: ColorPicker): void;
276
+ registerContainerExporter(name: Container, exporter: BodyContainerExporter | RowContainerExporter | ColumnContainerExporter | ContentContainerExporter | null | undefined): void;
277
+ registerItemExporter(name: string, exporter: ItemExporter<Record<string, unknown>> | null | undefined): void;
278
+ registerTool(config: ToolConfigDefinition): void;
279
+ registerPropertyEditor(config: PropertyEditorConfig): void;
280
+ registerTab(config: TabConfig): void;
281
+ createPanel(config: PanelConfig): void;
282
+ createViewer(config: ViewerConfig): void;
283
+ createWidget(config: WidgetConfig): void;
284
+ }
285
+
286
+ declare class Embed extends EditorClass {
287
+ createEditor(config: Config): EditorClass;
288
+ }
289
+
290
+ declare const _default: Embed;
291
+
292
+ // ───────────────────────────────────────────────────────────────────────────
293
+ // Other
294
+ // ───────────────────────────────────────────────────────────────────────────
295
+
296
+ export interface PropertyEditorConfig {
297
+ id?: string;
298
+ name: string;
299
+ Widget: any;
300
+ description?: string;
301
+ layout?: 'right' | 'bottom';
302
+ styleGuideLock?: boolean;
303
+ renderValue?: (value: any) => any;
304
+ deviceStyles?: (value: any, extra: {
305
+ collection: Collection;
306
+ device: Device;
307
+ displayMode: DisplayMode;
308
+ getDefaultSelectorForCSSProperty: (cssProperty: string | undefined) => string | undefined;
309
+ htmlID: string;
310
+ optionName: string;
311
+ bodyValues: {
312
+ [name: string]: any;
313
+ };
314
+ rootValue: any;
315
+ }) => {
316
+ _css?: string;
317
+ [key: string]: string | undefined;
318
+ };
319
+ }
320
+
321
+ export type OptionConfigMap<Values extends ValueMap = ValueMap> = {
322
+ [K in keyof Values]: any;
323
+ };
324
+
325
+ export type OptionGroupEmbeddedConfig<Values extends ValueMap = ValueMap> = {
326
+ collection: Collection;
327
+ type: string;
328
+ source: string;
329
+ tabLabel: string;
330
+ insertCount?: number;
331
+ optionGroups?: Record<string, {
332
+ optionsOverride?: OptionConfigMap<Partial<Values>>;
333
+ }>;
334
+ };
335
+
336
+ export type OptionGroupConfig<Values extends ValueMap = ValueMap> = {
337
+ rightLabel?: string;
338
+ title: string | null;
339
+ icon?: string | string[];
340
+ position?: number;
341
+ supportedDesignModes?: DesignMode[];
342
+ supportedByAI?: boolean;
343
+ enabled?: boolean;
344
+ hideOnOfflineMode?: boolean;
345
+ noContentPadding?: boolean;
346
+ ai?: boolean;
347
+ widgetParams?: {
348
+ [id: string]: unknown;
349
+ };
350
+ } & {
351
+ embedded?: OptionGroupEmbeddedConfig<Values>;
352
+ options?: OptionConfigMap<Partial<Values>>;
353
+ };
354
+
355
+ export type OptionGroupConfigMap<Values extends ValueMap = ValueMap> = {
356
+ [id: string]: OptionGroupConfig<Values>;
357
+ };
358
+
359
+ export type ValueMap = {
360
+ [id: string]: unknown;
361
+ } & LanguagesValue;
362
+
363
+ export interface ToolConfigDefinition<Values extends ValueMap = ValueMap, T = Validator> {
364
+ id?: string;
365
+ name?: string;
366
+ type?: string;
367
+ slug?: string;
368
+ label?: string;
369
+ icon?: string | string[];
370
+ classicIcon?: string | string[];
371
+ category?: Collection;
372
+ cells?: number[];
373
+ options: OptionGroupConfigMap;
374
+ data?: Partial<Values>;
375
+ values?: Partial<Values>;
376
+ css?: string;
377
+ renderer?: object | ((...args: any[]) => any);
378
+ supportedByAI?: boolean;
379
+ supportedDisplayModes?: DisplayMode[];
380
+ supportedVariants?: Variant[];
381
+ usageLimit?: number;
382
+ transformer?: (values: Partial<Values>, source: {
383
+ name: string;
384
+ value: unknown;
385
+ }) => Partial<Values>;
386
+ hasDeprecatedFontControls?: boolean;
387
+ syncMetadata?: {
388
+ id: string | number;
389
+ lastUpdatedAt: string | number;
390
+ enabled?: boolean;
391
+ };
392
+ applyDesignTags?: (values: Values, designTags: DesignTags, template: (template: string, view: Record<string, any>) => string) => Values;
393
+ propertyStates?: (values: Partial<Values>, context: {
394
+ type: string;
395
+ hasDeprecatedFontControls?: boolean;
396
+ }) => Record<string, object> | undefined;
397
+ isSupported?: (context: {
398
+ displayMode: DisplayMode;
399
+ variant: string | null;
400
+ }) => boolean;
401
+ premium?: boolean;
402
+ editable?: boolean;
403
+ classic?: boolean;
404
+ enabled?: boolean;
405
+ position?: number;
406
+ location?: Location;
407
+ validator?: T;
408
+ hidden?: boolean;
409
+ }
410
+
411
+ export interface TabConfig<Values extends ValueMap = ValueMap> {
412
+ id?: string;
413
+ name: string;
414
+ type?: string;
415
+ slug?: string;
416
+ label?: string;
417
+ icon?: string | string[];
418
+ renderer?: {
419
+ Panel: any;
420
+ };
421
+ supportedDisplayModes?: DisplayMode[];
422
+ supportedVariants?: Variant[];
423
+ classic?: boolean;
424
+ enabled?: boolean;
425
+ position?: number;
426
+ location?: Location;
427
+ }
428
+
429
+ export type PanelMountFn = (node: { current: HTMLDivElement | null } | null) => void;
430
+
431
+ export type PanelRenderFn = () => string;
432
+
433
+ export interface PanelConfig {
434
+ mount: PanelMountFn;
435
+ render: PanelRenderFn;
436
+ }
437
+
438
+ export type ViewerMountFn = (node: HTMLDivElement | null, values: unknown) => void;
439
+
440
+ export type ViewerRenderFn = (values: object, bodyValues: object, info: {
441
+ columnIndex: number;
442
+ rowCells: number[];
443
+ }) => string;
444
+
445
+ export interface ViewerConfig {
446
+ mount: ViewerMountFn;
447
+ render: ViewerRenderFn;
448
+ }
449
+
450
+ export type WidgetMountFn = (node: HTMLDivElement | null, value: unknown, updateValue: unknown, data: unknown) => void;
451
+
452
+ export type WidgetRenderFn = (value: unknown, updateValue: unknown, data: unknown) => string;
453
+
454
+ export interface WidgetConfig {
455
+ mount: WidgetMountFn;
456
+ render: WidgetRenderFn;
457
+ }
458
+
459
+ // ───────────────────────────────────────────────────────────────────────────
460
+ // Main Exports
461
+ // ───────────────────────────────────────────────────────────────────────────
462
+
463
+ export type UnlayerEmbed = typeof _default;
464
+
465
+ export type UnlayerOptions = Parameters<UnlayerEmbed['createEditor']>[0];
466
+
467
+ export type UnlayerEditor = InstanceType<typeof EditorClass>;
@@ -0,0 +1,104 @@
1
+ // Auto-generated by build-values-types.js. Do not edit manually.
2
+
3
+ import type { JSONTemplate } from './design';
4
+ import type { FontList } from './font';
5
+ import type { TextDirection } from './intl';
6
+ import type { MergeTagsValues } from './merge-tags';
7
+ import type { DisplayMode } from './types';
8
+
9
+ export interface SaveDesignOptions {
10
+ }
11
+
12
+ export interface ExportHtmlOptions {
13
+ amp?: boolean;
14
+ cleanup?: boolean;
15
+ inlineStyles?: boolean;
16
+ textDirection?: TextDirection;
17
+ isPreview?: boolean;
18
+ language?: string;
19
+ live?: boolean;
20
+ mergeTags?: MergeTagsValues;
21
+ minify?: boolean;
22
+ popupId?: string;
23
+ title?: string;
24
+ validateAmp?: boolean;
25
+ onlyHeader?: boolean;
26
+ onlyFooter?: boolean;
27
+ }
28
+
29
+ export interface ExportHtmlResult<TDisplayMode extends DisplayMode | undefined = undefined> {
30
+ html: string;
31
+ amp: {
32
+ enabled: boolean;
33
+ format: 'AMP' | 'AMP4EMAIL';
34
+ html: string | undefined;
35
+ validation: {
36
+ status: 'UNKNOWN' | 'PASS' | 'FAIL';
37
+ errors: Array<{
38
+ severity: 'UNKNOWN_SEVERITY' | 'ERROR' | 'WARNING';
39
+ line: number;
40
+ col: number;
41
+ message: string;
42
+ specUrl: string | null;
43
+ code: string;
44
+ params: string[];
45
+ }>;
46
+ };
47
+ };
48
+ chunks: ExportChunksResult;
49
+ design: JSONTemplate<TDisplayMode>;
50
+ }
51
+
52
+ export interface ExportLiveHtmlOptions extends Omit<ExportHtmlOptions, 'live'> {
53
+ }
54
+
55
+ export interface ExportLiveHtmlResult<TDisplayMode extends DisplayMode | undefined = undefined> extends ExportHtmlResult<TDisplayMode> {
56
+ }
57
+
58
+ export interface ExportPlainTextOptions {
59
+ ignoreLinks?: boolean;
60
+ ignoreImages?: boolean;
61
+ ignorePreheader?: boolean;
62
+ mergeTags?: Record<string, string>;
63
+ }
64
+
65
+ export interface ExportPlainTextResult<TDisplayMode extends DisplayMode | undefined = undefined> {
66
+ text: string;
67
+ design: JSONTemplate<TDisplayMode>;
68
+ }
69
+
70
+ export interface ExportChunksResult {
71
+ css: string;
72
+ js: string;
73
+ tags: string[];
74
+ fonts: FontList;
75
+ body: any;
76
+ }
77
+
78
+ export interface ExportFromApiResult<TDisplayMode extends DisplayMode | undefined = undefined> {
79
+ design: JSONTemplate<TDisplayMode>;
80
+ url: string | null;
81
+ error?: string;
82
+ }
83
+
84
+ interface BaseExportFromApiOptions {
85
+ mergeTags?: Record<string, string>;
86
+ language?: string;
87
+ }
88
+
89
+ export interface ExportImageFromApiOptions extends BaseExportFromApiOptions {
90
+ width?: number;
91
+ height?: number;
92
+ fullPage?: boolean;
93
+ deviceScaleFactor?: number;
94
+ }
95
+
96
+ export interface ExportPdfFromApiOptions extends BaseExportFromApiOptions {
97
+ }
98
+
99
+ export interface ExportZipFromApiOptions extends BaseExportFromApiOptions {
100
+ }
101
+
102
+ // ───────────────────────────────────────────────────────────────────────────
103
+ // Editor
104
+ // ───────────────────────────────────────────────────────────────────────────