dothtml-interfaces 0.1.3 → 0.1.5
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 +51 -22
- package/src/i-dot.d.ts +4 -10
- package/src/index.d.ts +3 -2
package/package.json
CHANGED
package/src/i-component.d.ts
CHANGED
|
@@ -1,29 +1,58 @@
|
|
|
1
1
|
|
|
2
|
-
import { IDotElement } from "./i-dot";
|
|
2
|
+
import { IDotElement, IDotGenericElement } from "./i-dot";
|
|
3
3
|
import IDotCss from "./i-dot-css";
|
|
4
4
|
|
|
5
|
+
export interface FrameworkItems {
|
|
6
|
+
el: HTMLElement;
|
|
7
|
+
css: IDotCss;
|
|
8
|
+
html: IDotGenericElement;
|
|
9
|
+
refs: { [key: string]: HTMLElement };
|
|
10
|
+
restyle(): void;
|
|
11
|
+
}
|
|
12
|
+
|
|
5
13
|
export default interface IComponent {
|
|
6
14
|
// Properties
|
|
7
|
-
props
|
|
8
|
-
bindings
|
|
9
|
-
events
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
//
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
// Accessors
|
|
25
|
-
readonly $el: HTMLElement;
|
|
26
|
-
|
|
27
|
-
// Optional Method
|
|
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
|
+
*/
|
|
28
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;
|
|
29
58
|
}
|
package/src/i-dot.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
|
|
2
|
-
import IComponent from "./i-component";
|
|
2
|
+
import IComponent, { FrameworkItems } from "./i-component";
|
|
3
3
|
import IDotCss, { IDotcssProp } from "./i-dot-css";
|
|
4
4
|
import IEventBus from "./i-event-bus";
|
|
5
5
|
|
|
@@ -241,15 +241,9 @@ export interface IDotCore extends IDotDocument
|
|
|
241
241
|
navigate(path: string, noHistory?: boolean, force?: boolean): void;
|
|
242
242
|
css: IDotCss;
|
|
243
243
|
bus: IEventBus;
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
// component(component: typeof Component): void;
|
|
248
|
-
// removeComponent = removeComponent;
|
|
249
|
-
|
|
250
|
-
Component: {
|
|
251
|
-
new (...args: any[]): IComponent
|
|
252
|
-
};
|
|
244
|
+
|
|
245
|
+
component<T extends {new(...args: any[]): (IComponent)}>(ComponentClass: T): T&{new(...args: any[]): ({$: FrameworkItems})};
|
|
246
|
+
|
|
253
247
|
}
|
|
254
248
|
|
|
255
249
|
/**
|
package/src/index.d.ts
CHANGED
|
@@ -1,9 +1,10 @@
|
|
|
1
1
|
|
|
2
|
+
export * from "./i-dot";
|
|
3
|
+
|
|
2
4
|
export { default as IDotCss } from "./i-dot-css";
|
|
3
5
|
export * from "./i-dot-css";
|
|
4
6
|
|
|
5
|
-
export * from "./i-dot";
|
|
6
7
|
|
|
7
|
-
export { default as IComponent } from "./i-component";
|
|
8
|
+
export { default as IComponent, FrameworkItems } from "./i-component";
|
|
8
9
|
|
|
9
10
|
export { default as IEventBus } from "./i-event-bus";
|