@webflow/designer-extension-typings 0.2.0-beta.11 → 0.2.0-beta.13
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/api.d.ts +9 -0
- package/assets.d.ts +21 -1
- package/elements-generated.d.ts +10 -0
- package/package.json +1 -1
package/api.d.ts
CHANGED
|
@@ -411,6 +411,15 @@ interface WebflowApi {
|
|
|
411
411
|
* @param id
|
|
412
412
|
*/
|
|
413
413
|
getAssetById(id: AssetId): Promise<null | Asset>;
|
|
414
|
+
|
|
415
|
+
/**
|
|
416
|
+
* Gets all assets for the site
|
|
417
|
+
* @example
|
|
418
|
+
* ```ts
|
|
419
|
+
* const assets = await webflow.getAllAssets();
|
|
420
|
+
* ```
|
|
421
|
+
*/
|
|
422
|
+
getAllAssets(): Promise<Array<Asset>>;
|
|
414
423
|
}
|
|
415
424
|
|
|
416
425
|
type Unsubscribe = () => void;
|
package/assets.d.ts
CHANGED
|
@@ -27,7 +27,27 @@ interface Asset {
|
|
|
27
27
|
* await asset.setAltText('new alt text');
|
|
28
28
|
* ```
|
|
29
29
|
*/
|
|
30
|
-
setAltText(altText: string, localeId?: string): Promise<null>;
|
|
30
|
+
setAltText(altText: string | null, localeId?: string): Promise<null>;
|
|
31
|
+
|
|
32
|
+
/**
|
|
33
|
+
* Get the name of the asset.
|
|
34
|
+
* @example
|
|
35
|
+
* ```ts
|
|
36
|
+
* const asset = await webflow.getAssetById('123');
|
|
37
|
+
* const name = await asset.getName();
|
|
38
|
+
* ```
|
|
39
|
+
*/
|
|
40
|
+
getName(): Promise<string>;
|
|
41
|
+
|
|
42
|
+
/**
|
|
43
|
+
* Get the mime type of the asset.
|
|
44
|
+
* @example
|
|
45
|
+
* ```ts
|
|
46
|
+
* const asset = await webflow.getAssetById('123');
|
|
47
|
+
* const mimeType = await asset.getMimeType();
|
|
48
|
+
* ```
|
|
49
|
+
*/
|
|
50
|
+
getMimeType(): Promise<string>;
|
|
31
51
|
}
|
|
32
52
|
|
|
33
53
|
type AssetId = string;
|
package/elements-generated.d.ts
CHANGED
|
@@ -344,6 +344,10 @@ interface ImageElement
|
|
|
344
344
|
readonly id: FullElementId;
|
|
345
345
|
readonly type: 'Image';
|
|
346
346
|
readonly plugin: 'Basic';
|
|
347
|
+
getAltText(): Promise<string>;
|
|
348
|
+
setAltText(altText: string | null): Promise<null>;
|
|
349
|
+
setAsset(asset: Asset | null): Promise<null>;
|
|
350
|
+
getAsset(): Promise<null | Asset>;
|
|
347
351
|
}
|
|
348
352
|
|
|
349
353
|
interface LinkElement
|
|
@@ -356,6 +360,12 @@ interface LinkElement
|
|
|
356
360
|
readonly id: FullElementId;
|
|
357
361
|
readonly type: 'Link';
|
|
358
362
|
readonly plugin: 'Basic';
|
|
363
|
+
setSettings(
|
|
364
|
+
mode: 'url' | 'page' | 'pageSection' | 'email' | 'phone' | 'file',
|
|
365
|
+
target: string | Page | AnyElement | Asset,
|
|
366
|
+
metadata?: {openInNewTab?: boolean; subject?: string}
|
|
367
|
+
): Promise<null>;
|
|
368
|
+
getTarget(): Promise<null | string | Page | AnyElement | Asset>;
|
|
359
369
|
}
|
|
360
370
|
|
|
361
371
|
interface ListElement
|