@webflow/designer-extension-typings 2.0.25 → 2.0.26

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 CHANGED
@@ -240,13 +240,14 @@ interface WebflowApi {
240
240
  */
241
241
  createStyle(name: string, options?: {parent?: Style}): Promise<Style>;
242
242
  /**
243
- * Fetch a style by its name.
244
- * @param name - The name of the style to retrieve.
243
+ * Fetch a style by its name or path.
244
+ * @param nameOrPath - The name or path of the style to retrieve.
245
245
  * @returns A Promise that resolves to one of the following:
246
246
  * - null if no style with the given name is found.
247
247
  * - Style object representing the style with the specified name.
248
248
  * @example
249
249
  * ```ts
250
+ * // Get a style by name
250
251
  * const styleName = 'myStyle';
251
252
  * const style = await webflow.getStyleByName(styleName);
252
253
  * if (style) {
@@ -254,9 +255,18 @@ interface WebflowApi {
254
255
  * } else {
255
256
  * // Style not found
256
257
  * }
257
- * ```
258
+ *
259
+ * // Get a nested style by path
260
+ * const stylePath = ['parent', 'child'];
261
+ * const style = await webflow.getStyleByName(stylePath);
262
+ * if (style) {
263
+ * // Style found, handle it
264
+ * } else {
265
+ * // Style not found
266
+ * }
267
+ *```
258
268
  */
259
- getStyleByName(name: string): Promise<null | Style>;
269
+ getStyleByName(nameOrPath: string | string[]): Promise<null | Style>;
260
270
  /**
261
271
  * Fetch an array of all styles available in the Webflow project.
262
272
  * @returns A Promise that resolves to an array of Style objects representing all the styles present on the
@@ -1,5 +1,17 @@
1
1
  // This file was automatically generated. See designer-extensions docs.
2
2
 
3
+ type BlockElementTag =
4
+ | 'div'
5
+ | 'header'
6
+ | 'footer'
7
+ | 'nav'
8
+ | 'main'
9
+ | 'section'
10
+ | 'article'
11
+ | 'aside'
12
+ | 'address'
13
+ | 'figure';
14
+
3
15
  type InsertOrMoveElement = <
4
16
  el extends AnyElement,
5
17
  target extends el | ElementPreset<el> | Component | BuilderElement,
@@ -244,6 +256,8 @@ interface BlockElement
244
256
  readonly id: FullElementId;
245
257
  readonly type: 'Block';
246
258
  readonly plugin: 'Basic';
259
+ getTag(): Promise<null | BlockElementTag>;
260
+ setTag(tag: BlockElementTag): Promise<null>;
247
261
  }
248
262
 
249
263
  interface BlockquoteElement
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@webflow/designer-extension-typings",
3
- "version": "2.0.25",
3
+ "version": "2.0.26",
4
4
  "license": "MIT",
5
5
  "description": "Typings for the Webflow Designer Extension API",
6
6
  "main": "",