@webflow/designer-extension-typings 2.0.0 → 2.0.1

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.
Files changed (2) hide show
  1. package/package.json +1 -1
  2. package/pages.d.ts +29 -1
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@webflow/designer-extension-typings",
3
- "version": "2.0.0",
3
+ "version": "2.0.1",
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
@@ -64,6 +64,26 @@ interface Folder {
64
64
  setParent(parent: Folder): Promise<null>;
65
65
  }
66
66
 
67
+ type PageMetadata = {
68
+ name: string;
69
+ slug: string;
70
+ title: string;
71
+ description: string;
72
+ isDraft: boolean;
73
+ usesTitleAsOpenGraphTitle: boolean;
74
+ openGraphTitle: string;
75
+ usesDescriptionAsOpenGraphDescription: boolean;
76
+ openGraphDescription: string;
77
+ openGraphImage: string;
78
+ isExcludedFromSearch: boolean;
79
+ usesTitleAsSearchTitle: boolean;
80
+ searchTitle: string;
81
+ usesDescriptionAsSearchDescription: boolean;
82
+ searchDescription: string;
83
+ usesOpenGraphImageAsSearchImage: boolean;
84
+ searchImage: string;
85
+ };
86
+
67
87
  interface Page {
68
88
  readonly id: PageId;
69
89
  readonly type: 'Page';
@@ -90,7 +110,15 @@ interface Page {
90
110
  setSlug(slug: string): Promise<null>;
91
111
  getParent(): Promise<null | Folder>;
92
112
  setParent(parent: Folder): Promise<null>;
93
-
113
+ /**
114
+ * Sets the metadata of the page to the provided value;
115
+ * @param metadata - object containing one or more metadata properties to update
116
+ * @example
117
+ * ```
118
+ * const updatedMetadata = await page.setMetadata({title: "New Page Title", isDraft: true, description: "New Page Description"});
119
+ * ```
120
+ */
121
+ setMetadata(metadata: Partial<PageMetadata>): Promise<null>;
94
122
  /**
95
123
  * Retrieves the title of the page.
96
124
  * @example