@webflow/designer-extension-typings 2.0.6 → 2.0.8

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
@@ -290,6 +290,50 @@ interface WebflowApi {
290
290
  * ```
291
291
  */
292
292
  getDefaultVariableCollection(): Promise<null | VariableCollection>;
293
+ /**
294
+ * Creates a new variable collection.
295
+ * @param name - The name of the new variable collection.
296
+ * @returns A Promise that resolves into a newly created Collection.
297
+ * @example
298
+ * ```ts
299
+ * const collection = await webflow.createVariableCollection('My New Collection');
300
+ * ```
301
+ */
302
+ createVariableCollection(name: string): Promise<VariableCollection>;
303
+
304
+ /**
305
+ * Fetches a variable collection by its id.
306
+ * @param id - The id of the variable collection to fetch.
307
+ * @returns A Promise that resolves into a Collection.
308
+ * @example
309
+ * ```ts
310
+ * const collection = await webflow.getVariableCollectionById('collectionId');
311
+ * ```
312
+ */
313
+ getVariableCollectionById(
314
+ id: VariableCollectionId
315
+ ): Promise<VariableCollection | null>;
316
+
317
+ /**
318
+ * Fetches all variable collections.
319
+ * @returns A Promise that resolves to an array of Collection objects.
320
+ * @example
321
+ * ```ts
322
+ * const collections = await webflow.getAllVariableCollections();
323
+ * ```
324
+ */
325
+ getAllVariableCollections(): Promise<Array<VariableCollection> | null>;
326
+
327
+ /**
328
+ * Removes the variable collection.
329
+ * @returns A Promise that resolves into a boolean indicating whether deleting the variable collection was successful.
330
+ * @example
331
+ * ```ts
332
+ * const collection = await webflow.removeVariableCollection('collectionId');
333
+ * ```
334
+ */
335
+ removeVariableCollection(id: VariableCollectionId): Promise<boolean>;
336
+
293
337
  /**
294
338
  * Sets the extension size to one of predefined sizes or a custom size. If the specified custom size is larger than
295
339
  * the user's viewport size, the extension will default to the width/height of the browser's viewport.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@webflow/designer-extension-typings",
3
- "version": "2.0.6",
3
+ "version": "2.0.8",
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
@@ -130,13 +130,13 @@ interface Page {
130
130
  getTitle(): Promise<string>;
131
131
  /**
132
132
  * Sets the title of the page to the provided value.
133
- * @param title - The new title to set for the page.
133
+ * @param title - The new title to set for the page. Passing null will unset the current value.
134
134
  * @example
135
135
  * ```ts
136
136
  * await myPage.setTitle("New Page Title");
137
137
  * ```
138
138
  */
139
- setTitle(title: string): Promise<null>;
139
+ setTitle(title: string | null): Promise<null>;
140
140
  /**
141
141
  * Retrieves the description of the page.
142
142
  * @example
@@ -148,13 +148,13 @@ interface Page {
148
148
  getDescription(): Promise<string>;
149
149
  /**
150
150
  * Sets the description of the page to the provided value.
151
- * @param description - The new description to set for the page.
151
+ * @param description - The new description to set for the page. Passing null will unset the current value.
152
152
  * @example
153
153
  * ```ts
154
154
  * await myPage.setDescription("New Page Description");
155
155
  * ```
156
156
  */
157
- setDescription(description: string): Promise<null>;
157
+ setDescription(description: string | null): Promise<null>;
158
158
  /**
159
159
  * Checks if the page is in draft mode or not.
160
160
  * @example
@@ -203,13 +203,13 @@ interface Page {
203
203
  getOpenGraphTitle(): Promise<string>;
204
204
  /**
205
205
  * Sets the Open Graph (OG) title of the page to the provided value.
206
- * @param title - The new OG title to set for the page.
206
+ * @param title - The new OG title to set for the page. Passing null will unset the current value.
207
207
  * @example
208
208
  * ```ts
209
209
  * await myPage.setOpenGraphTitle("New OG Title");
210
210
  * ```
211
211
  */
212
- setOpenGraphTitle(title: string): Promise<null>;
212
+ setOpenGraphTitle(title: string | null): Promise<null>;
213
213
  /**
214
214
  * Checks if the page uses its description as the Open Graph description.
215
215
  * @example
@@ -239,13 +239,13 @@ interface Page {
239
239
  getOpenGraphDescription(): Promise<string>;
240
240
  /**
241
241
  * Sets the Open Graph (OG) description of the page to the provided value.
242
- * @param description - The new OG description to set for the page.
242
+ * @param description - The new OG description to set for the page. Passing null will unset the current value.
243
243
  * @example
244
244
  * ```ts
245
245
  * myPage.setOpenGraphDescription("New OG Description");
246
246
  * ```
247
247
  */
248
- setOpenGraphDescription(description: string): Promise<null>;
248
+ setOpenGraphDescription(description: string | null): Promise<null>;
249
249
  /**
250
250
  * Retrieves the URL of the Open Graph (OG) image associated with the page.
251
251
  * @example
@@ -257,13 +257,13 @@ interface Page {
257
257
  getOpenGraphImage(): Promise<null | string>;
258
258
  /**
259
259
  * Sets the URL of the Open Graph (OG) image associated with the page.
260
- * @param url - The new URL of the OG image to set for the page.
260
+ * @param url - The new URL of the OG image to set for the page. Passing null will unset the current value.
261
261
  * @example
262
262
  * ```ts
263
263
  * myPage.setOpenGraphImage("https://example.com/image.jpg");
264
264
  * ```
265
265
  */
266
- setOpenGraphImage(url: string): Promise<null>;
266
+ setOpenGraphImage(url: string | null): Promise<null>;
267
267
  /**
268
268
  * Checks if the page is excluded from search engine indexing.
269
269
  * @example
@@ -311,13 +311,13 @@ interface Page {
311
311
  getSearchTitle(): Promise<string>;
312
312
  /**
313
313
  * Sets the search engine title of the page to the provided value.
314
- * @param title - The new search engine title to set for the page.
314
+ * @param title - The new search engine title to set for the page. Passing null will unset the current value.
315
315
  * @example
316
316
  * ```ts
317
317
  * myPage.setSearchTitle("New Search Engine Title");
318
318
  * ```
319
319
  */
320
- setSearchTitle(title: string): Promise<null>;
320
+ setSearchTitle(title: string | null): Promise<null>;
321
321
  /**
322
322
  * Checks if the page uses its description as the search engine description.
323
323
  * @example
@@ -347,13 +347,13 @@ interface Page {
347
347
  getSearchDescription(): Promise<string>;
348
348
  /**
349
349
  * Sets the search engine description of the page to the provided value.
350
- * @param description - The new search engine description to set for the page.
350
+ * @param description - The new search engine description to set for the page. Passing null will unset the current value.
351
351
  * @example
352
352
  * ```ts
353
353
  * myPage.setSearchDescription("New Search Engine Description");
354
354
  * ```
355
355
  */
356
- setSearchDescription(description: string): Promise<null>;
356
+ setSearchDescription(description: string | null): Promise<null>;
357
357
  /**
358
358
  * Checks if the page uses its Open Graph (OG) image as the search engine image.
359
359
  * @example
@@ -382,13 +382,13 @@ interface Page {
382
382
  getSearchImage(): Promise<string>;
383
383
  /**
384
384
  * Sets the search engine image URL of the page.
385
- * @param url - The new search engine image URL to set for the page.
385
+ * @param url - The new search engine image URL to set for the page. Passing null will unset the current value.
386
386
  * @example
387
387
  * ```ts
388
388
  * myPage.setSearchImage("https://example.com/image.jpg");
389
389
  * ```
390
390
  */
391
- setSearchImage(url: string): Promise<null>;
391
+ setSearchImage(url: string | null): Promise<null>;
392
392
  /**
393
393
  * Checks if the page is password-protected.
394
394
  * @example
package/variables.d.ts CHANGED
@@ -30,6 +30,7 @@ interface ColorVariable {
30
30
  * @returns A Promise that resolves into a value, or if the variable is an alias - the original Variable.
31
31
  * @example
32
32
  * ```ts
33
+ * const collection = await webflow.getDefaultVariableCollection();
33
34
  * const newVariable1 = await collection.createColorVariable('myvar4', 'red');
34
35
  * await newVariable1.set('yellow');
35
36
  * ```
@@ -151,7 +152,7 @@ interface NumberVariable {
151
152
  * @returns A Promise that resolves once the value is successfully set.
152
153
  * @example
153
154
  * ```ts
154
- * const newVariable = await collection.createNumberVariable('myvar1', 100});
155
+ * const newVariable = await collection.createNumberVariable('myvar1', 100);
155
156
  * await newVariable.set(200);
156
157
  * ```
157
158
  */
@@ -335,6 +336,17 @@ interface VariableCollection {
335
336
  name: string,
336
337
  value: string | FontFamilyVariable
337
338
  ): Promise<FontFamilyVariable>;
339
+ /**
340
+ * Sets the name of the variable collection.
341
+ * @param newName - The desired name of the variable collection.
342
+ * @returns A Promise that resolves once the name is successfully set.
343
+ * @example
344
+ * ```ts
345
+ * const collection = await webflow.createVariableCollection('My Collection');
346
+ * await collection.setName('My New Collection');
347
+ * ```
348
+ */
349
+ setName(newName: string): Promise<null>;
338
350
  }
339
351
 
340
352
  type VariableCollectionId = string;