@webflow/designer-extension-typings 0.1.0
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/LICENSE +21 -0
- package/README.md +21 -0
- package/elements-generated.d.ts +4424 -0
- package/elements.d.ts +4 -0
- package/index.d.ts +19 -0
- package/package.json +10 -0
- package/styles.d.ts +51 -0
- package/tsconfig.json +9 -0
package/elements.d.ts
ADDED
package/index.d.ts
ADDED
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
/// <reference path="./styles.d.ts" />
|
|
2
|
+
/// <reference path="./elements.d.ts" />
|
|
3
|
+
|
|
4
|
+
declare global {
|
|
5
|
+
const webflow: WebflowApi;
|
|
6
|
+
}
|
|
7
|
+
|
|
8
|
+
interface WebflowApi {
|
|
9
|
+
getSelectedElement(): Promise<null | AnyElement>;
|
|
10
|
+
getElements<t extends AnyElement['type']>(
|
|
11
|
+
types: Array<t>
|
|
12
|
+
): Promise<Array<Extract<AnyElement, {type: t}>>>;
|
|
13
|
+
createStyle(name: string): Style;
|
|
14
|
+
createString(text: string): StringElement;
|
|
15
|
+
createDOM(tag: string): DOMElement;
|
|
16
|
+
createHeading(tag: 1 | 2 | 3 | 4 | 5 | 6): DOMElement;
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
export {};
|
package/package.json
ADDED
package/styles.d.ts
ADDED
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
interface Style {
|
|
2
|
+
readonly id: StyleId;
|
|
3
|
+
getClassName(): string;
|
|
4
|
+
getProperties(options?: BreakpointAndPseudo): PropertyMap;
|
|
5
|
+
setProperties(props: PropertyMap, options?: BreakpointAndPseudo): undefined;
|
|
6
|
+
getProperty(prop: string, options?: BreakpointAndPseudo): null | string;
|
|
7
|
+
setProperty(
|
|
8
|
+
prop: string,
|
|
9
|
+
value: string,
|
|
10
|
+
options?: BreakpointAndPseudo
|
|
11
|
+
): undefined;
|
|
12
|
+
clearAllProperties(): undefined;
|
|
13
|
+
save(): Promise<undefined>;
|
|
14
|
+
destroy(): undefined;
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
declare type StyleId = string;
|
|
18
|
+
|
|
19
|
+
declare type PropertyMap = {[property: string]: string};
|
|
20
|
+
|
|
21
|
+
declare type BreakpointAndPseudo = {
|
|
22
|
+
breakpoint?: BreakpointId;
|
|
23
|
+
pseudo?: PseudoStateKey;
|
|
24
|
+
};
|
|
25
|
+
|
|
26
|
+
declare type BreakpointId =
|
|
27
|
+
| 'xxl'
|
|
28
|
+
| 'xl'
|
|
29
|
+
| 'large'
|
|
30
|
+
| 'main'
|
|
31
|
+
| 'medium'
|
|
32
|
+
| 'small'
|
|
33
|
+
| 'tiny';
|
|
34
|
+
|
|
35
|
+
declare type PseudoStateKey =
|
|
36
|
+
| 'noPseudo'
|
|
37
|
+
| 'nth-child(odd)'
|
|
38
|
+
| 'nth-child(even)'
|
|
39
|
+
| 'first-child'
|
|
40
|
+
| 'last-child'
|
|
41
|
+
| 'hover'
|
|
42
|
+
| 'active'
|
|
43
|
+
| 'pressed'
|
|
44
|
+
| 'visited'
|
|
45
|
+
| 'focus'
|
|
46
|
+
| 'focus-visible'
|
|
47
|
+
| 'focus-within'
|
|
48
|
+
| 'placeholder'
|
|
49
|
+
| 'empty'
|
|
50
|
+
| 'before'
|
|
51
|
+
| 'after';
|