dothtml-interfaces 0.1.2 → 0.1.4

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/package.json CHANGED
@@ -1,9 +1,9 @@
1
1
  {
2
2
  "name": "dothtml-interfaces",
3
- "version": "0.1.2",
3
+ "version": "0.1.4",
4
4
  "description": "Dependency injection interfaces for DOTHtml.",
5
- "main": "./src/index.d.ts",
6
- "types": "./src/index.d.ts",
5
+ "main": "src/index.d.ts",
6
+ "types": "src/index.d.ts",
7
7
  "scripts": {},
8
8
  "author": "",
9
9
  "license": "ISC",
@@ -12,6 +12,6 @@
12
12
  },
13
13
  "exports": "./src/index.d.ts",
14
14
  "files": [
15
- "./src/**/*"
15
+ "src/**/*"
16
16
  ]
17
17
  }
@@ -0,0 +1,58 @@
1
+
2
+ import { IDotElement, IDotGenericElement } from "./i-dot";
3
+ import IDotCss from "./i-dot-css";
4
+
5
+ export interface FrameworkItems {
6
+ el: HTMLElement;
7
+ css: IDotCss;
8
+ html: IDotGenericElement;
9
+ refs: { [key: string]: HTMLElement };
10
+ restyle(): void;
11
+ }
12
+
13
+ export default interface IComponent {
14
+ // Properties
15
+ props?: { [key: string]: any };
16
+ bindings?: { [key: string]: any };
17
+ events?: Array<string>;
18
+
19
+ readonly $?: FrameworkItems;
20
+
21
+ // Lifecycle hooks
22
+
23
+ /**
24
+ *
25
+ * @param args
26
+ */
27
+ build(...args: Array<any>): IDotElement;
28
+
29
+ /**
30
+ * An optional function that is called after builder that stylizes the component using a scoped style builder.
31
+ */
32
+ style?(css: IDotCss): void;
33
+
34
+ /**
35
+ * An optional function that gets called before the component is created, scoped to the new component object.
36
+ */
37
+ creating?(...args: Array<any>): void;
38
+
39
+ /**
40
+ * An optional function called after the element has been added. One parameter will be provided containing the added element.
41
+ */
42
+ ready?(): void;
43
+
44
+ /**
45
+ * An optional function called before the component is deleted.
46
+ */
47
+ deleting?(): void;
48
+
49
+ /**
50
+ * An optional function called after the component is deleted.
51
+ */
52
+ deleted?(): void;
53
+
54
+ /**
55
+ * An optional function called after the component is built.
56
+ */
57
+ built?(): void;
58
+ }