@webflow/designer-extension-typings 2.0.0 → 2.0.2

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 (3) hide show
  1. package/api.d.ts +6 -1
  2. package/package.json +1 -1
  3. package/pages.d.ts +29 -1
package/api.d.ts CHANGED
@@ -293,7 +293,12 @@ interface WebflowApi {
293
293
  * ```
294
294
  */
295
295
  setExtensionSize(
296
- size: 'default' | 'comfortable' | 'large' | {width: number; height: number}
296
+ size:
297
+ | 'default'
298
+ | 'compact'
299
+ | 'comfortable'
300
+ | 'large'
301
+ | {width: number; height: number}
297
302
  ): Promise<null>;
298
303
  /**
299
304
  * Notifies the user with a message using a specific style. Error messages provide user's with the opportunity to
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.2",
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