dothtml-interfaces 0.3.11 → 0.3.13
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 +1 -1
- package/src/i-component.d.ts +22 -12
package/package.json
CHANGED
package/src/i-component.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
|
|
2
|
-
import { IDotDocument } from "./i-dot";
|
|
2
|
+
import { IDotCore, IDotDocument } from "./i-dot";
|
|
3
3
|
import IDotCss from "./styles/i-dot-css";
|
|
4
4
|
|
|
5
5
|
// export type EventNames<T> = T extends { allowedEvents: infer E } ? E : never;
|
|
@@ -44,31 +44,41 @@ export default interface IComponent/*<TProps extends Array<string> = [], TEvents
|
|
|
44
44
|
|
|
45
45
|
/**
|
|
46
46
|
* A function returning DOThtml (required). The `build` hook is called once per component instance, and constructs the component's virtual DOM.
|
|
47
|
-
|
|
48
|
-
|
|
47
|
+
* @param dot - The DOThtml core object passed in for DI purposes. You can also just use the main .
|
|
48
|
+
* @returns The DOThtml document representing the component's virtual DOM. */
|
|
49
|
+
build(dot: IDotCore): IDotDocument;
|
|
49
50
|
|
|
50
51
|
/**
|
|
51
|
-
* An optional function
|
|
52
|
+
* An optional function called after the component is built. Is only called once per component instance.
|
|
53
|
+
*/
|
|
54
|
+
built?(): void;
|
|
55
|
+
|
|
56
|
+
/**
|
|
57
|
+
* An optional function that gets called before the component is mounted.
|
|
52
58
|
*/
|
|
53
|
-
|
|
59
|
+
mounting?(): void;
|
|
54
60
|
|
|
55
61
|
/**
|
|
56
62
|
* An optional function called after the element has been mounted. May be called mulitple times if the component is rerendered.
|
|
57
63
|
*/
|
|
58
64
|
mounted?(): void;
|
|
59
|
-
|
|
65
|
+
|
|
60
66
|
/**
|
|
61
|
-
* An optional function called before the component is
|
|
67
|
+
* An optional function that gets called before the component is unmounted. Use it to do custom cleanup or data saving.
|
|
62
68
|
*/
|
|
63
|
-
|
|
69
|
+
unmounting?(): void;
|
|
64
70
|
|
|
65
71
|
/**
|
|
66
|
-
* An optional function called after the component is
|
|
72
|
+
* An optional function called after the element has been unmounted. May be called mulitple times if the component is rerendered.
|
|
67
73
|
*/
|
|
68
|
-
|
|
74
|
+
unmounted?(): void;
|
|
69
75
|
|
|
70
76
|
/**
|
|
71
|
-
*
|
|
77
|
+
* A function that returns a string containing CSS rules to be applied to all instances of the component.
|
|
78
|
+
* It will only be called exactly once per component. We use a function so that you can return a potentially
|
|
79
|
+
* large string containing CSS without introducing a memory leak. The reason it's not static is so that
|
|
80
|
+
* it will work in JavaScript, and because static members are not valid in DI interfaces.
|
|
81
|
+
* @returns A string containing CSS rules.
|
|
72
82
|
*/
|
|
73
|
-
|
|
83
|
+
stylize?(): string;
|
|
74
84
|
}
|