@webflow/designer-extension-typings 2.1.0 → 2.1.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.
- package/elements-generated.d.ts +4 -0
- package/package.json +1 -1
- package/slots.d.ts +20 -0
- package/styles.d.ts +17 -15
package/elements-generated.d.ts
CHANGED
|
@@ -277,6 +277,9 @@ interface ComponentElement
|
|
|
277
277
|
getComponent(): Promise<Component>;
|
|
278
278
|
getSlots(): Promise<Array<SlotInstanceElement>>;
|
|
279
279
|
getSelectedSlot(): Promise<SlotInstanceElement | null>;
|
|
280
|
+
getTextPropElement(
|
|
281
|
+
propId: string
|
|
282
|
+
): Promise<TextPropElement | RichTextPropElement | null>;
|
|
280
283
|
getProps(): Promise<Array<InstancePropSummary>>;
|
|
281
284
|
getResolvedProps(): Promise<Array<ResolvedInstanceProp>>;
|
|
282
285
|
searchProps(
|
|
@@ -286,6 +289,7 @@ interface ComponentElement
|
|
|
286
289
|
props: Array<SetInstancePropEntry>
|
|
287
290
|
): Promise<Array<SetInstancePropEntry>>;
|
|
288
291
|
resetAllProps(): Promise<null>;
|
|
292
|
+
unlinkComponent(): Promise<AnyElement>;
|
|
289
293
|
}
|
|
290
294
|
|
|
291
295
|
interface UnknownElement
|
package/package.json
CHANGED
package/slots.d.ts
CHANGED
|
@@ -14,3 +14,23 @@ interface SlotInstanceElement {
|
|
|
14
14
|
append(child: Component): Promise<null>;
|
|
15
15
|
prepend(child: Component): Promise<null>;
|
|
16
16
|
}
|
|
17
|
+
|
|
18
|
+
interface FullTextPropId {
|
|
19
|
+
readonly component: string;
|
|
20
|
+
readonly element: string;
|
|
21
|
+
readonly prop: string;
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
interface TextPropElement {
|
|
25
|
+
readonly id: FullTextPropId;
|
|
26
|
+
readonly type: 'TextPropElement';
|
|
27
|
+
getDisplayName(): Promise<string>;
|
|
28
|
+
getChildren(): Promise<AnyElement[]>;
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
interface RichTextPropElement {
|
|
32
|
+
readonly id: FullTextPropId;
|
|
33
|
+
readonly type: 'RichTextPropElement';
|
|
34
|
+
getDisplayName(): Promise<string>;
|
|
35
|
+
getChildren(): Promise<AnyElement[]>;
|
|
36
|
+
}
|
package/styles.d.ts
CHANGED
|
@@ -175,7 +175,7 @@ interface Style {
|
|
|
175
175
|
/**
|
|
176
176
|
* Retrieve a variable mode from the style.
|
|
177
177
|
* @param collection - The collection from which to get the currently applied mode.
|
|
178
|
-
* @param options - Options to get variable mode based on breakpoints
|
|
178
|
+
* @param options - Options to get variable mode based on breakpoints, pseudo classes / states, and component variants.
|
|
179
179
|
* @example
|
|
180
180
|
* ```ts
|
|
181
181
|
* const collection = await webflow.getVariableCollectionById('collection-id');
|
|
@@ -184,29 +184,31 @@ interface Style {
|
|
|
184
184
|
*/
|
|
185
185
|
getVariableMode(
|
|
186
186
|
collection: VariableCollection,
|
|
187
|
-
options?:
|
|
187
|
+
options?: StyleOptions
|
|
188
188
|
): Promise<null | VariableMode>;
|
|
189
189
|
/**
|
|
190
190
|
* Sets a variable mode for the style.
|
|
191
191
|
* @param collection - The collection that the mode being set belongs to.
|
|
192
192
|
* @param mode - The variable mode to set.
|
|
193
|
-
* @param options - Options to set variable mode based on breakpoints
|
|
193
|
+
* @param options - Options to set variable mode based on breakpoints, pseudo classes / states, and component variants.
|
|
194
194
|
* @example
|
|
195
195
|
* ```ts
|
|
196
196
|
* const collection = await webflow.getVariableCollectionById('collection-id');
|
|
197
197
|
* const mode = await collection.getVariableModeByName('Dark');
|
|
198
|
-
* await myStyle.setVariableMode(collection, mode
|
|
198
|
+
* await myStyle.setVariableMode(collection, mode, {
|
|
199
|
+
* variantId: 'variant-dark',
|
|
200
|
+
* });
|
|
199
201
|
* ```
|
|
200
202
|
*/
|
|
201
203
|
setVariableMode(
|
|
202
204
|
collection: VariableCollection,
|
|
203
205
|
mode: VariableMode,
|
|
204
|
-
options?:
|
|
206
|
+
options?: StyleOptions
|
|
205
207
|
): Promise<null>;
|
|
206
208
|
/**
|
|
207
209
|
* Removes a variable mode from the style.
|
|
208
210
|
* @param collection - The collection that the mode being removed belongs to.
|
|
209
|
-
* @param options - Options to remove variable mode based on breakpoints
|
|
211
|
+
* @param options - Options to remove variable mode based on breakpoints, pseudo classes / states, and component variants.
|
|
210
212
|
* @example
|
|
211
213
|
* ```ts
|
|
212
214
|
* const collection = await webflow.getVariableCollectionById('collection-id');
|
|
@@ -215,23 +217,23 @@ interface Style {
|
|
|
215
217
|
*/
|
|
216
218
|
removeVariableMode(
|
|
217
219
|
collection: VariableCollection,
|
|
218
|
-
options?:
|
|
220
|
+
options?: StyleOptions
|
|
219
221
|
): Promise<null>;
|
|
220
222
|
/**
|
|
221
223
|
* Retrieve all variable modes applied on the style.
|
|
222
|
-
* @param options - Options to get variable modes based on breakpoints
|
|
224
|
+
* @param options - Options to get variable modes based on breakpoints, pseudo classes / states, and component variants.
|
|
223
225
|
* @example
|
|
224
226
|
* ```ts
|
|
225
227
|
* const modes = await myStyle.getVariableModes();
|
|
226
228
|
* ```
|
|
227
229
|
*/
|
|
228
230
|
getVariableModes(
|
|
229
|
-
options?:
|
|
231
|
+
options?: StyleOptions
|
|
230
232
|
): Promise<VariableModeStylePropertyMap>;
|
|
231
233
|
/**
|
|
232
234
|
* Sets variable modes for the style.
|
|
233
235
|
* @param props - The variable modes to set.
|
|
234
|
-
* @param options - Options to set variable modes based on breakpoints
|
|
236
|
+
* @param options - Options to set variable modes based on breakpoints, pseudo classes / states, and component variants.
|
|
235
237
|
* @example
|
|
236
238
|
* ```ts
|
|
237
239
|
* await myStyle.setVariableModes({
|
|
@@ -242,12 +244,12 @@ interface Style {
|
|
|
242
244
|
*/
|
|
243
245
|
setVariableModes(
|
|
244
246
|
props: VariableModeStylePropertyMap,
|
|
245
|
-
options?:
|
|
247
|
+
options?: StyleOptions
|
|
246
248
|
): Promise<null>;
|
|
247
249
|
/**
|
|
248
250
|
* Removes variable modes from the style.
|
|
249
251
|
* @param modes - The variable modes to remove from the style.
|
|
250
|
-
* @param options - Options to remove variable modes based on breakpoints
|
|
252
|
+
* @param options - Options to remove variable modes based on breakpoints, pseudo classes / states, and component variants.
|
|
251
253
|
* @example
|
|
252
254
|
* ```ts
|
|
253
255
|
* const collection = await webflow.getVariableCollectionById('collection-id');
|
|
@@ -258,17 +260,17 @@ interface Style {
|
|
|
258
260
|
*/
|
|
259
261
|
removeVariableModes(
|
|
260
262
|
modes: Array<VariableMode>,
|
|
261
|
-
options?:
|
|
263
|
+
options?: StyleOptions
|
|
262
264
|
): Promise<null>;
|
|
263
265
|
/**
|
|
264
266
|
* Removes all variable modes from the style.
|
|
265
|
-
* @param options - Options to remove all variable modes based on breakpoints
|
|
267
|
+
* @param options - Options to remove all variable modes based on breakpoints, pseudo classes / states, and component variants.
|
|
266
268
|
* @example
|
|
267
269
|
* ```ts
|
|
268
270
|
* await myStyle.removeAllVariableModes();
|
|
269
271
|
* ```
|
|
270
272
|
*/
|
|
271
|
-
removeAllVariableModes(options?:
|
|
273
|
+
removeAllVariableModes(options?: StyleOptions): Promise<null>;
|
|
272
274
|
/**
|
|
273
275
|
* Retrieves the parent style for a combo class and otherwise returns null.
|
|
274
276
|
* @example
|