@webflow/designer-extension-typings 2.0.10 → 2.0.12

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/assets.d.ts CHANGED
@@ -39,6 +39,27 @@ interface Asset {
39
39
  */
40
40
  getName(): Promise<string>;
41
41
 
42
+ /**
43
+ * Set the name of the asset.
44
+ * @example
45
+ * ```ts
46
+ * const asset = await webflow.getAssetById('123');
47
+ * await asset.setName('new name');
48
+ * ```
49
+ */
50
+ setName(name: string): Promise<null>;
51
+
52
+ /**
53
+ * Replace the current asset with a new file.
54
+ * @example
55
+ * ```ts
56
+ * const asset = await webflow.getAssetById('123');
57
+ * const newFile = new File([blob], 'cat.png', { type: 'image/png' });
58
+ * await asset.setFile(newFile);
59
+ * ```
60
+ */
61
+ setFile(fileBlob: File): Promise<null>;
62
+
42
63
  /**
43
64
  * Get the mime type of the asset.
44
65
  * @example
@@ -2663,6 +2663,10 @@ interface FormCheckboxInputElement
2663
2663
  readonly id: FullElementId;
2664
2664
  readonly type: 'FormCheckboxInput';
2665
2665
  readonly plugin: 'Form';
2666
+ getName(): Promise<string>;
2667
+ setName(name: string): Promise<null>;
2668
+ getRequired(): Promise<boolean>;
2669
+ setRequired(value: boolean): Promise<null>;
2666
2670
  }
2667
2671
 
2668
2672
  interface FormCheckboxWrapperElement
@@ -2702,8 +2706,10 @@ interface FormFormElement
2702
2706
  readonly id: FullElementId;
2703
2707
  readonly type: 'FormForm';
2704
2708
  readonly plugin: 'Form';
2705
- getName(): Promise<null | string>;
2709
+ getName(): Promise<string>;
2706
2710
  setName(name: string): Promise<null>;
2711
+ getSettings(): Promise<FormSettings>;
2712
+ setSettings(settings: Partial<FormSettings>): Promise<null>;
2707
2713
  }
2708
2714
 
2709
2715
  interface FormInlineLabelElement
@@ -2730,6 +2736,10 @@ interface FormRadioInputElement
2730
2736
  readonly id: FullElementId;
2731
2737
  readonly type: 'FormRadioInput';
2732
2738
  readonly plugin: 'Form';
2739
+ getName(): Promise<string>;
2740
+ setName(name: string): Promise<null>;
2741
+ getRequired(): Promise<boolean>;
2742
+ setRequired(value: boolean): Promise<null>;
2733
2743
  }
2734
2744
 
2735
2745
  interface FormRadioWrapperElement
@@ -2756,6 +2766,10 @@ interface FormSelectElement
2756
2766
  readonly id: FullElementId;
2757
2767
  readonly type: 'FormSelect';
2758
2768
  readonly plugin: 'Form';
2769
+ getName(): Promise<string>;
2770
+ setName(name: string): Promise<null>;
2771
+ getRequired(): Promise<boolean>;
2772
+ setRequired(value: boolean): Promise<null>;
2759
2773
  }
2760
2774
 
2761
2775
  interface FormSuccessMessageElement
@@ -2782,6 +2796,10 @@ interface FormTextareaElement
2782
2796
  readonly id: FullElementId;
2783
2797
  readonly type: 'FormTextarea';
2784
2798
  readonly plugin: 'Form';
2799
+ getName(): Promise<string>;
2800
+ setName(name: string): Promise<null>;
2801
+ getRequired(): Promise<boolean>;
2802
+ setRequired(value: boolean): Promise<null>;
2785
2803
  }
2786
2804
 
2787
2805
  interface FormTextInputElement
@@ -2795,6 +2813,10 @@ interface FormTextInputElement
2795
2813
  readonly id: FullElementId;
2796
2814
  readonly type: 'FormTextInput';
2797
2815
  readonly plugin: 'Form';
2816
+ getName(): Promise<string>;
2817
+ setName(name: string): Promise<null>;
2818
+ getRequired(): Promise<boolean>;
2819
+ setRequired(value: boolean): Promise<null>;
2798
2820
  }
2799
2821
 
2800
2822
  interface FormWrapperElement
@@ -2808,8 +2830,10 @@ interface FormWrapperElement
2808
2830
  readonly id: FullElementId;
2809
2831
  readonly type: 'FormWrapper';
2810
2832
  readonly plugin: 'Form';
2811
- getName(): Promise<null | string>;
2833
+ getName(): Promise<string>;
2812
2834
  setName(name: string): Promise<null>;
2835
+ getSettings(): Promise<FormSettings>;
2836
+ setSettings(settings: Partial<FormSettings>): Promise<null>;
2813
2837
  }
2814
2838
 
2815
2839
  interface FormReCaptchaElement
@@ -2836,6 +2860,10 @@ interface FormFileUploadWrapperElement
2836
2860
  readonly id: FullElementId;
2837
2861
  readonly type: 'FormFileUploadWrapper';
2838
2862
  readonly plugin: 'Form';
2863
+ getName(): Promise<string>;
2864
+ setName(name: string): Promise<null>;
2865
+ getRequired(): Promise<boolean>;
2866
+ setRequired(value: boolean): Promise<null>;
2839
2867
  }
2840
2868
 
2841
2869
  interface FormFileUploadDefaultElement
@@ -4307,6 +4335,19 @@ interface UserErrorMsgElement
4307
4335
  readonly plugin: 'Users';
4308
4336
  }
4309
4337
 
4338
+ interface CodeIslandElement
4339
+ extends WebflowElement,
4340
+ CustomAttributes,
4341
+ DomId,
4342
+ Styles,
4343
+ NoChildren,
4344
+ NoTextContent,
4345
+ NoAppConnections {
4346
+ readonly id: FullElementId;
4347
+ readonly type: 'CodeIsland';
4348
+ readonly plugin: 'Code';
4349
+ }
4350
+
4310
4351
  type AnyElement =
4311
4352
  | ComponentElement
4312
4353
  | UnknownElement
@@ -4629,4 +4670,5 @@ type AnyElement =
4629
4670
  | UserSignUpErrorMsgElement
4630
4671
  | UserResetPasswordErrorMsgElement
4631
4672
  | UserUpdatePasswordErrorMsgElement
4632
- | UserErrorMsgElement;
4673
+ | UserErrorMsgElement
4674
+ | CodeIslandElement;
package/elements.d.ts CHANGED
@@ -8,3 +8,15 @@ type NamedValue = {
8
8
  name: string;
9
9
  value: string;
10
10
  };
11
+
12
+ type FormState = 'normal' | 'success' | 'error';
13
+
14
+ type FormMethod = 'get' | 'post';
15
+
16
+ type FormSettings = {
17
+ state: FormState;
18
+ name: string;
19
+ redirect: string;
20
+ action: string;
21
+ method: FormMethod;
22
+ };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@webflow/designer-extension-typings",
3
- "version": "2.0.10",
3
+ "version": "2.0.12",
4
4
  "license": "SEE LICENSE IN LICENSE",
5
5
  "description": "Typings for the Webflow Designer Extension API",
6
6
  "main": "",