@webflow/designer-extension-typings 2.0.2 → 2.0.3
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 +27 -0
- package/assets.d.ts +29 -0
- package/element-presets-generated.d.ts +0 -8
- package/package.json +1 -1
package/api.d.ts
CHANGED
|
@@ -452,6 +452,33 @@ interface WebflowApi {
|
|
|
452
452
|
*/
|
|
453
453
|
getAllAssets(): Promise<Array<Asset>>;
|
|
454
454
|
|
|
455
|
+
/**
|
|
456
|
+
* Gets all asset folders for the site
|
|
457
|
+
* @example
|
|
458
|
+
* ```ts
|
|
459
|
+
* const assetFolders = await webflow.getAssetFolders();
|
|
460
|
+
* console.log('Asset folders:', assetFolders);
|
|
461
|
+
* ```
|
|
462
|
+
* @returns A Promise that resolves to an array of AssetFolder objects
|
|
463
|
+
*/
|
|
464
|
+
getAllAssetFolders(): Promise<Array<AssetFolder>>;
|
|
465
|
+
|
|
466
|
+
/**
|
|
467
|
+
* Creates a new asset folder within a given site
|
|
468
|
+
* @param name - The name of the new asset folder.
|
|
469
|
+
* @param parentFolderId - Optional. The ID of the parent folder. If not provided, the folder will be created at the root level.
|
|
470
|
+
* @returns A Promise that resolves to the newly created AssetFolder object.
|
|
471
|
+
* @example
|
|
472
|
+
* ```ts
|
|
473
|
+
* const newFolder = await webflow.createAssetFolder('My New Folder');
|
|
474
|
+
* console.log('New folder created:', newFolder.id);
|
|
475
|
+
* ```
|
|
476
|
+
*/
|
|
477
|
+
createAssetFolder(
|
|
478
|
+
name: string,
|
|
479
|
+
parentFolderId?: string
|
|
480
|
+
): Promise<AssetFolder>;
|
|
481
|
+
|
|
455
482
|
/**
|
|
456
483
|
* Checks if the user has the ability to perform the given App Mode
|
|
457
484
|
* @param appModes
|
package/assets.d.ts
CHANGED
|
@@ -48,6 +48,35 @@ interface Asset {
|
|
|
48
48
|
* ```
|
|
49
49
|
*/
|
|
50
50
|
getMimeType(): Promise<string>;
|
|
51
|
+
|
|
52
|
+
/**
|
|
53
|
+
* Set the parent folder of the asset.
|
|
54
|
+
* @example
|
|
55
|
+
* ```ts
|
|
56
|
+
* const asset = await webflow.getAssetById('123');
|
|
57
|
+
* const folder = await webflow.createAssetFolder('New Folder');
|
|
58
|
+
* await asset.setParent(folder);
|
|
59
|
+
* ```
|
|
60
|
+
*/
|
|
61
|
+
setParent(assetFolder: AssetFolder): Promise<null>;
|
|
62
|
+
|
|
63
|
+
/**
|
|
64
|
+
* Get the parent folder of the asset.
|
|
65
|
+
* @example
|
|
66
|
+
* ```ts
|
|
67
|
+
* const asset = await webflow.getAssetById('123');
|
|
68
|
+
* const parentFolder = await asset.getParent();
|
|
69
|
+
* ```
|
|
70
|
+
*/
|
|
71
|
+
getParent(): Promise<AssetFolder | null>;
|
|
51
72
|
}
|
|
52
73
|
|
|
53
74
|
type AssetId = string;
|
|
75
|
+
|
|
76
|
+
type AssetFolder = {
|
|
77
|
+
readonly id: AssetFolderId;
|
|
78
|
+
|
|
79
|
+
getName(): Promise<string>;
|
|
80
|
+
};
|
|
81
|
+
|
|
82
|
+
type AssetFolderId = string;
|
|
@@ -103,14 +103,6 @@ type ElementPresets = {
|
|
|
103
103
|
LayoutFooterDark: ElementPreset<SectionElement>;
|
|
104
104
|
LayoutFooterLight: ElementPreset<SectionElement>;
|
|
105
105
|
LayoutFooterSubscribe: ElementPreset<SectionElement>;
|
|
106
|
-
StructureLayoutQuickStack1x1: ElementPreset<SectionElement>;
|
|
107
|
-
StructureLayoutQuickStack2x1: ElementPreset<SectionElement>;
|
|
108
|
-
StructureLayoutQuickStack3x1: ElementPreset<SectionElement>;
|
|
109
|
-
StructureLayoutQuickStack4x1: ElementPreset<SectionElement>;
|
|
110
|
-
StructureLayoutQuickStack2x2: ElementPreset<SectionElement>;
|
|
111
|
-
StructureLayoutQuickStack2plus1: ElementPreset<SectionElement>;
|
|
112
|
-
StructureLayoutQuickStack1plus2: ElementPreset<SectionElement>;
|
|
113
|
-
StructureLayoutQuickStackMasonry: ElementPreset<SectionElement>;
|
|
114
106
|
UserAccountSubscriptionList: ElementPreset<UserAccountSubscriptionListWrapperElement>;
|
|
115
107
|
UserLogOutLogIn: ElementPreset<UserLogOutLogInElement>;
|
|
116
108
|
SignUp: ElementPreset<UserSignUpFormWrapperElement>;
|