@base-framework/base 3.0.225 → 3.0.226

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.
@@ -1,3 +1,8 @@
1
+ /**
2
+ * This defines an object that can have arbitrary string keys.
3
+ * @typedef {Object} Props
4
+ * @property {any} [key] - Catch-all for dynamic props
5
+ */
1
6
  /**
2
7
  * Component
3
8
  *
@@ -145,6 +150,15 @@ export class Component extends Unit {
145
150
  */
146
151
  protected removeEvents(): void;
147
152
  }
153
+ /**
154
+ * This defines an object that can have arbitrary string keys.
155
+ */
156
+ export type Props = {
157
+ /**
158
+ * - Catch-all for dynamic props
159
+ */
160
+ key?: any;
161
+ };
148
162
  import { Unit } from './unit.js';
149
163
  import { StateHelper } from './state-helper.js';
150
164
  import { EventHelper } from './event-helper.js';
@@ -1 +1,13 @@
1
- export function parseArgs(args: any[]): object;
1
+ export function parseArgs(args: (Props | string | object[])[]): {
2
+ props?: Props;
3
+ children?: (string | object[]);
4
+ };
5
+ /**
6
+ * This defines an object that can have arbitrary string keys.
7
+ */
8
+ export type Props = {
9
+ /**
10
+ * - Catch-all for dynamic props
11
+ */
12
+ key?: any;
13
+ };
@@ -1,4 +1,13 @@
1
1
  export function DefaultProps(): object;
2
2
  export function StringProp(value: string): object;
3
3
  export function ArrayProp(value: any[]): object;
4
- export function ObjectProp(args: any[]): object;
4
+ export function ObjectProp(args: (Props | string | object[])[]): object;
5
+ /**
6
+ * This defines an object that can have arbitrary string keys.
7
+ */
8
+ export type Props = {
9
+ /**
10
+ * - Catch-all for dynamic props
11
+ */
12
+ key?: any;
13
+ };
@@ -22,9 +22,14 @@ export class Unit {
22
22
  * This will create a unit.
23
23
  *
24
24
  * @constructor
25
- * @param {array} args
25
+ * @param {...(Props|string|Array<object>)} args
26
+ * An array of arguments that can be:
27
+ * - A `Props` object
28
+ * - A string child
29
+ * - An array of child objects
30
+ * etc.
26
31
  */
27
- constructor(...args: any[]);
32
+ constructor(...args: (Props | string | Array<object>)[]);
28
33
  /**
29
34
  * @member {boolean} isUnit
30
35
  */
@@ -40,7 +45,7 @@ export class Unit {
40
45
  /**
41
46
  * @member {?array} children
42
47
  */
43
- children: any;
48
+ children: string | any[];
44
49
  /**
45
50
  * @member {?array} nest
46
51
  */
@@ -71,10 +76,10 @@ export class Unit {
71
76
  /**
72
77
  * This will setup the component props.
73
78
  *
74
- * @param {object} [props]
79
+ * @param {Props} [props]
75
80
  * @returns {void}
76
81
  */
77
- setupProps(props?: object): void;
82
+ setupProps(props?: Props): void;
78
83
  /**
79
84
  * This will get the child scope instance of the component.
80
85
  *
@@ -292,3 +297,12 @@ export class Unit {
292
297
  */
293
298
  destroy(): void;
294
299
  }
300
+ /**
301
+ * This defines an object that can have arbitrary string keys.
302
+ */
303
+ export type Props = {
304
+ /**
305
+ * - Catch-all for dynamic props
306
+ */
307
+ key?: any;
308
+ };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@base-framework/base",
3
- "version": "3.0.225",
3
+ "version": "3.0.226",
4
4
  "description": "This is a javascript framework.",
5
5
  "main": "./dist/base.js",
6
6
  "type": "module",