dothtml-interfaces 0.3.12 → 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 CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "dothtml-interfaces",
3
- "version": "0.3.12",
3
+ "version": "0.3.13",
4
4
  "description": "Dependency injection interfaces for DOTHtml.",
5
5
  "main": "src/index.d.ts",
6
6
  "types": "src/index.d.ts",
@@ -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,8 +44,9 @@ 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
- build(): IDotDocument;
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
52
  * An optional function called after the component is built. Is only called once per component instance.
@@ -73,12 +74,11 @@ export default interface IComponent/*<TProps extends Array<string> = [], TEvents
73
74
  unmounted?(): void;
74
75
 
75
76
  /**
76
- * An optional function called before the component is deleted.
77
- */
78
- deleting?(): void;
79
-
80
- /**
81
- * An optional function called after the component is deleted.
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.
82
82
  */
83
- deleted?(): void;
83
+ stylize?(): string;
84
84
  }