dothtml-interfaces 0.1.44 → 0.1.46

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.1.44",
3
+ "version": "0.1.46",
4
4
  "description": "Dependency injection interfaces for DOTHtml.",
5
5
  "main": "src/index.d.ts",
6
6
  "types": "src/index.d.ts",
@@ -2,15 +2,19 @@
2
2
  import { IDotDocument, IDotGenericElement } from "./i-dot";
3
3
  import IDotCss from "./i-dot-css";
4
4
 
5
+ // export type EventNames<T> = T extends { allowedEvents: infer E } ? E : never;
6
+
5
7
  // TODO: I think this could be typed so that it forces you to emit events from the list of strings.
6
8
  export interface FrameworkItems {
7
9
  /**
8
10
  * The shadow root element of the component.
9
11
  */
10
12
  readonly refs: { [key: string]: HTMLElement };
11
- readonly emit: (event: string, ...args: Array<any>)=>void;
13
+ emit<T>(event: string, ...args: Array<any>): void;
12
14
  restyle(): void;
15
+ readonly props: Record<string, any>;
13
16
  readonly _meta: {
17
+ readonly allowedEvents: string[];
14
18
  readonly shadowRoot: ShadowRoot;
15
19
  readonly isRendered: boolean;
16
20
  readonly tagName: string;
package/src/i-dot.d.ts CHANGED
@@ -518,7 +518,7 @@ interface IDotGenericElement extends IDotAttrBuilder<IDotGenericElement>{}
518
518
 
519
519
  // Interface for specific elements:
520
520
 
521
- interface IMountedComponent<T extends IComponent> extends IDotDocument{
521
+ interface IMountedComponent<T extends IComponent>{
522
522
  on(event: string, callback: (...args: Array<any>)=>void): IMountedComponent<T>;
523
523
  prop(name: string, value: any): IMountedComponent<T>;
524
524
  }