@webflow/designer-extension-typings 0.1.0 → 0.1.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.
@@ -87,6 +87,7 @@ interface DOMElement
87
87
  readonly id: ElementId;
88
88
  readonly type: 'DOM';
89
89
  readonly plugin: 'Builtin';
90
+ getTag(): null | string;
90
91
  getAttribute(name: string): null | string;
91
92
  setAttribute(name: string, value: string): undefined;
92
93
  }
@@ -3018,6 +3019,45 @@ interface CellElement
3018
3019
  readonly plugin: 'Layout';
3019
3020
  }
3020
3021
 
3022
+ interface FlexContainerElement
3023
+ extends WebflowElement,
3024
+ Configurable,
3025
+ CustomAttributes,
3026
+ DomId,
3027
+ Styles,
3028
+ Children,
3029
+ NoTextContent {
3030
+ readonly id: ElementId;
3031
+ readonly type: 'FlexContainer';
3032
+ readonly plugin: 'Layout';
3033
+ }
3034
+
3035
+ interface VFlexElement
3036
+ extends WebflowElement,
3037
+ Configurable,
3038
+ CustomAttributes,
3039
+ DomId,
3040
+ Styles,
3041
+ Children,
3042
+ NoTextContent {
3043
+ readonly id: ElementId;
3044
+ readonly type: 'VFlex';
3045
+ readonly plugin: 'Layout';
3046
+ }
3047
+
3048
+ interface HFlexElement
3049
+ extends WebflowElement,
3050
+ Configurable,
3051
+ CustomAttributes,
3052
+ DomId,
3053
+ Styles,
3054
+ Children,
3055
+ NoTextContent {
3056
+ readonly id: ElementId;
3057
+ readonly type: 'HFlex';
3058
+ readonly plugin: 'Layout';
3059
+ }
3060
+
3021
3061
  interface LightboxWrapperElement
3022
3062
  extends WebflowElement,
3023
3063
  Configurable,
@@ -4338,6 +4378,9 @@ declare type AnyElement =
4338
4378
  | GridElement
4339
4379
  | LayoutElement
4340
4380
  | CellElement
4381
+ | FlexContainerElement
4382
+ | VFlexElement
4383
+ | HFlexElement
4341
4384
  | LightboxWrapperElement
4342
4385
  | NavbarBrandElement
4343
4386
  | NavbarButtonElement
package/index.d.ts CHANGED
@@ -7,13 +7,28 @@ declare global {
7
7
 
8
8
  interface WebflowApi {
9
9
  getSelectedElement(): Promise<null | AnyElement>;
10
- getElements<t extends AnyElement['type']>(
11
- types: Array<t>
12
- ): Promise<Array<Extract<AnyElement, {type: t}>>>;
10
+ getMediaQuery(): Promise<BreakpointId>;
11
+ getAllElements(): Promise<Array<AnyElement>>;
13
12
  createStyle(name: string): Style;
13
+ getStyleByName(name: string): Promise<null | Style>;
14
+ getAllStyles(): Promise<Array<Style>>;
14
15
  createString(text: string): StringElement;
15
16
  createDOM(tag: string): DOMElement;
16
- createHeading(tag: 1 | 2 | 3 | 4 | 5 | 6): DOMElement;
17
+ createHeading(tag: 1 | 2 | 3 | 4 | 5 | 6): HeadingElement;
18
+ notify(opts: {
19
+ type: 'Error' | 'Info' | 'Success';
20
+ message: string;
21
+ }): Promise<void>;
22
+ subscribe(
23
+ event: 'selectedelement',
24
+ callback: (element: null | AnyElement) => void
25
+ ): Unsubscribe;
26
+ subscribe(
27
+ event: 'mediaquery',
28
+ callback: (breakpoint: BreakpointId) => void
29
+ ): Unsubscribe;
17
30
  }
18
31
 
32
+ type Unsubscribe = () => undefined;
33
+
19
34
  export {};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@webflow/designer-extension-typings",
3
- "version": "0.1.0",
3
+ "version": "0.1.2",
4
4
  "license": "SEE LICENSE IN LICENSE",
5
5
  "description": "Typings for the Webflow Designer Extension API",
6
6
  "main": "",
package/styles.d.ts CHANGED
@@ -1,6 +1,6 @@
1
1
  interface Style {
2
2
  readonly id: StyleId;
3
- getClassName(): string;
3
+ getName(): string;
4
4
  getProperties(options?: BreakpointAndPseudo): PropertyMap;
5
5
  setProperties(props: PropertyMap, options?: BreakpointAndPseudo): undefined;
6
6
  getProperty(prop: string, options?: BreakpointAndPseudo): null | string;