@webflow/designer-extension-typings 2.0.31 → 2.0.33

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/elements.d.ts CHANGED
@@ -14,6 +14,11 @@ type FormState = 'normal' | 'success' | 'error';
14
14
 
15
15
  type FormMethod = 'get' | 'post';
16
16
 
17
+ /**
18
+ * @deprecated Use `element.getSettings()` (returns `ElementSettingSummaries`) or
19
+ * `element.searchSettings()` (returns `Record<string, ElementSetting>`) instead.
20
+ * These generic APIs return the same form fields plus all other applicable settings.
21
+ */
17
22
  type FormSettings = {
18
23
  state: FormState;
19
24
  name: string;
@@ -1,25 +1,60 @@
1
1
  // Instance Props types
2
2
 
3
- interface LinkResolvedValue {
4
- mode:
5
- | 'url'
6
- | 'page'
7
- | 'pageSection'
8
- | 'email'
9
- | 'phone'
10
- | 'file'
11
- | 'collectionPage';
12
- to?:
13
- | string
14
- | {pageId: string}
15
- | {assetId: string}
16
- | {fullElementId: {element: string; component: string}}
17
- | {pageSlug: string};
3
+ /** All public-facing link mode identifiers. */
4
+ type LinkMode =
5
+ | 'url'
6
+ | 'page'
7
+ | 'pageSection'
8
+ | 'email'
9
+ | 'phone'
10
+ | 'file'
11
+ | 'collectionPage';
12
+
13
+ interface LinkResolvedValueBase {
14
+ mode: LinkMode;
18
15
  openInNewTab?: boolean;
16
+ rel?: 'none' | 'preload' | 'prefetch' | 'prerender';
17
+ }
18
+
19
+ interface PageLinkResolvedValue extends LinkResolvedValueBase {
20
+ mode: 'page';
21
+ to?: {pageId: string};
22
+ }
23
+
24
+ interface PageSectionLinkResolvedValue extends LinkResolvedValueBase {
25
+ mode: 'pageSection';
26
+ to?: {fullElementId: FullElementId};
27
+ }
28
+
29
+ interface CollectionPageLinkResolvedValue extends LinkResolvedValueBase {
30
+ mode: 'collectionPage';
31
+ to?: {pageSlug: string};
32
+ }
33
+
34
+ interface EmailLinkResolvedValue extends LinkResolvedValueBase {
35
+ mode: 'email';
36
+ to?: string;
19
37
  emailSubject?: string;
20
- rel?: string;
21
38
  }
22
39
 
40
+ interface FileLinkResolvedValue extends LinkResolvedValueBase {
41
+ mode: 'file';
42
+ to?: {assetId: string};
43
+ }
44
+
45
+ interface GenericLinkResolvedValue extends LinkResolvedValueBase {
46
+ mode: 'url' | 'phone';
47
+ to?: string;
48
+ }
49
+
50
+ type LinkResolvedValue =
51
+ | PageLinkResolvedValue
52
+ | PageSectionLinkResolvedValue
53
+ | CollectionPageLinkResolvedValue
54
+ | EmailLinkResolvedValue
55
+ | FileLinkResolvedValue
56
+ | GenericLinkResolvedValue;
57
+
23
58
  interface VideoResolvedValue {
24
59
  src?: string;
25
60
  title?: string;
@@ -43,7 +78,7 @@ interface StaticPropValue {
43
78
  value: ResolvedValue | null;
44
79
  }
45
80
 
46
- type BindingPropValue =
81
+ type BindingValue =
47
82
  | {
48
83
  sourceType: 'prop';
49
84
  propId: string;
@@ -79,31 +114,38 @@ type BindingPropValue =
79
114
  | {sourceType: 'conditional'}
80
115
  | {sourceType: 'legacy'};
81
116
 
82
- type InstancePropValue = StaticPropValue | BindingPropValue;
117
+ type SettingValue = StaticPropValue | BindingValue;
83
118
 
84
- interface InstancePropDisplay {
119
+ interface SettingDisplay {
85
120
  label: string;
86
121
  group: string | null;
87
122
  trueLabel?: string;
88
123
  falseLabel?: string;
124
+ /** Available choices for variant props. Each entry is a variant the component author defined. */
125
+ options?: Array<Pick<Variant, 'id' | 'name'>>;
89
126
  }
90
127
 
91
128
  interface InstanceProp {
92
129
  propId: string;
93
130
  valueType: BindableValueType;
94
131
  hasOverride: boolean;
95
- value: InstancePropValue;
132
+ value: SettingValue;
96
133
  resolvedValue: ResolvedValue | null;
97
134
  defaultValue: ResolvedValue | null;
98
- display: InstancePropDisplay;
135
+ display: SettingDisplay;
99
136
  }
100
137
 
101
138
  interface InstancePropSummary {
102
139
  propId: string;
103
- value: ResolvedValue | BindingPropValue | null;
140
+ value: ResolvedValue | BindingValue | null;
104
141
  hasOverride: boolean;
105
142
  }
106
143
 
144
+ interface ResolvedInstanceProp {
145
+ propId: string;
146
+ value: ResolvedValue | null;
147
+ }
148
+
107
149
  interface SearchInstancePropsOptions {
108
150
  /** Filter to props that produce a specific value type (e.g., "string", "boolean") */
109
151
  valueType?: BindableValueType;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@webflow/designer-extension-typings",
3
- "version": "2.0.31",
3
+ "version": "2.0.33",
4
4
  "license": "MIT",
5
5
  "description": "Typings for the Webflow Designer Extension API",
6
6
  "main": "",