@unlayer/types 1.489.0 → 1.491.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -62,6 +62,18 @@ function handleDesign(design: JSONTemplate) {
62
62
  }
63
63
  ```
64
64
 
65
+ ## Generated declaration formatting
66
+
67
+ The type builders write each member of a named union on its own line in
68
+ `__generated__/` and `dist/`, so adding or removing a value produces a small diff.
69
+ This package-local generation step runs after TypeScript emits declarations;
70
+ TypeScript otherwise collapses union members onto one line. Inline property and
71
+ parameter annotations keep their existing layout.
72
+
73
+ Run `pnpm --filter=@unlayer/types build` to regenerate the declarations and
74
+ `pnpm --filter=@unlayer/types test:unit` to check the formatter. Do not manually
75
+ reformat generated files or change the repository-wide Prettier configuration.
76
+
65
77
  ## License
66
78
 
67
79
  MIT
package/dist/design.d.ts CHANGED
@@ -62,7 +62,9 @@ type DesignCustomContentItem<
62
62
  values: ContentValues<TDisplayMode> & Record<string, unknown>;
63
63
  };
64
64
 
65
- export type DesignContentType = keyof ContentToolValuesMap | (string & {});
65
+ export type DesignContentType =
66
+ | keyof ContentToolValuesMap
67
+ | (string & {});
66
68
 
67
69
  type DesignBuiltInContentItem<
68
70
  TDisplayMode extends DisplayMode | undefined = undefined,
@@ -3,7 +3,9 @@
3
3
 
4
4
  export type { DesignBody, DesignColumn, DesignContentItem, DesignContentType, DesignRow, JSONTemplate } from '../design';
5
5
 
6
- export type DesignMode = 'live' | 'edit';
6
+ export type DesignMode =
7
+ | 'live'
8
+ | 'edit';
7
9
 
8
10
  export type DesignTag = string;
9
11
 
@@ -18,11 +18,30 @@ import type { BodyValues } from '../containers/body';
18
18
  import type { ColumnValues } from '../containers/column';
19
19
  import type { RowValues } from '../containers/row';
20
20
 
21
- type AICopilotDataType = 'template_block' | 'page_block' | 'body_block' | 'row_block' | 'header_block' | 'footer_block' | 'column_block' | 'content_block' | 'text' | 'import_html' | 'import_image';
22
-
23
- export type Container = 'body' | 'row' | 'column' | 'content';
24
-
25
- export type ImageSource = 'unsplash' | 'pixabay' | 'pexel' | 'user';
21
+ type AICopilotDataType =
22
+ | 'template_block'
23
+ | 'page_block'
24
+ | 'body_block'
25
+ | 'row_block'
26
+ | 'header_block'
27
+ | 'footer_block'
28
+ | 'column_block'
29
+ | 'content_block'
30
+ | 'text'
31
+ | 'import_html'
32
+ | 'import_image';
33
+
34
+ export type Container =
35
+ | 'body'
36
+ | 'row'
37
+ | 'column'
38
+ | 'content';
39
+
40
+ export type ImageSource =
41
+ | 'unsplash'
42
+ | 'pixabay'
43
+ | 'pexel'
44
+ | 'user';
26
45
 
27
46
  export interface ToolConfig {
28
47
  enabled?: boolean | undefined;
@@ -129,11 +148,127 @@ meta: {
129
148
  // Theme & Appearance
130
149
  // ───────────────────────────────────────────────────────────────────────────
131
150
 
132
- type AIProvider = 'openai' | 'anthropic' | 'google' | 'xai';
151
+ type AIProvider =
152
+ | 'openai'
153
+ | 'anthropic'
154
+ | 'google'
155
+ | 'xai';
133
156
 
134
157
  export type AIImageProvider = Extract<AIProvider, 'google' | 'openai'>;
135
158
 
136
- export type InboxPreviewClientId = 'android10_gmailapp_pixel4_dm' | 'android10_gmailapp_pixel4_lm' | 'android11_gmailapp_pixel5_dm' | 'android12_gmailapp_pixel6_dm' | 'android12_gmailapp_pixel6_lm' | 'android12_outlookapp_pixel6_dm' | 'android12_outlookapp_pixel6_lm' | 'android13_gmailapp_pixel7_dm' | 'android13_gmailapp_pixel7_lm' | 'android14_gmailapp_pixel8_dm' | 'android14_gmailapp_pixel8_lm' | 'android15_gmailapp_pixel9_dm' | 'android15_gmailapp_pixel9_lm' | 'android16_gmailapp_pixel10_dm' | 'android16_gmailapp_pixel10_lm' | 'aolcom-dm_chrcurrent_win10' | 'aolcom-dm_edgecurrent_win10' | 'aolcom-dm_ffcurrent_win10' | 'aolcom-lm_chrcurrent_win10' | 'aolcom-lm_edgecurrent_win10' | 'aolcom-lm_ffcurrent_win10' | 'applemail16' | 'applemail16_dm' | 'freefr-dm_chrcurrent_win10' | 'freefr-dm_edgecurrent_win10' | 'freefr-dm_ffcurrent_win10' | 'freefr-lm_chrcurrent_win10' | 'freefr-lm_edgecurrent_win10' | 'freefr-lm_ffcurrent_win10' | 'gmailcom-dm_chrcurrent_win10' | 'gmailcom-dm_edgecurrent_win10' | 'gmailcom-dm_ffcurrent_win10' | 'gmailcom-lm_chrcurrent_win10' | 'gmailcom-lm_edgecurrent_win10' | 'gmailcom-lm_ffcurrent_win10' | 'gmxnet-lm_chrcurrent_win10' | 'gmxnet-lm_edgecurrent_win10' | 'gmxnet-lm_ffcurrent_win10' | 'iphone13ol_15' | 'iphone13ol_15_dm' | 'iphone14_16' | 'iphone14_16_dm' | 'iphone14pro_16' | 'iphone14pro_16_dm' | 'iphone14promax_16' | 'iphone14promax_16_dm' | 'iphone15_17' | 'iphone15_17_dm' | 'iphone15plus_17' | 'iphone15plus_17_dm' | 'iphone15pro_17' | 'iphone15pro_17_dm' | 'iphone15promax_17' | 'iphone15promax_17_dm' | 'iphone16_18' | 'iphone16_18_dm' | 'iphone16gmail_18' | 'iphone16gmail_18_dm' | 'iphone16gmail_26' | 'iphone16gmail_26_dm' | 'iphone16pro_18' | 'iphone16pro_18_dm' | 'iphone16promax_18' | 'iphone16promax_18_dm' | 'iphone17_26' | 'iphone17_26_dm' | 'iphone17pro_26' | 'iphone17pro_26_dm' | 'iphone17promax_26' | 'iphone17promax_26_dm' | 'liberoit-lm_chrcurrent_win10' | 'liberoit-lm_edgecurrent_win10' | 'liberoit-lm_ffcurrent_win10' | 'm365_mac13_dm_dt' | 'm365_mac13_lm_dt' | 'm365_w11_dm_dt' | 'm365_w11_lm_dt' | 'm365com-dm_chrcurrent_win10' | 'm365com-dm_edgecurrent_win10' | 'm365com-dm_ffcurrent_win10' | 'm365com-lm_chrcurrent_win10' | 'm365com-lm_edgecurrent_win10' | 'm365com-lm_ffcurrent_win10' | 'o365_w10_dm_dt' | 'o365_w10_lm_dt' | 'outlook16_win10' | 'outlook16_win10_125' | 'outlook19' | 'outlook19_125' | 'outlook2021_win11_dm_dt' | 'outlook2021_win11_lm_dt' | 'outlook2024_win_dm_dt' | 'outlook2024_win_lm_dt' | 'outlookcom-dm_chrcurrent_win10' | 'outlookcom-dm_edgecurrent_win10' | 'outlookcom-dm_ffcurrent_win10' | 'outlookcom-lm_chrcurrent_win10' | 'outlookcom-lm_edgecurrent_win10' | 'outlookcom-lm_ffcurrent_win10' | 'tonlinede-lm_chrcurrent_win10' | 'tonlinede-lm_edgecurrent_win10' | 'tonlinede-lm_ffcurrent_win10' | 'webde-lm_chrcurrent_win10' | 'webde-lm_edgecurrent_win10' | 'webde-lm_ffcurrent_win10' | 'yahoocom-dm_chrcurrent_win10' | 'yahoocom-dm_edgecurrent_win10' | 'yahoocom-dm_ffcurrent_win10' | 'yahoocom-lm_chrcurrent_win10' | 'yahoocom-lm_edgecurrent_win10' | 'yahoocom-lm_ffcurrent_win10' | (string & {});
159
+ export type InboxPreviewClientId =
160
+ | 'android10_gmailapp_pixel4_dm'
161
+ | 'android10_gmailapp_pixel4_lm'
162
+ | 'android11_gmailapp_pixel5_dm'
163
+ | 'android12_gmailapp_pixel6_dm'
164
+ | 'android12_gmailapp_pixel6_lm'
165
+ | 'android12_outlookapp_pixel6_dm'
166
+ | 'android12_outlookapp_pixel6_lm'
167
+ | 'android13_gmailapp_pixel7_dm'
168
+ | 'android13_gmailapp_pixel7_lm'
169
+ | 'android14_gmailapp_pixel8_dm'
170
+ | 'android14_gmailapp_pixel8_lm'
171
+ | 'android15_gmailapp_pixel9_dm'
172
+ | 'android15_gmailapp_pixel9_lm'
173
+ | 'android16_gmailapp_pixel10_dm'
174
+ | 'android16_gmailapp_pixel10_lm'
175
+ | 'aolcom-dm_chrcurrent_win10'
176
+ | 'aolcom-dm_edgecurrent_win10'
177
+ | 'aolcom-dm_ffcurrent_win10'
178
+ | 'aolcom-lm_chrcurrent_win10'
179
+ | 'aolcom-lm_edgecurrent_win10'
180
+ | 'aolcom-lm_ffcurrent_win10'
181
+ | 'applemail16'
182
+ | 'applemail16_dm'
183
+ | 'freefr-dm_chrcurrent_win10'
184
+ | 'freefr-dm_edgecurrent_win10'
185
+ | 'freefr-dm_ffcurrent_win10'
186
+ | 'freefr-lm_chrcurrent_win10'
187
+ | 'freefr-lm_edgecurrent_win10'
188
+ | 'freefr-lm_ffcurrent_win10'
189
+ | 'gmailcom-dm_chrcurrent_win10'
190
+ | 'gmailcom-dm_edgecurrent_win10'
191
+ | 'gmailcom-dm_ffcurrent_win10'
192
+ | 'gmailcom-lm_chrcurrent_win10'
193
+ | 'gmailcom-lm_edgecurrent_win10'
194
+ | 'gmailcom-lm_ffcurrent_win10'
195
+ | 'gmxnet-lm_chrcurrent_win10'
196
+ | 'gmxnet-lm_edgecurrent_win10'
197
+ | 'gmxnet-lm_ffcurrent_win10'
198
+ | 'iphone13ol_15'
199
+ | 'iphone13ol_15_dm'
200
+ | 'iphone14_16'
201
+ | 'iphone14_16_dm'
202
+ | 'iphone14pro_16'
203
+ | 'iphone14pro_16_dm'
204
+ | 'iphone14promax_16'
205
+ | 'iphone14promax_16_dm'
206
+ | 'iphone15_17'
207
+ | 'iphone15_17_dm'
208
+ | 'iphone15plus_17'
209
+ | 'iphone15plus_17_dm'
210
+ | 'iphone15pro_17'
211
+ | 'iphone15pro_17_dm'
212
+ | 'iphone15promax_17'
213
+ | 'iphone15promax_17_dm'
214
+ | 'iphone16_18'
215
+ | 'iphone16_18_dm'
216
+ | 'iphone16gmail_18'
217
+ | 'iphone16gmail_18_dm'
218
+ | 'iphone16gmail_26'
219
+ | 'iphone16gmail_26_dm'
220
+ | 'iphone16pro_18'
221
+ | 'iphone16pro_18_dm'
222
+ | 'iphone16promax_18'
223
+ | 'iphone16promax_18_dm'
224
+ | 'iphone17_26'
225
+ | 'iphone17_26_dm'
226
+ | 'iphone17pro_26'
227
+ | 'iphone17pro_26_dm'
228
+ | 'iphone17promax_26'
229
+ | 'iphone17promax_26_dm'
230
+ | 'liberoit-lm_chrcurrent_win10'
231
+ | 'liberoit-lm_edgecurrent_win10'
232
+ | 'liberoit-lm_ffcurrent_win10'
233
+ | 'm365_mac13_dm_dt'
234
+ | 'm365_mac13_lm_dt'
235
+ | 'm365_w11_dm_dt'
236
+ | 'm365_w11_lm_dt'
237
+ | 'm365com-dm_chrcurrent_win10'
238
+ | 'm365com-dm_edgecurrent_win10'
239
+ | 'm365com-dm_ffcurrent_win10'
240
+ | 'm365com-lm_chrcurrent_win10'
241
+ | 'm365com-lm_edgecurrent_win10'
242
+ | 'm365com-lm_ffcurrent_win10'
243
+ | 'o365_w10_dm_dt'
244
+ | 'o365_w10_lm_dt'
245
+ | 'outlook16_win10'
246
+ | 'outlook16_win10_125'
247
+ | 'outlook19'
248
+ | 'outlook19_125'
249
+ | 'outlook2021_win11_dm_dt'
250
+ | 'outlook2021_win11_lm_dt'
251
+ | 'outlook2024_win_dm_dt'
252
+ | 'outlook2024_win_lm_dt'
253
+ | 'outlookcom-dm_chrcurrent_win10'
254
+ | 'outlookcom-dm_edgecurrent_win10'
255
+ | 'outlookcom-dm_ffcurrent_win10'
256
+ | 'outlookcom-lm_chrcurrent_win10'
257
+ | 'outlookcom-lm_edgecurrent_win10'
258
+ | 'outlookcom-lm_ffcurrent_win10'
259
+ | 'tonlinede-lm_chrcurrent_win10'
260
+ | 'tonlinede-lm_edgecurrent_win10'
261
+ | 'tonlinede-lm_ffcurrent_win10'
262
+ | 'webde-lm_chrcurrent_win10'
263
+ | 'webde-lm_edgecurrent_win10'
264
+ | 'webde-lm_ffcurrent_win10'
265
+ | 'yahoocom-dm_chrcurrent_win10'
266
+ | 'yahoocom-dm_edgecurrent_win10'
267
+ | 'yahoocom-dm_ffcurrent_win10'
268
+ | 'yahoocom-lm_chrcurrent_win10'
269
+ | 'yahoocom-lm_edgecurrent_win10'
270
+ | 'yahoocom-lm_ffcurrent_win10'
271
+ | (string & {});
137
272
 
138
273
  interface Config {
139
274
  id?: string;
@@ -385,7 +520,10 @@ export type CreditPurchaseHandler = (
385
520
  request: CreditPurchaseRequest,
386
521
  ) => CreditPurchaseResult | Promise<CreditPurchaseResult>;
387
522
 
388
- export type CreditPurchaseReason = 'low_balance' | 'exhausted' | 'disabled';
523
+ export type CreditPurchaseReason =
524
+ | 'low_balance'
525
+ | 'exhausted'
526
+ | 'disabled';
389
527
 
390
528
  export type CreditResource = 'ai';
391
529
 
@@ -552,5 +690,11 @@ type WidgetComponentClass = any & {
552
690
  schema?: Record<string, unknown> | null;
553
691
  };
554
692
 
555
- type AIFeatureType = 'full_template_gen' | 'block_edit' | 'html_import' | 'image_import' | 'image_generation' | 'image_edit';
693
+ type AIFeatureType =
694
+ | 'full_template_gen'
695
+ | 'block_edit'
696
+ | 'html_import'
697
+ | 'image_import'
698
+ | 'image_generation'
699
+ | 'image_edit';
556
700
  /** Token usage payload reported by the AI Assistant pipeline. */
@@ -16,13 +16,21 @@ export interface Image {
16
16
  optimistic?: boolean;
17
17
  }
18
18
 
19
- export type AICopilotModel = `${AIProvider}/${string}` | (string & {});
19
+ export type AICopilotModel =
20
+ | `${AIProvider}/${string}`
21
+ | (string & {});
20
22
 
21
- export type AIFallbackModels = boolean | AICopilotModel[];
23
+ export type AIFallbackModels =
24
+ | boolean
25
+ | AICopilotModel[];
22
26
 
23
- export type AIImageModel = `${AIImageProvider}/${string}` | (string & {});
27
+ export type AIImageModel =
28
+ | `${AIImageProvider}/${string}`
29
+ | (string & {});
24
30
 
25
- export type AIImageFallbackModels = boolean | AIImageModel[];
31
+ export type AIImageFallbackModels =
32
+ | boolean
33
+ | AIImageModel[];
26
34
 
27
35
  export interface AIBrand {
28
36
  companyName?: string;
@@ -77,7 +85,9 @@ export interface ColorPicker {
77
85
  recentColors?: boolean | null;
78
86
  }
79
87
 
80
- export type ImageEditorToolConfig = boolean | {
88
+ export type ImageEditorToolConfig =
89
+ | boolean
90
+ | {
81
91
  enabled?: boolean;
82
92
  icon?: string;
83
93
  };
@@ -89,7 +99,9 @@ export type ImageEditorToolConfig = boolean | {
89
99
  * forward-compatible with newer IDs returned by the live clients endpoint.
90
100
  */
91
101
 
92
- export type InboxPreviewsFeature = boolean | {
102
+ export type InboxPreviewsFeature =
103
+ | boolean
104
+ | {
93
105
  enabled?: boolean;
94
106
  /**
95
107
  * Email clients requested for runs from this editor instance. This