@base-framework/base 3.0.91 → 3.0.92

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.
@@ -0,0 +1,39 @@
1
+ /**
2
+ * HtmlToString
3
+ *
4
+ * This will render html to a string.
5
+ *
6
+ * @class
7
+ */
8
+ export class HtmlToString {
9
+ /**
10
+ * This will create a node string.
11
+ *
12
+ * @param {string} tag
13
+ * @param {object} attrs
14
+ * @param {string} children
15
+ * @returns {string}
16
+ */
17
+ static create(tag: string, attrs?: object, children?: string): string;
18
+ /**
19
+ * This will create a text node.
20
+ *
21
+ * @param {array} attrs
22
+ * @returns {string}
23
+ */
24
+ static createAttributes(attrs?: any[]): string;
25
+ /**
26
+ * This will create a text node.
27
+ *
28
+ * @param {string} text
29
+ * @returns {string}
30
+ */
31
+ static createText(text: string): string;
32
+ /**
33
+ * This will create a comment node.
34
+ *
35
+ * @param {string} text
36
+ * @returns {string}
37
+ */
38
+ static createComment(text: string): string;
39
+ }
@@ -6,5 +6,61 @@
6
6
  * @class
7
7
  */
8
8
  export class BrowserRender extends Render {
9
+ /**
10
+ * This will build an element or component.
11
+ *
12
+ * @protected
13
+ * @param {object} obj
14
+ * @param {object} container
15
+ * @param {object} [parent] The component adding the layout.
16
+ * @returns {void}
17
+ */
18
+ protected buildElement(obj: object, container: object, parent?: object): void;
19
+ /**
20
+ * This will create an element.
21
+ *
22
+ * @protected
23
+ * @param {object} obj
24
+ * @param {object} container
25
+ * @param {object} [parent] The component adding the layout.
26
+ * @returns {void}
27
+ */
28
+ protected createElement(obj: object, container: object, parent?: object): void;
29
+ /**
30
+ * This will add the element directives.
31
+ *
32
+ * @param {object} ele
33
+ * @param {array} directives
34
+ * @param {object} parent
35
+ * @returns {void}
36
+ */
37
+ setDirectives(ele: object, directives: any[], parent: object): void;
38
+ /**
39
+ * This will handle an attr directive.
40
+ *
41
+ * @protected
42
+ * @param {object} ele
43
+ * @param {object} attrDirective
44
+ * @param {object} parent
45
+ * @returns {void}
46
+ */
47
+ protected handleDirective(ele: object, attrDirective: object, parent: object): void;
48
+ /**
49
+ * This will cache an element ot the parent.
50
+ *
51
+ * @param {object} ele
52
+ * @param {object} propName
53
+ * @param {object} parent
54
+ */
55
+ cache(ele: object, propName: object, parent: object): void;
56
+ /**
57
+ * This will create a node.
58
+ *
59
+ * @param {object} settings
60
+ * @param {object} container
61
+ * @param {object} parent
62
+ * @returns {object}
63
+ */
64
+ createNode(settings: object, container: object, parent: object): object;
9
65
  }
10
66
  import { Render } from './render.js';
@@ -9,9 +9,9 @@ export class RenderController {
9
9
  /**
10
10
  * This will check if we are in the browser.
11
11
  *
12
- * @returns boolean
12
+ * @returns {boolean}
13
13
  */
14
- static browserIsSupported(): Window & typeof globalThis;
14
+ static browserIsSupported(): boolean;
15
15
  /**
16
16
  * This will create a History Object based on navigation support
17
17
  *
@@ -7,12 +7,28 @@
7
7
  */
8
8
  export class Render {
9
9
  /**
10
- * This will create a node.
10
+ * This will render the layout
11
11
  *
12
- * @param {object} settings
12
+ * @param {object} obj The JSON layout.
13
+ * @param {object} [container] The parent receiving the layout.
14
+ * @param {object} [parent] The component adding the layout.
15
+ * @returns {*} The layout result
16
+ */
17
+ build(obj: object, container?: object, parent?: object): any;
18
+ /**
19
+ * This will create a component.
20
+ *
21
+ * @param {object} obj
13
22
  * @param {object} container
14
23
  * @param {object} parent
15
- * @returns {object}
24
+ * @returns {void}
25
+ */
26
+ createComponent(obj: object, container: object, parent: object): void;
27
+ /**
28
+ * This will remove all the children from an element.
29
+ *
30
+ * @param {object} ele
31
+ * @returns {void}
16
32
  */
17
- createNode(settings: object, container: object, parent: object): object;
33
+ removeAll(ele: object): void;
18
34
  }
@@ -6,5 +6,31 @@
6
6
  * @class
7
7
  */
8
8
  export class ServerRender extends Render {
9
+ /**
10
+ * This will build an element or component and return an HTML string.
11
+ *
12
+ * @protected
13
+ * @param {object} obj
14
+ * @param {object} [parent] The component adding the layout.
15
+ * @returns {*}
16
+ */
17
+ protected buildElement(obj: object, parent?: object): any;
18
+ /**
19
+ * This will create an element and return an HTML string.
20
+ *
21
+ * @protected
22
+ * @param {object} obj
23
+ * @param {object} [parent] The component adding the layout.
24
+ * @returns {string} The HTML string.
25
+ */
26
+ protected createElement(obj: object, parent?: object): string;
27
+ /**
28
+ * This will create a node.
29
+ *
30
+ * @param {object} settings
31
+ * @param {string} childrenHtml
32
+ * @returns {object}
33
+ */
34
+ createNode(settings: object, childrenHtml: string): object;
9
35
  }
10
36
  import { Render } from './render.js';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@base-framework/base",
3
- "version": "3.0.91",
3
+ "version": "3.0.92",
4
4
  "description": "This is a javascript framework.",
5
5
  "main": "/dist/base.js",
6
6
  "scripts": {