unlayer-types 1.5.33 → 1.5.35
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/embed.d.ts +22 -16
- package/package.json +1 -1
package/embed.d.ts
CHANGED
@@ -7,9 +7,8 @@ declare module "engine/config/offline" {
|
|
7
7
|
}
|
8
8
|
declare module "engine/config/callbacks" {
|
9
9
|
import { Handler } from 'mitt';
|
10
|
-
export type
|
11
|
-
export type
|
12
|
-
export type CallbackFn = (data?: CallbackData, done?: CallbackDoneFn) => void;
|
10
|
+
export type CallbackDoneFn = (result: any) => Promise<void> | void;
|
11
|
+
export type CallbackFn = (data?: any, done?: CallbackDoneFn) => Promise<void> | void;
|
13
12
|
export type CallbackMap = {
|
14
13
|
[name: string]: CallbackFn | undefined;
|
15
14
|
};
|
@@ -393,8 +392,7 @@ declare module "state/types/index" {
|
|
393
392
|
[id: string]: unknown;
|
394
393
|
html?: string;
|
395
394
|
defaultErrors?: Audit[];
|
396
|
-
}) => Audit[]
|
397
|
-
export type AsyncValidator = (...args: Parameters<Validator>) => Promise<ReturnType<Validator>>;
|
395
|
+
}) => Promise<Audit[]>;
|
398
396
|
type GroupedAuditError = {
|
399
397
|
location: Location;
|
400
398
|
tool?: AuditTool;
|
@@ -453,6 +451,7 @@ declare module "state/types/index" {
|
|
453
451
|
enabled?: boolean | undefined;
|
454
452
|
position?: number | undefined;
|
455
453
|
properties?: object | undefined;
|
454
|
+
validator?: Validator;
|
456
455
|
}
|
457
456
|
export interface ToolsConfig {
|
458
457
|
[key: string]: ToolConfig;
|
@@ -549,9 +548,17 @@ declare module "embed/Config" {
|
|
549
548
|
chunks: ExportChunksResult;
|
550
549
|
design: JSONTemplate;
|
551
550
|
}
|
551
|
+
export interface ExportLiveHtmlOptions extends Omit<ExportHtmlOptions, 'live'> {
|
552
|
+
}
|
553
|
+
export interface ExportLiveHtmlResult extends ExportHtmlResult {
|
554
|
+
}
|
552
555
|
export interface ExportPlainTextOptions extends Omit<ExportHtmlOptions, 'cleanup' | 'minify'> {
|
553
556
|
ignorePreheader?: boolean;
|
554
557
|
}
|
558
|
+
export interface ExportPlainTextResult {
|
559
|
+
text: string;
|
560
|
+
design: JSONTemplate;
|
561
|
+
}
|
555
562
|
export interface HtmlToPlainTextOptions {
|
556
563
|
ignoreLinks?: boolean;
|
557
564
|
ignoreImages?: boolean;
|
@@ -569,10 +576,8 @@ declare module "embed/Config" {
|
|
569
576
|
ignorePreheader?: boolean;
|
570
577
|
mergeTags?: Record<string, string>;
|
571
578
|
}
|
572
|
-
export interface ExportLiveHtmlOptions extends Omit<ExportHtmlOptions, 'live'> {
|
573
|
-
}
|
574
579
|
export interface ExportFromApiResult {
|
575
|
-
|
580
|
+
design: JSONTemplate;
|
576
581
|
url: string | null;
|
577
582
|
error?: string;
|
578
583
|
}
|
@@ -620,6 +625,7 @@ declare module "embed/Frame" {
|
|
620
625
|
onWindowMessage: (event: MessageEvent<any>) => void;
|
621
626
|
postMessage(action: string, message: Message): void;
|
622
627
|
withMessage(action: string, message: Message | undefined, callback?: Function): void;
|
628
|
+
_preprocessMessageFunctions(message: Message): Message;
|
623
629
|
preprocessMessage(message: Message): Message;
|
624
630
|
scheduleMessage(message: Message): void;
|
625
631
|
flushMessages(): void;
|
@@ -627,10 +633,12 @@ declare module "embed/Frame" {
|
|
627
633
|
receiveMessage(event: any): void;
|
628
634
|
}
|
629
635
|
export const disableMultipleEditors: () => void;
|
636
|
+
export const disableOriginalFunctionReferences: () => void;
|
630
637
|
global {
|
631
638
|
interface Window {
|
632
639
|
__unlayer_lastFrameId: number;
|
633
640
|
__unlayer_multipleEditors: boolean;
|
641
|
+
__unlayer_originalFunctionReferences: boolean;
|
634
642
|
}
|
635
643
|
}
|
636
644
|
}
|
@@ -1382,7 +1390,7 @@ declare module "engine/utils/makeClassMethodsEnumerable" {
|
|
1382
1390
|
}
|
1383
1391
|
declare module "embed/Editor" {
|
1384
1392
|
import { Frame } from "embed/Frame";
|
1385
|
-
import { Config, ExportFromApiResult, ExportHtmlOptions, ExportHtmlResult, ExportImageFromApiOptions, ExportLiveHtmlOptions, ExportPdfFromApiOptions, ExportPlainTextOptions, ExportZipFromApiOptions, SaveDesignOptions } from "embed/Config";
|
1393
|
+
import { Config, ExportFromApiResult, ExportHtmlOptions, ExportHtmlResult, ExportPlainTextResult, ExportImageFromApiOptions, ExportLiveHtmlOptions, ExportPdfFromApiOptions, ExportPlainTextOptions, ExportZipFromApiOptions, SaveDesignOptions, ExportLiveHtmlResult } from "embed/Config";
|
1386
1394
|
import { AppearanceConfig, Audit, DesignTagsConfig, Device, DisplayConditions, DisplayMode, JSONTemplate, LinkTypes, LinkTypesSharedConfig, MergeTags, MergeTagsConfig, SpecialLink, Tabs, Translations, User, Validator } from "state/types/index";
|
1387
1395
|
import { BodyValues } from "engine/options/bodies";
|
1388
1396
|
import { Locale, TextDirection } from "engine/config/intl";
|
@@ -1422,13 +1430,11 @@ declare module "embed/Editor" {
|
|
1422
1430
|
loadDesign(design: JSONTemplate): void;
|
1423
1431
|
saveDesign(callback: Function, options?: SaveDesignOptions): void;
|
1424
1432
|
exportHtml(callback: (data: ExportHtmlResult) => void, options?: ExportHtmlOptions): void;
|
1425
|
-
exportLiveHtml(callback:
|
1426
|
-
exportPlainText(callback: (data:
|
1427
|
-
|
1428
|
-
|
1429
|
-
|
1430
|
-
exportPdf(callback: (data: ExportFromApiResult) => void, options: ExportPdfFromApiOptions): void;
|
1431
|
-
exportZip(callback: (data: ExportFromApiResult) => void, options: ExportZipFromApiOptions): void;
|
1433
|
+
exportLiveHtml(callback: (data: ExportLiveHtmlResult) => void, options?: ExportLiveHtmlOptions): void;
|
1434
|
+
exportPlainText(callback: (data: ExportPlainTextResult) => void, options?: ExportPlainTextOptions): void;
|
1435
|
+
exportImage(callback: (data: ExportFromApiResult) => void, options?: ExportImageFromApiOptions): void;
|
1436
|
+
exportPdf(callback: (data: ExportFromApiResult) => void, options?: ExportPdfFromApiOptions): void;
|
1437
|
+
exportZip(callback: (data: ExportFromApiResult) => void, options?: ExportZipFromApiOptions): void;
|
1432
1438
|
setAppearance(appearance: AppearanceConfig): void;
|
1433
1439
|
setBodyValues(bodyValues: Partial<BodyValues>, bodyId?: number): void;
|
1434
1440
|
setDesignTagsConfig(designTagsConfig: DesignTagsConfig): void;
|
package/package.json
CHANGED