@webflow/designer-extension-typings 0.2.0-beta.5 → 0.2.0-beta.7

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
@@ -4,6 +4,7 @@
4
4
  /// <reference path="./elements.d.ts" />
5
5
  /// <reference path="./element-presets.d.ts" />
6
6
  /// <reference path="./components.d.ts" />
7
+ /// <reference path="./builder-element.d.ts" />
7
8
  /// <reference path="./variables.d.ts" />
8
9
  /// <reference path="./app-subscription.d.ts" />
9
10
 
@@ -51,6 +52,8 @@ interface WebflowApi {
51
52
  * ```
52
53
  */
53
54
  setSelectedElement(element: AnyElement): Promise<null | AnyElement>;
55
+
56
+ elementBuilder(elementPreset: ElementPreset<AnyElement>): BuilderElement;
54
57
  /**
55
58
  * Get the current media query breakpoint ID.
56
59
  * @returns A Promise that resolves to a BreakpointId which is a string representing the current media query
package/assets.d.ts ADDED
@@ -0,0 +1,7 @@
1
+ interface Asset {
2
+ readonly id: AssetId;
3
+
4
+ getUrl(): Promise<string>;
5
+ }
6
+
7
+ type AssetId = string;
@@ -0,0 +1,10 @@
1
+ interface BuilderElement {
2
+ readonly [brand]: 'BuilderElement';
3
+
4
+ readonly id: ElementId;
5
+ readonly builderElement: boolean;
6
+
7
+ getTag(): null | string;
8
+ setTag(tag: string): null;
9
+ append(child: ElementPreset<AnyElement>): BuilderElement;
10
+ }
@@ -2,7 +2,7 @@
2
2
 
3
3
  type InsertOrMoveElement = <
4
4
  el extends AnyElement,
5
- target extends el | ElementPreset<el> | Component
5
+ target extends el | ElementPreset<el> | Component | BuilderElement
6
6
  >(
7
7
  this: {id: FullElementId},
8
8
  that: target
@@ -11,11 +11,14 @@ type InsertOrMoveElement = <
11
11
  ? target
12
12
  : target extends ElementPreset<infer elementType>
13
13
  ? elementType
14
- : ComponentElement
14
+ : target extends Component
15
+ ? ComponentElement
16
+ : AnyElement
15
17
  >;
16
18
 
17
19
  interface WebflowElement {
18
20
  readonly [brand]: 'Element';
21
+ readonly builderElement: false;
19
22
  remove(this: {id: FullElementId}): Promise<null>;
20
23
  readonly before: InsertOrMoveElement;
21
24
  readonly after: InsertOrMoveElement;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@webflow/designer-extension-typings",
3
- "version": "0.2.0-beta.5",
3
+ "version": "0.2.0-beta.7",
4
4
  "license": "SEE LICENSE IN LICENSE",
5
5
  "description": "Typings for the Webflow Designer Extension API",
6
6
  "main": "",
package/pages.d.ts CHANGED
@@ -389,13 +389,13 @@ interface Page {
389
389
  */
390
390
  isHomepage(): Promise<boolean>;
391
391
  /**
392
- * Retrieves the full URL that will be used when the page is published.
392
+ * Retrieves the path that will be used when the page is published.
393
393
  * @example
394
394
  * ```ts
395
- * let publishUrl = await myPage.getPublishUrl();
396
- * console.log("Publish URL: ", publishUrl);
395
+ * let publishPath = await myPage.getPublishPath();
396
+ * console.log("Publish path: ", publishPath);
397
397
  */
398
- getPublishUrl(): Promise<null | string>;
398
+ getPublishPath(): Promise<null | string>;
399
399
  }
400
400
 
401
401
  type FolderId = string;
package/tsconfig.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "compilerOptions": {
3
3
  "target": "es6",
4
- "lib": ["es6"],
4
+ "lib": ["es6", "dom"],
5
5
  "noEmit": true,
6
6
  "noUncheckedIndexedAccess": true,
7
7
  "strict": true,