dothtml-interfaces 6.0.4 → 6.0.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/bindings/i-ref.ts +4 -0
- package/src/i-dot.ts +14 -6
package/package.json
CHANGED
package/src/bindings/i-ref.ts
CHANGED
|
@@ -1,5 +1,9 @@
|
|
|
1
1
|
import { IWatcher } from "./i-watcher";
|
|
2
|
+
import { DotContent } from "../i-dot";
|
|
2
3
|
|
|
3
4
|
export interface IRef<T = any> extends IWatcher<T | null> {
|
|
4
5
|
get element(): T;
|
|
6
|
+
ready(): Promise<T>;
|
|
7
|
+
append(content: DotContent): this;
|
|
8
|
+
prepend(content: DotContent): this;
|
|
5
9
|
}
|
package/src/i-dot.ts
CHANGED
|
@@ -8,7 +8,7 @@ import { IWatcher } from "./bindings/i-watcher";
|
|
|
8
8
|
import IDotcssProp from "./styles/i-css-prop";
|
|
9
9
|
import { IRef } from "./bindings/i-ref";
|
|
10
10
|
|
|
11
|
-
type DotContentPrimitive = string | number | boolean | undefined | null;
|
|
11
|
+
export type DotContentPrimitive = string | number | boolean | undefined | null;
|
|
12
12
|
type DotContentBasic = DotContentPrimitive | Node | Element | NodeList | IDotComponent | IDotDocument//typeof DotDocument;
|
|
13
13
|
export type DotContent = DotContentBasic | Array<DotContent> | IReactive;//|(()=>DotContent);
|
|
14
14
|
|
|
@@ -51,19 +51,27 @@ export interface IDotDocument {
|
|
|
51
51
|
/**
|
|
52
52
|
* Creates a generic HTML node that can render a string, HTML nodes, or dotHTML content.
|
|
53
53
|
*/
|
|
54
|
-
html(content:
|
|
54
|
+
html(content: DotContentPrimitive | IReactive): IDotDocument;
|
|
55
55
|
/**
|
|
56
56
|
* Creates a text node that will render as a string, rather than being parsed as markup.
|
|
57
57
|
*/
|
|
58
|
-
text(content:
|
|
58
|
+
text(content: DotContentPrimitive | IReactive): IDotDocument;
|
|
59
59
|
/**
|
|
60
60
|
* Creates a text node that will render as a string, rather than being parsed as markup.
|
|
61
61
|
*/
|
|
62
|
-
md(content:
|
|
62
|
+
md(content: DotContentPrimitive | IReactive): IDotDocument;
|
|
63
63
|
/**
|
|
64
|
-
* Mounts a component.
|
|
64
|
+
* Mounts a component or appends content.
|
|
65
65
|
*/
|
|
66
|
-
mount
|
|
66
|
+
mount(content: DotContent, ...args: any[]): IDotDocument;
|
|
67
|
+
/**
|
|
68
|
+
* Appends content to the current document.
|
|
69
|
+
*/
|
|
70
|
+
append(content: DotContent): this;
|
|
71
|
+
/**
|
|
72
|
+
* Prepends content to the current document.
|
|
73
|
+
*/
|
|
74
|
+
prepend(content: DotContent): this;
|
|
67
75
|
slot(name?: string | any, fallback?: any): IDotDocument;
|
|
68
76
|
// mount<T extends IComponent>(init: (c: IMountedComponent<T>) => IMountedComponent<T> | void, component: T): IDotDocument;
|
|
69
77
|
// mount(component: IComponent, init: (init=>IMountedComponent): IMountedComponent|void): IDotDocument;
|