@webflow/designer-extension-typings 2.0.24 → 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.
@@ -1,4 +1,6 @@
1
- Copyright (c) 2023 Webflow, Inc
1
+ MIT License
2
+
3
+ Copyright (c) 2026 Webflow, Inc
2
4
 
3
5
  Permission is hereby granted, free of charge, to any person ob-
4
6
  taining a copy of this software and associated documentation
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,7 +1,7 @@
1
1
  {
2
2
  "name": "@webflow/designer-extension-typings",
3
- "version": "2.0.24",
4
- "license": "SEE LICENSE IN LICENSE",
3
+ "version": "2.0.26",
4
+ "license": "MIT",
5
5
  "description": "Typings for the Webflow Designer Extension API",
6
6
  "main": "",
7
7
  "scripts": {
package/styles.d.ts CHANGED
@@ -189,6 +189,14 @@ interface Style {
189
189
  * ```
190
190
  */
191
191
  removeAllVariableModes(options?: BreakpointAndPseudo): Promise<null>;
192
+ /**
193
+ * Retrieves the parent style for a combo class and otherwise returns null.
194
+ * @example
195
+ * ```ts
196
+ * const parentStyle = await myStyle.getParent();
197
+ * ```
198
+ */
199
+ getParent(): Promise<Style | null>;
192
200
  }
193
201
 
194
202
  type StyleId = string;