@mediaclip/designer-api 14.0.0-beta.26190 → 14.0.0-cd.26343
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 +7 -7
- package/designer-api.d.ts +442 -444
- package/index.js +0 -0
- package/package.json +15 -13
package/README.md
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
# Mediaclip Designer Javascript API Typings
|
|
2
|
-
|
|
3
|
-
Learn more about Mediaclip Designer Javascript API at [doc.mediaclip.ca](https://doc.mediaclip.ca/designer/api/).
|
|
4
|
-
|
|
5
|
-
```bash
|
|
6
|
-
npm i @mediaclip/designer-api
|
|
7
|
-
```
|
|
1
|
+
# Mediaclip Designer Javascript API Typings
|
|
2
|
+
|
|
3
|
+
Learn more about Mediaclip Designer Javascript API at [doc.mediaclip.ca](https://doc.mediaclip.ca/designer/api/).
|
|
4
|
+
|
|
5
|
+
```bash
|
|
6
|
+
npm i @mediaclip/designer-api
|
|
7
|
+
```
|
package/designer-api.d.ts
CHANGED
|
@@ -1,444 +1,442 @@
|
|
|
1
|
-
export class UploadUrlWrapper {
|
|
2
|
-
removeQueryParam:(key:string) => void;
|
|
3
|
-
addQueryParam:(key:string, value:string) => void;
|
|
4
|
-
get:() => string;
|
|
5
|
-
set:(url:string) => void;
|
|
6
|
-
}
|
|
7
|
-
|
|
8
|
-
export declare class Deferred<T> {
|
|
9
|
-
promise:Promise<T>;
|
|
10
|
-
resolve:(value?:T) => void;
|
|
11
|
-
reject:(reason?:string) => void;
|
|
12
|
-
}
|
|
13
|
-
|
|
14
|
-
export declare class RetryableRequestError {
|
|
15
|
-
details:string;
|
|
16
|
-
message:string;
|
|
17
|
-
status:number;
|
|
18
|
-
error:any;
|
|
19
|
-
url:string;
|
|
20
|
-
}
|
|
21
|
-
|
|
22
|
-
export class RemoteObject {
|
|
23
|
-
$type:string;
|
|
24
|
-
|
|
25
|
-
toJSON():any;
|
|
26
|
-
}
|
|
27
|
-
|
|
28
|
-
export class AutofillOption extends RemoteObject {
|
|
29
|
-
id:string;
|
|
30
|
-
value:string;
|
|
31
|
-
}
|
|
32
|
-
|
|
33
|
-
export class AutofillSourceItem extends RemoteObject {
|
|
34
|
-
photo:string;
|
|
35
|
-
}
|
|
36
|
-
|
|
37
|
-
export class AutofillSourceSet extends RemoteObject {
|
|
38
|
-
id:string;
|
|
39
|
-
items:AutofillSourceItem[];
|
|
40
|
-
}
|
|
41
|
-
|
|
42
|
-
export class AutofillSource extends RemoteObject {
|
|
43
|
-
sets:AutofillSourceSet[];
|
|
44
|
-
options?:AutofillOption[];
|
|
45
|
-
}
|
|
46
|
-
|
|
47
|
-
export class AutofillData {
|
|
48
|
-
show:boolean;
|
|
49
|
-
autofillSource?:AutofillSource;
|
|
50
|
-
}
|
|
51
|
-
|
|
52
|
-
export class AutofillSpecificationsSet {
|
|
53
|
-
id:string;
|
|
54
|
-
min:number;
|
|
55
|
-
max:number;
|
|
56
|
-
full:number;
|
|
57
|
-
dynamicClustering:boolean;
|
|
58
|
-
}
|
|
59
|
-
|
|
60
|
-
export class AutofillSpecifications {
|
|
61
|
-
sets:AutofillSpecificationsSet[];
|
|
62
|
-
}
|
|
63
|
-
|
|
64
|
-
export class VariableDataRowField {
|
|
65
|
-
id?:string;
|
|
66
|
-
value?:string;
|
|
67
|
-
}
|
|
68
|
-
|
|
69
|
-
export class VariableDataRow {
|
|
70
|
-
id?:string;
|
|
71
|
-
fields?:VariableDataRowField[];
|
|
72
|
-
}
|
|
73
|
-
|
|
74
|
-
export class VariableData {
|
|
75
|
-
blankRowCount:number;
|
|
76
|
-
checkSum:string;
|
|
77
|
-
dataName?:string;
|
|
78
|
-
variableDataResourceUrl?:string;
|
|
79
|
-
rows?:VariableDataRow[];
|
|
80
|
-
uploadedFilename?:string;
|
|
81
|
-
}
|
|
82
|
-
|
|
83
|
-
interface KeyValue<K, V> {
|
|
84
|
-
key:K;
|
|
85
|
-
value:V;
|
|
86
|
-
}
|
|
87
|
-
|
|
88
|
-
export class Metadata {
|
|
89
|
-
title:string;
|
|
90
|
-
syncTexts:KeyValue<string, string>[];
|
|
91
|
-
}
|
|
92
|
-
|
|
93
|
-
export class PhotoSelection extends RemoteObject {
|
|
94
|
-
name:string;
|
|
95
|
-
photos:string[];
|
|
96
|
-
}
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
|
|
328
|
-
|
|
329
|
-
|
|
330
|
-
|
|
331
|
-
|
|
332
|
-
|
|
333
|
-
|
|
334
|
-
|
|
335
|
-
|
|
336
|
-
|
|
337
|
-
|
|
338
|
-
|
|
339
|
-
|
|
340
|
-
|
|
341
|
-
|
|
342
|
-
|
|
343
|
-
|
|
344
|
-
|
|
345
|
-
|
|
346
|
-
|
|
347
|
-
|
|
348
|
-
|
|
349
|
-
|
|
350
|
-
|
|
351
|
-
|
|
352
|
-
|
|
353
|
-
|
|
354
|
-
|
|
355
|
-
|
|
356
|
-
|
|
357
|
-
|
|
358
|
-
|
|
359
|
-
|
|
360
|
-
|
|
361
|
-
|
|
362
|
-
|
|
363
|
-
|
|
364
|
-
|
|
365
|
-
|
|
366
|
-
|
|
367
|
-
|
|
368
|
-
|
|
369
|
-
|
|
370
|
-
|
|
371
|
-
|
|
372
|
-
|
|
373
|
-
|
|
374
|
-
|
|
375
|
-
|
|
376
|
-
|
|
377
|
-
|
|
378
|
-
|
|
379
|
-
|
|
380
|
-
|
|
381
|
-
|
|
382
|
-
|
|
383
|
-
|
|
384
|
-
|
|
385
|
-
|
|
386
|
-
|
|
387
|
-
|
|
388
|
-
|
|
389
|
-
|
|
390
|
-
|
|
391
|
-
|
|
392
|
-
|
|
393
|
-
|
|
394
|
-
|
|
395
|
-
|
|
396
|
-
|
|
397
|
-
|
|
398
|
-
|
|
399
|
-
|
|
400
|
-
|
|
401
|
-
|
|
402
|
-
|
|
403
|
-
|
|
404
|
-
|
|
405
|
-
|
|
406
|
-
|
|
407
|
-
|
|
408
|
-
|
|
409
|
-
|
|
410
|
-
|
|
411
|
-
|
|
412
|
-
|
|
413
|
-
|
|
414
|
-
|
|
415
|
-
|
|
416
|
-
|
|
417
|
-
|
|
418
|
-
|
|
419
|
-
|
|
420
|
-
|
|
421
|
-
|
|
422
|
-
|
|
423
|
-
|
|
424
|
-
|
|
425
|
-
|
|
426
|
-
|
|
427
|
-
|
|
428
|
-
|
|
429
|
-
|
|
430
|
-
|
|
431
|
-
|
|
432
|
-
|
|
433
|
-
|
|
434
|
-
|
|
435
|
-
|
|
436
|
-
|
|
437
|
-
|
|
438
|
-
|
|
439
|
-
|
|
440
|
-
|
|
441
|
-
|
|
442
|
-
|
|
443
|
-
let mediaclip:IMediaclip;
|
|
444
|
-
}
|
|
1
|
+
export class UploadUrlWrapper {
|
|
2
|
+
removeQueryParam:(key:string) => void;
|
|
3
|
+
addQueryParam:(key:string, value:string) => void;
|
|
4
|
+
get:() => string;
|
|
5
|
+
set:(url:string) => void;
|
|
6
|
+
}
|
|
7
|
+
|
|
8
|
+
export declare class Deferred<T> {
|
|
9
|
+
promise:Promise<T>;
|
|
10
|
+
resolve:(value?:T) => void;
|
|
11
|
+
reject:(reason?:string) => void;
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
export declare class RetryableRequestError {
|
|
15
|
+
details:string;
|
|
16
|
+
message:string;
|
|
17
|
+
status:number;
|
|
18
|
+
error:any;
|
|
19
|
+
url:string;
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
export class RemoteObject {
|
|
23
|
+
$type:string;
|
|
24
|
+
|
|
25
|
+
toJSON():any;
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
export class AutofillOption extends RemoteObject {
|
|
29
|
+
id:string;
|
|
30
|
+
value:string;
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
export class AutofillSourceItem extends RemoteObject {
|
|
34
|
+
photo:string;
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
export class AutofillSourceSet extends RemoteObject {
|
|
38
|
+
id:string;
|
|
39
|
+
items:AutofillSourceItem[];
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
export class AutofillSource extends RemoteObject {
|
|
43
|
+
sets:AutofillSourceSet[];
|
|
44
|
+
options?:AutofillOption[];
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
export class AutofillData {
|
|
48
|
+
show:boolean;
|
|
49
|
+
autofillSource?:AutofillSource;
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
export class AutofillSpecificationsSet {
|
|
53
|
+
id:string;
|
|
54
|
+
min:number;
|
|
55
|
+
max:number;
|
|
56
|
+
full:number;
|
|
57
|
+
dynamicClustering:boolean;
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
export class AutofillSpecifications {
|
|
61
|
+
sets:AutofillSpecificationsSet[];
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
export class VariableDataRowField {
|
|
65
|
+
id?:string;
|
|
66
|
+
value?:string;
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
export class VariableDataRow {
|
|
70
|
+
id?:string;
|
|
71
|
+
fields?:VariableDataRowField[];
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
export class VariableData {
|
|
75
|
+
blankRowCount:number;
|
|
76
|
+
checkSum:string;
|
|
77
|
+
dataName?:string;
|
|
78
|
+
variableDataResourceUrl?:string;
|
|
79
|
+
rows?:VariableDataRow[];
|
|
80
|
+
uploadedFilename?:string;
|
|
81
|
+
}
|
|
82
|
+
|
|
83
|
+
interface KeyValue<K, V> {
|
|
84
|
+
key:K;
|
|
85
|
+
value:V;
|
|
86
|
+
}
|
|
87
|
+
|
|
88
|
+
export class Metadata {
|
|
89
|
+
title:string;
|
|
90
|
+
syncTexts:KeyValue<string, string>[];
|
|
91
|
+
}
|
|
92
|
+
|
|
93
|
+
export class PhotoSelection extends RemoteObject {
|
|
94
|
+
name:string;
|
|
95
|
+
photos:string[];
|
|
96
|
+
}
|
|
97
|
+
export type StepNames =
|
|
98
|
+
| 'PRODUCT_SELECTION'
|
|
99
|
+
| 'EDITION'
|
|
100
|
+
| 'THEME_SELECTION'
|
|
101
|
+
| 'ALTERNATIVE_PRODUCTS'
|
|
102
|
+
| 'CUSTOMIZE'
|
|
103
|
+
| 'FORM'
|
|
104
|
+
| 'CONTACTS'
|
|
105
|
+
;
|
|
106
|
+
|
|
107
|
+
export class State extends RemoteObject {
|
|
108
|
+
generatedStep:StepNames;
|
|
109
|
+
step:StepNames;
|
|
110
|
+
themeUrl:string;
|
|
111
|
+
creationVersion:string;
|
|
112
|
+
lastEditVersion:string;
|
|
113
|
+
uploads:PhotoSelection;
|
|
114
|
+
selection:PhotoSelection;
|
|
115
|
+
}
|
|
116
|
+
|
|
117
|
+
export class Project extends RemoteObject {
|
|
118
|
+
id:string;
|
|
119
|
+
metadata:Metadata;
|
|
120
|
+
productId:string;
|
|
121
|
+
externalProductId:string;
|
|
122
|
+
plu:string;
|
|
123
|
+
quantity:number;
|
|
124
|
+
state:State;
|
|
125
|
+
variableData?:VariableData;
|
|
126
|
+
}
|
|
127
|
+
|
|
128
|
+
export interface ICommand {
|
|
129
|
+
}
|
|
130
|
+
|
|
131
|
+
export interface ICommandContainer {
|
|
132
|
+
command:ICommand;
|
|
133
|
+
}
|
|
134
|
+
|
|
135
|
+
export class AddToCartResult {
|
|
136
|
+
redirectUrl:string;
|
|
137
|
+
data?:Record<string, string>;
|
|
138
|
+
}
|
|
139
|
+
|
|
140
|
+
export class SaveResult {
|
|
141
|
+
data?:Record<string, string>;
|
|
142
|
+
}
|
|
143
|
+
|
|
144
|
+
export class SaveResultCommandContainer extends SaveResult implements ICommandContainer {
|
|
145
|
+
command:ICommand;
|
|
146
|
+
}
|
|
147
|
+
|
|
148
|
+
export type SaveTrigger =
|
|
149
|
+
| 'undefined'
|
|
150
|
+
| 'user'
|
|
151
|
+
| 'stepchange'
|
|
152
|
+
| 'auto'
|
|
153
|
+
| 'addtocart'
|
|
154
|
+
| 'hook'
|
|
155
|
+
| 'redirect';
|
|
156
|
+
|
|
157
|
+
export interface INode {
|
|
158
|
+
}
|
|
159
|
+
|
|
160
|
+
export interface ICategory<T extends INode> extends INode {
|
|
161
|
+
loaded:boolean;
|
|
162
|
+
nodes:T[];
|
|
163
|
+
unavailable:boolean;
|
|
164
|
+
}
|
|
165
|
+
|
|
166
|
+
export class Category<T extends INode> implements ICategory<T> {
|
|
167
|
+
id:string;
|
|
168
|
+
label:string;
|
|
169
|
+
nodesLabel:string;
|
|
170
|
+
nodes:T[];
|
|
171
|
+
loaded:boolean;
|
|
172
|
+
urlThumb:string;
|
|
173
|
+
unavailable:boolean;
|
|
174
|
+
}
|
|
175
|
+
|
|
176
|
+
export enum AlbumDisplay {
|
|
177
|
+
FillIn = 0,
|
|
178
|
+
FitIn = 1,
|
|
179
|
+
Hidden = 2
|
|
180
|
+
}
|
|
181
|
+
|
|
182
|
+
export interface IPhotoNode extends INode {
|
|
183
|
+
}
|
|
184
|
+
|
|
185
|
+
export class Album extends Category<IPhotoNode> implements IPhotoNode {
|
|
186
|
+
display:AlbumDisplay;
|
|
187
|
+
isRoot:boolean;
|
|
188
|
+
labelKey:string;
|
|
189
|
+
}
|
|
190
|
+
|
|
191
|
+
export interface IPhoto {
|
|
192
|
+
filename:string;
|
|
193
|
+
originalFilename?:string;
|
|
194
|
+
urlThumb:string;
|
|
195
|
+
}
|
|
196
|
+
|
|
197
|
+
export class UploadingPhoto implements IPhoto, IPhotoNode {
|
|
198
|
+
filename:string;
|
|
199
|
+
originalFilename?:string;
|
|
200
|
+
uploadId:string;
|
|
201
|
+
urlThumb:string;
|
|
202
|
+
}
|
|
203
|
+
|
|
204
|
+
export class Item implements INode {
|
|
205
|
+
}
|
|
206
|
+
|
|
207
|
+
export interface IImageItem {
|
|
208
|
+
filename:string;
|
|
209
|
+
width:number;
|
|
210
|
+
height:number;
|
|
211
|
+
urlThumb:string;
|
|
212
|
+
}
|
|
213
|
+
|
|
214
|
+
export class AutoCrop {
|
|
215
|
+
x:number;
|
|
216
|
+
y:number;
|
|
217
|
+
width:number;
|
|
218
|
+
height:number;
|
|
219
|
+
}
|
|
220
|
+
|
|
221
|
+
export class PhotoVersion {
|
|
222
|
+
width:number;
|
|
223
|
+
height:number;
|
|
224
|
+
path:string;
|
|
225
|
+
}
|
|
226
|
+
|
|
227
|
+
export class PhotoMetadata {
|
|
228
|
+
key:string;
|
|
229
|
+
value:string;
|
|
230
|
+
}
|
|
231
|
+
|
|
232
|
+
export class Photo extends Item implements IPhotoNode, IImageItem, IPhoto {
|
|
233
|
+
filename:string;
|
|
234
|
+
width:number;
|
|
235
|
+
height:number;
|
|
236
|
+
urlWeb?:string;
|
|
237
|
+
urlThumb:string;
|
|
238
|
+
autoCrops?:AutoCrop[];
|
|
239
|
+
dateTaken?:string;
|
|
240
|
+
filtersUrlWeb?:string;
|
|
241
|
+
local:boolean;
|
|
242
|
+
originalFilename?:string;
|
|
243
|
+
partial:boolean;
|
|
244
|
+
versions?:PhotoVersion[];
|
|
245
|
+
metadata?:PhotoMetadata[];
|
|
246
|
+
}
|
|
247
|
+
|
|
248
|
+
export class PhotoSource extends Album {
|
|
249
|
+
allowSizeInQuery:boolean;
|
|
250
|
+
allowUploads:boolean;
|
|
251
|
+
signOutUrl:string;
|
|
252
|
+
details:string;
|
|
253
|
+
}
|
|
254
|
+
|
|
255
|
+
export class Size {
|
|
256
|
+
width:number;
|
|
257
|
+
height:number;
|
|
258
|
+
}
|
|
259
|
+
|
|
260
|
+
export class ImageSize extends Size {
|
|
261
|
+
filename:string;
|
|
262
|
+
width:number;
|
|
263
|
+
height:number;
|
|
264
|
+
}
|
|
265
|
+
|
|
266
|
+
export class PendingPhoto {
|
|
267
|
+
originalFilename?:string;
|
|
268
|
+
urlThumb?:string;
|
|
269
|
+
get:() => Promise<{
|
|
270
|
+
filename:string;
|
|
271
|
+
remaining:number;
|
|
272
|
+
}>;
|
|
273
|
+
getPreview?:(width:number, height:number) => Promise<Blob>;
|
|
274
|
+
}
|
|
275
|
+
|
|
276
|
+
export interface IDesignerFunctions {
|
|
277
|
+
addPendingPhotos(pendingPhotos:PendingPhoto[], skipAutofill:boolean):void;
|
|
278
|
+
addPhotosToProject(photosToAdd:AutofillSource):void;
|
|
279
|
+
addPhotosToSelection(filenames:string[]):void;
|
|
280
|
+
addToCart():boolean;
|
|
281
|
+
changeProduct(productId:string, externalProductId:string):void;
|
|
282
|
+
disableExitWarning():void;
|
|
283
|
+
getBeautyShot(onSuccess:Function, onFailure:Function, index?:number, maxWidth?:number, maxHeight?:number):void;
|
|
284
|
+
getPhotoByFilename(filename:string):Partial<Photo>;
|
|
285
|
+
getPhotosFromSelection():string[];
|
|
286
|
+
getProjectPhotos():ImageSize[];
|
|
287
|
+
hasEmptyElements(checkForPhotos:boolean, checkForTexts:boolean, includeOptionalElements:boolean):boolean;
|
|
288
|
+
lock():void;
|
|
289
|
+
navigateAlbums(cat:any[]):void;
|
|
290
|
+
reloadAlbums():void;
|
|
291
|
+
replacePhotoFilename(from:string, to:string):Promise<void>;
|
|
292
|
+
retryFailedRequests():void;
|
|
293
|
+
save():void;
|
|
294
|
+
setCorrelationId(id:string | undefined):void;
|
|
295
|
+
unlock():void;
|
|
296
|
+
updateAuthorizationHeader(authorizationHeader:string):void;
|
|
297
|
+
updateSessionId(id:string):void;
|
|
298
|
+
}
|
|
299
|
+
|
|
300
|
+
export interface IDesignerEvents {
|
|
301
|
+
onAddToCart:(deferred:Deferred<string>, project:Project) => boolean;
|
|
302
|
+
onAddToCartComplete:(url:string, result:AddToCartResult) => boolean;
|
|
303
|
+
onAppEvent:(event:string, data:any) => void;
|
|
304
|
+
onBeforeAutofill:(deferred:Deferred<AutofillData>, specs:AutofillSpecifications) => boolean;
|
|
305
|
+
onBeforeRequest:(deferred:Deferred<void>) => boolean;
|
|
306
|
+
onBeforeUpload:(file:{ filename:string }, xhr:XMLHttpRequest, formData:FormData, url:UploadUrlWrapper) => void;
|
|
307
|
+
onError:(message:string, error:Error) => boolean;
|
|
308
|
+
onFailedRequest:(error:RetryableRequestError) => boolean;
|
|
309
|
+
onGetAlbum:(deferred:Deferred<Album>, parentId:string) => boolean;
|
|
310
|
+
onGetPhotos:(deferred:Deferred<Photo[]>, filenames:string[]) => boolean;
|
|
311
|
+
onGetPhotosSubset:(deferred:Deferred<Photo[]>, filenames:string[]) => boolean;
|
|
312
|
+
onGetPhotoSources:(deferred:Deferred<PhotoSource[]>) => boolean;
|
|
313
|
+
onLoad:(deferred:Deferred<Project>, projectName:string) => boolean;
|
|
314
|
+
onGetRecoveryId:() => string;
|
|
315
|
+
onReady:(deferred:Deferred<void>) => boolean;
|
|
316
|
+
onRedirect:(url:string) => boolean;
|
|
317
|
+
onReload:() => boolean;
|
|
318
|
+
onSave:(deferred:Deferred<Partial<SaveResultCommandContainer>>, project:Project, trigger:SaveTrigger) => boolean;
|
|
319
|
+
onSaveComplete:(trigger:SaveTrigger, result:SaveResult) => boolean;
|
|
320
|
+
onTrackPageView:(moduleName:string, stepName:StepNames, productId?:string, themeUrl?:string) => boolean;
|
|
321
|
+
onUploadComplete:(uploadResponse:string) => boolean;
|
|
322
|
+
onUploadPhotos:(url:string) => boolean;
|
|
323
|
+
}
|
|
324
|
+
|
|
325
|
+
export type ColorTheme =
|
|
326
|
+
| 'auto'
|
|
327
|
+
| 'light'
|
|
328
|
+
| 'dark'
|
|
329
|
+
;
|
|
330
|
+
|
|
331
|
+
export interface IMediaclipConfig {
|
|
332
|
+
allowedDomains?:string[];
|
|
333
|
+
browserNotSupportedRedirectUrl?:string;
|
|
334
|
+
clientId?:string;
|
|
335
|
+
defaultCulture?:string;
|
|
336
|
+
ecbUrl:string;
|
|
337
|
+
logToEcb?:boolean;
|
|
338
|
+
autoRetry?:{
|
|
339
|
+
statusCodes:number[];
|
|
340
|
+
delay:number;
|
|
341
|
+
};
|
|
342
|
+
uploader?:{
|
|
343
|
+
enabled:boolean;
|
|
344
|
+
parallelUploads:number;
|
|
345
|
+
acceptFileTypes?:string;
|
|
346
|
+
maxFileSize?:number;
|
|
347
|
+
maxFileSizeForPreview?:number;
|
|
348
|
+
multipart:boolean;
|
|
349
|
+
backgroundUploader?:{
|
|
350
|
+
minSourceFileSize:number;
|
|
351
|
+
minSourceImageDimension:number;
|
|
352
|
+
resizeToImageDimension:number;
|
|
353
|
+
};
|
|
354
|
+
resizer?:{
|
|
355
|
+
enabled:boolean;
|
|
356
|
+
maxDimension:number;
|
|
357
|
+
};
|
|
358
|
+
};
|
|
359
|
+
settings?:{
|
|
360
|
+
alwaysAllowAutofill?:boolean;
|
|
361
|
+
autoSave?:number;
|
|
362
|
+
colorTheme?:ColorTheme;
|
|
363
|
+
enableFreeForm?:boolean;
|
|
364
|
+
enableProjectAlbum?:boolean;
|
|
365
|
+
enableProductTour?:boolean;
|
|
366
|
+
showPrice?:boolean;
|
|
367
|
+
sidePanelDock?:'left' | 'right';
|
|
368
|
+
textAutoZoomThreshold?:number;
|
|
369
|
+
features?:{
|
|
370
|
+
background?:boolean;
|
|
371
|
+
border?:boolean;
|
|
372
|
+
clipart?:boolean;
|
|
373
|
+
event?:boolean;
|
|
374
|
+
filter?:boolean;
|
|
375
|
+
layout?:boolean;
|
|
376
|
+
option?:boolean;
|
|
377
|
+
photo?:boolean;
|
|
378
|
+
style?:boolean;
|
|
379
|
+
text?:boolean;
|
|
380
|
+
allowAutofill?:boolean;
|
|
381
|
+
allowAutoFontSize?:boolean;
|
|
382
|
+
allowChangeYear?:boolean;
|
|
383
|
+
allowFittingModeChangesInPrintModule?:boolean;
|
|
384
|
+
alwaysShowMargins?:boolean;
|
|
385
|
+
autoLayout?:boolean;
|
|
386
|
+
blockAddToCartWhenMissingPhotos?:boolean;
|
|
387
|
+
blockAddToCartWhenMissingTexts?:boolean;
|
|
388
|
+
blockFittingModeChangesWhenNotCustomizable?:boolean;
|
|
389
|
+
defaultPanel?:string;
|
|
390
|
+
editionSteps?:string[];
|
|
391
|
+
eyeDropper?:boolean;
|
|
392
|
+
freeform?:boolean;
|
|
393
|
+
plainColorBackgrounds?:boolean;
|
|
394
|
+
replaceStylesWithThemes?:boolean;
|
|
395
|
+
requirePreview?:boolean;
|
|
396
|
+
showAddPhotoButtonInPhotoPanel?:boolean;
|
|
397
|
+
showEndpaperPageNumbers?:boolean;
|
|
398
|
+
showPrice?:boolean;
|
|
399
|
+
shuffleLayout?:boolean;
|
|
400
|
+
};
|
|
401
|
+
};
|
|
402
|
+
recovery?:{
|
|
403
|
+
enabled:boolean;
|
|
404
|
+
interval:number;
|
|
405
|
+
};
|
|
406
|
+
featureFlags?:{
|
|
407
|
+
inlineTextEditing?:boolean;
|
|
408
|
+
};
|
|
409
|
+
maxConcurrentCollageRenderRequests?:number;
|
|
410
|
+
compressRequestLargerThan?:number;
|
|
411
|
+
localMode?:boolean;
|
|
412
|
+
hashBasedRouting?:boolean;
|
|
413
|
+
loadPhotosAnonymously?:boolean;
|
|
414
|
+
parallelUploads?:number;
|
|
415
|
+
}
|
|
416
|
+
|
|
417
|
+
export interface IMediaclip extends IDesignerFunctions {
|
|
418
|
+
browser:{
|
|
419
|
+
appName:string;
|
|
420
|
+
appVersion:string;
|
|
421
|
+
userAgent:string;
|
|
422
|
+
};
|
|
423
|
+
designers:{
|
|
424
|
+
html5:{
|
|
425
|
+
isIosWebView:() => boolean;
|
|
426
|
+
isSupported:() => boolean;
|
|
427
|
+
}
|
|
428
|
+
};
|
|
429
|
+
commitHash:string;
|
|
430
|
+
version:string;
|
|
431
|
+
}
|
|
432
|
+
|
|
433
|
+
declare global {
|
|
434
|
+
interface Window extends IDesignerEvents {
|
|
435
|
+
mediaclip:IMediaclip;
|
|
436
|
+
mediaclipConfig:IMediaclipConfig;
|
|
437
|
+
}
|
|
438
|
+
}
|
|
439
|
+
|
|
440
|
+
declare global {
|
|
441
|
+
let mediaclip:IMediaclip;
|
|
442
|
+
}
|
package/index.js
ADDED
|
File without changes
|
package/package.json
CHANGED
|
@@ -1,13 +1,15 @@
|
|
|
1
|
-
{
|
|
2
|
-
"name": "@mediaclip/designer-api",
|
|
3
|
-
"version": "14.0.0-
|
|
4
|
-
"description": "Mediaclip Designer Javascript API Typings",
|
|
5
|
-
"types": "designer-api.d.ts",
|
|
6
|
-
"
|
|
7
|
-
"
|
|
8
|
-
"
|
|
9
|
-
"
|
|
10
|
-
|
|
11
|
-
"
|
|
12
|
-
|
|
13
|
-
|
|
1
|
+
{
|
|
2
|
+
"name": "@mediaclip/designer-api",
|
|
3
|
+
"version": "14.0.0-cd.26343",
|
|
4
|
+
"description": "Mediaclip Designer Javascript API Typings",
|
|
5
|
+
"types": "designer-api.d.ts",
|
|
6
|
+
"main": "index.js",
|
|
7
|
+
"keywords": [],
|
|
8
|
+
"author": "Mediaclip inc.",
|
|
9
|
+
"license": "GPL-3.0-or-later",
|
|
10
|
+
"files": [
|
|
11
|
+
"designer-api.d.ts",
|
|
12
|
+
"index.js",
|
|
13
|
+
"README.md"
|
|
14
|
+
]
|
|
15
|
+
}
|