@cntwg/html-helper 0.1.1 → 0.1.3
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/CHANGELOG.md +13 -0
- package/README.md +4 -2
- package/index.d.ts +44 -0
- package/index.js +9 -6
- package/lib/event-hfunc.d.ts +12 -0
- package/lib/event-hfunc.js +9 -23
- package/lib/html-helper-lib.d.ts +165 -0
- package/lib/html-helper-lib.js +11 -26
- package/package.json +12 -6
package/CHANGELOG.md
CHANGED
package/README.md
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
>|***rev.*:**|0.2.
|
|
1
|
+
>|***rev.*:**|0.2.9|
|
|
2
2
|
>|:---|---:|
|
|
3
|
-
>|date:|
|
|
3
|
+
>|date:|2026-04-14|
|
|
4
4
|
|
|
5
5
|
## Introduction
|
|
6
6
|
|
|
@@ -36,3 +36,5 @@ This module was make for use as a library in a development of a Web-apps based o
|
|
|
36
36
|
### Installation
|
|
37
37
|
|
|
38
38
|
`npm install @cntwg/html-helper`
|
|
39
|
+
|
|
40
|
+
> Note: It's recommended to "pin" a package versions range to its minor releases after installation. To do so use `~` range specifier (*e.g. `~0.1.0`*) in `package.json`.
|
package/index.d.ts
ADDED
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
export namespace eventHelper {
|
|
2
|
+
let pushEventHandler: typeof ev_helper.pushEventHandler;
|
|
3
|
+
let removeEventHandler: typeof ev_helper.removeEventHandler;
|
|
4
|
+
let triggerEventHandler: typeof ev_helper.triggerEventHandler;
|
|
5
|
+
}
|
|
6
|
+
import { valueToIDString } from "@ygracs/bsfoc-lib-js";
|
|
7
|
+
import ev_helper = require("./lib/event-hfunc.js");
|
|
8
|
+
|
|
9
|
+
import {
|
|
10
|
+
CSS_CLASS_STRING,
|
|
11
|
+
isHTMLElement,
|
|
12
|
+
isSelectedHTMLElement, isCurrentHTMLElement,
|
|
13
|
+
isActiveHTMLElement, isHiddenHTMLElement,
|
|
14
|
+
hideHTMLElement, showHTMLElement,
|
|
15
|
+
selectHTMLElement, unselectHTMLElement,
|
|
16
|
+
markHTMLElementAsCurrent, unmarkCurrentHTMLElement,
|
|
17
|
+
markHTMLElementAsActive, unmarkActiveHTMLElement,
|
|
18
|
+
lockHTMLElement, unlockHTMLElement,
|
|
19
|
+
activateHTMLElements, inactivateHTMLElements,
|
|
20
|
+
valueToClassList,
|
|
21
|
+
readAsTagName, readAsAttrName, readAsAttrValue,
|
|
22
|
+
valueToElementID,
|
|
23
|
+
createNewHTMLElement,
|
|
24
|
+
isHTMLButton,
|
|
25
|
+
} from "./lib/html-helper-lib.js";
|
|
26
|
+
|
|
27
|
+
export {
|
|
28
|
+
CSS_CLASS_STRING,
|
|
29
|
+
isHTMLElement,
|
|
30
|
+
isSelectedHTMLElement, isCurrentHTMLElement,
|
|
31
|
+
isActiveHTMLElement, isHiddenHTMLElement,
|
|
32
|
+
hideHTMLElement, showHTMLElement,
|
|
33
|
+
selectHTMLElement, unselectHTMLElement,
|
|
34
|
+
markHTMLElementAsCurrent, unmarkCurrentHTMLElement,
|
|
35
|
+
markHTMLElementAsActive, unmarkActiveHTMLElement,
|
|
36
|
+
lockHTMLElement, unlockHTMLElement,
|
|
37
|
+
activateHTMLElements, inactivateHTMLElements,
|
|
38
|
+
valueToClassList,
|
|
39
|
+
readAsTagName, readAsAttrName, readAsAttrValue,
|
|
40
|
+
valueToElementID,
|
|
41
|
+
createNewHTMLElement,
|
|
42
|
+
isHTMLButton,
|
|
43
|
+
valueToIDString,
|
|
44
|
+
};
|
package/index.js
CHANGED
|
@@ -1,9 +1,13 @@
|
|
|
1
|
-
// [v0.2.
|
|
1
|
+
// [v0.2.035-20260413]
|
|
2
2
|
|
|
3
3
|
// === module init block ===
|
|
4
4
|
|
|
5
|
-
const html_helper = require('./lib/html-helper-lib
|
|
6
|
-
const ev_helper = require('./lib/event-hfunc
|
|
5
|
+
const html_helper = require('./lib/html-helper-lib');
|
|
6
|
+
const ev_helper = require('./lib/event-hfunc');
|
|
7
|
+
|
|
8
|
+
const {
|
|
9
|
+
valueToIDString,
|
|
10
|
+
} = require('@ygracs/bsfoc-lib-js');
|
|
7
11
|
|
|
8
12
|
|
|
9
13
|
// === module inner block ===
|
|
@@ -15,6 +19,7 @@ const eventHelper = {
|
|
|
15
19
|
removeEventHandler: ev_helper.removeEventHandler,
|
|
16
20
|
triggerEventHandler: ev_helper.triggerEventHandler,
|
|
17
21
|
};
|
|
22
|
+
module.exports.eventHelper = eventHelper;
|
|
18
23
|
|
|
19
24
|
// === module exports block ===
|
|
20
25
|
|
|
@@ -46,7 +51,5 @@ module.exports.valueToElementID = html_helper.valueToElementID;
|
|
|
46
51
|
module.exports.createNewHTMLElement = html_helper.createNewHTMLElement;
|
|
47
52
|
module.exports.isHTMLButton = html_helper.isHTMLButton;
|
|
48
53
|
|
|
49
|
-
module.exports.eventHelper = eventHelper;
|
|
50
|
-
|
|
51
54
|
// * re-exported *
|
|
52
|
-
module.exports.valueToIDString =
|
|
55
|
+
module.exports.valueToIDString = valueToIDString;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @inner
|
|
3
|
+
*/
|
|
4
|
+
export function pushEventHandler(pool: Map<string, Function>, name: string, evnt: Function): void;
|
|
5
|
+
/**
|
|
6
|
+
* @inner
|
|
7
|
+
*/
|
|
8
|
+
export function removeEventHandler(pool: Map<string, Function>, name: string): void;
|
|
9
|
+
/**
|
|
10
|
+
* @inner
|
|
11
|
+
*/
|
|
12
|
+
export function triggerEventHandler(pool: Map<string, Function>, name: string, ...args: any[]): void;
|
package/lib/event-hfunc.js
CHANGED
|
@@ -1,19 +1,11 @@
|
|
|
1
|
-
// [v0.1.
|
|
1
|
+
// [v0.1.065-20260413]
|
|
2
2
|
|
|
3
3
|
// === module init block ===
|
|
4
4
|
|
|
5
|
-
// === module
|
|
5
|
+
// === module inner block ===
|
|
6
6
|
|
|
7
7
|
// === module main block ===
|
|
8
8
|
|
|
9
|
-
/***
|
|
10
|
-
* (* constant definitions *)
|
|
11
|
-
*/
|
|
12
|
-
|
|
13
|
-
/***
|
|
14
|
-
* (* function definitions *)
|
|
15
|
-
*/
|
|
16
|
-
|
|
17
9
|
/**
|
|
18
10
|
* @function pushEventHandler
|
|
19
11
|
* @param {Map<string, Function>} pool - pool object
|
|
@@ -34,6 +26,7 @@ function pushEventHandler(pool, name, evnt) {
|
|
|
34
26
|
};
|
|
35
27
|
};
|
|
36
28
|
};
|
|
29
|
+
module.exports.pushEventHandler = pushEventHandler;
|
|
37
30
|
|
|
38
31
|
/**
|
|
39
32
|
* @function removeEventHandler
|
|
@@ -51,28 +44,21 @@ function removeEventHandler(pool, name) {
|
|
|
51
44
|
if (pool.has(key)) pool.delete(key);
|
|
52
45
|
};
|
|
53
46
|
};
|
|
47
|
+
module.exports.removeEventHandler = removeEventHandler;
|
|
54
48
|
|
|
55
49
|
/**
|
|
56
50
|
* @function triggerEventHandler
|
|
57
51
|
* @param {Map<string, Function>} pool - pool object
|
|
58
52
|
* @param {string} name - event name
|
|
59
|
-
* @param {...any}
|
|
53
|
+
* @param {...any} args - optional params send to a target event
|
|
60
54
|
* @returns {void}
|
|
61
55
|
* @inner
|
|
62
56
|
*/
|
|
63
57
|
function triggerEventHandler(pool, name, ...args) {
|
|
64
|
-
const
|
|
65
|
-
if (
|
|
66
|
-
|
|
58
|
+
const target = typeof name === 'string' ? name.trim() : '';
|
|
59
|
+
if (target !== '' && pool.has(target)) {
|
|
60
|
+
const e = pool.get(target);
|
|
61
|
+
if (typeof e === 'function') e(...args);
|
|
67
62
|
};
|
|
68
63
|
};
|
|
69
|
-
|
|
70
|
-
/***
|
|
71
|
-
* (* class definitions *)
|
|
72
|
-
*/
|
|
73
|
-
|
|
74
|
-
// === module exports block ===
|
|
75
|
-
|
|
76
|
-
module.exports.pushEventHandler = pushEventHandler;
|
|
77
64
|
module.exports.triggerEventHandler = triggerEventHandler;
|
|
78
|
-
module.exports.removeEventHandler = removeEventHandler;
|
|
@@ -0,0 +1,165 @@
|
|
|
1
|
+
export namespace CSS_CLASS_STRING {
|
|
2
|
+
export { CSS_CLASS_CURRENT };
|
|
3
|
+
export { CSS_CLASS_SELECTED };
|
|
4
|
+
export { CSS_CLASS_ACTIVE };
|
|
5
|
+
export { CSS_CLASS_DISABLED };
|
|
6
|
+
export { CSS_CLASS_HIDDEN };
|
|
7
|
+
}
|
|
8
|
+
|
|
9
|
+
/**
|
|
10
|
+
* An element descriptor.
|
|
11
|
+
*/
|
|
12
|
+
export type elemDesc = {
|
|
13
|
+
/**
|
|
14
|
+
* - element ID
|
|
15
|
+
*/
|
|
16
|
+
id?: string;
|
|
17
|
+
/**
|
|
18
|
+
* - some text
|
|
19
|
+
*/
|
|
20
|
+
text?: string;
|
|
21
|
+
/**
|
|
22
|
+
* - an attributes list
|
|
23
|
+
*/
|
|
24
|
+
attr?: {
|
|
25
|
+
[x: string]: any;
|
|
26
|
+
};
|
|
27
|
+
/**
|
|
28
|
+
* - a class names list
|
|
29
|
+
* @since 0.0.19
|
|
30
|
+
*/
|
|
31
|
+
classNames?: string | string[];
|
|
32
|
+
/**
|
|
33
|
+
* - a 'dataset'-attributes list
|
|
34
|
+
*/
|
|
35
|
+
data?: {
|
|
36
|
+
[x: string]: any;
|
|
37
|
+
};
|
|
38
|
+
};
|
|
39
|
+
|
|
40
|
+
declare const CSS_CLASS_CURRENT: "current";
|
|
41
|
+
declare const CSS_CLASS_SELECTED: "selected";
|
|
42
|
+
declare const CSS_CLASS_ACTIVE: "active";
|
|
43
|
+
declare const CSS_CLASS_DISABLED: "disabled";
|
|
44
|
+
declare const CSS_CLASS_HIDDEN: "hidden";
|
|
45
|
+
|
|
46
|
+
/**
|
|
47
|
+
* Checks if the given object is an instance of an `HTMLElement`.
|
|
48
|
+
*/
|
|
49
|
+
export function isHTMLElement(obj: any): obj is HTMLElement;
|
|
50
|
+
/**
|
|
51
|
+
* Checks if the given object is an HTML-button.
|
|
52
|
+
*/
|
|
53
|
+
export function isHTMLButton(obj: any): boolean;
|
|
54
|
+
/**
|
|
55
|
+
* Checks if the given object is an instance of a `HTMLElement`
|
|
56
|
+
* and if so it's marked as "current".
|
|
57
|
+
*/
|
|
58
|
+
export function isCurrentHTMLElement(obj: HTMLElement): boolean;
|
|
59
|
+
/**
|
|
60
|
+
* Checks if the given object is an instance of a `HTMLElement`
|
|
61
|
+
* and if so it's marked as "selected".
|
|
62
|
+
*/
|
|
63
|
+
export function isSelectedHTMLElement(obj: HTMLElement): boolean;
|
|
64
|
+
/**
|
|
65
|
+
* Checks if the given object is an instance of a `HTMLElement`
|
|
66
|
+
* and if so it's marked as "active".
|
|
67
|
+
*/
|
|
68
|
+
export function isActiveHTMLElement(obj: HTMLElement): boolean;
|
|
69
|
+
/**
|
|
70
|
+
* Checks if the given object is an instance of a `HTMLElement`
|
|
71
|
+
* and if so it's marked as "hidden".
|
|
72
|
+
*/
|
|
73
|
+
export function isHiddenHTMLElement(obj: HTMLElement): boolean;
|
|
74
|
+
/**
|
|
75
|
+
* Shows a given HTML-element.
|
|
76
|
+
* @since v0.0.23
|
|
77
|
+
*/
|
|
78
|
+
export function showHTMLElement(obj: HTMLElement): boolean;
|
|
79
|
+
/**
|
|
80
|
+
* Hides a given HTML-element.
|
|
81
|
+
* @since v0.0.23
|
|
82
|
+
*/
|
|
83
|
+
export function hideHTMLElement(obj: HTMLElement): boolean;
|
|
84
|
+
/**
|
|
85
|
+
* Makes selected a given HTML-element.
|
|
86
|
+
* @since v0.0.23
|
|
87
|
+
*/
|
|
88
|
+
export function selectHTMLElement(obj: HTMLElement): boolean;
|
|
89
|
+
/**
|
|
90
|
+
* Makes unselected a given HTML-element.
|
|
91
|
+
* @since v0.0.23
|
|
92
|
+
*/
|
|
93
|
+
export function unselectHTMLElement(obj: HTMLElement): boolean;
|
|
94
|
+
/**
|
|
95
|
+
* Marks a given HTML-element as "current".
|
|
96
|
+
* @since v0.0.23
|
|
97
|
+
*/
|
|
98
|
+
export function markHTMLElementAsCurrent(obj: HTMLElement): boolean;
|
|
99
|
+
/**
|
|
100
|
+
* Unmarks a given HTML-element previous marked as "current".
|
|
101
|
+
* @since v0.0.23
|
|
102
|
+
*/
|
|
103
|
+
export function unmarkCurrentHTMLElement(obj: HTMLElement): boolean;
|
|
104
|
+
/**
|
|
105
|
+
* Marks a given HTML-element as "active".
|
|
106
|
+
* @since v0.0.23
|
|
107
|
+
*/
|
|
108
|
+
export function markHTMLElementAsActive(obj: HTMLElement): boolean;
|
|
109
|
+
/**
|
|
110
|
+
* Unmarks a given HTML-element previous marked as "active".
|
|
111
|
+
* @since v0.0.23
|
|
112
|
+
*/
|
|
113
|
+
export function unmarkActiveHTMLElement(obj: HTMLElement): boolean;
|
|
114
|
+
/**
|
|
115
|
+
* Disables a given HTML-element.
|
|
116
|
+
* @since v0.0.23
|
|
117
|
+
*/
|
|
118
|
+
export function lockHTMLElement(obj: HTMLElement): boolean;
|
|
119
|
+
/**
|
|
120
|
+
* Enables a given HTML-element.
|
|
121
|
+
* @since v0.0.23
|
|
122
|
+
*/
|
|
123
|
+
export function unlockHTMLElement(obj: HTMLElement): boolean;
|
|
124
|
+
/**
|
|
125
|
+
* Enables an HTML-elements given by a list of a function params.
|
|
126
|
+
* @since v0.0.23
|
|
127
|
+
*/
|
|
128
|
+
export function activateHTMLElements(...args: HTMLElement[]): void;
|
|
129
|
+
/**
|
|
130
|
+
* Disables an HTML-elements given by a list of a function params.
|
|
131
|
+
* @since v0.0.23
|
|
132
|
+
*/
|
|
133
|
+
export function inactivateHTMLElements(...args: HTMLElement[]): void;
|
|
134
|
+
/**
|
|
135
|
+
* Tries to convert a given value to a list of a valid "class attributes".
|
|
136
|
+
* @since v0.0.13
|
|
137
|
+
*/
|
|
138
|
+
export function valueToClassList(value: any, opt?: boolean): string[];
|
|
139
|
+
/**
|
|
140
|
+
* Creates a new HTML-element.
|
|
141
|
+
* @since 0.0.25
|
|
142
|
+
*/
|
|
143
|
+
export function createNewHTMLElement(tagName: string, opt?: elemDesc): HTMLElement | null;
|
|
144
|
+
/**
|
|
145
|
+
* Tries to convert a given value to a valid "attribute value".
|
|
146
|
+
* @since v0.0.18
|
|
147
|
+
*/
|
|
148
|
+
export function readAsAttrValue(value: any): string | null;
|
|
149
|
+
/**
|
|
150
|
+
* Tries to convert a given value to a valid name of an HTML-tag.
|
|
151
|
+
* @since v0.0.21
|
|
152
|
+
*/
|
|
153
|
+
export function readAsTagName(value: any): string;
|
|
154
|
+
/**
|
|
155
|
+
* Tries to convert a given value to a valid name of an HTML-attribute.
|
|
156
|
+
* @since v0.0.21
|
|
157
|
+
*/
|
|
158
|
+
export function readAsAttrName(value: any): string;
|
|
159
|
+
/**
|
|
160
|
+
* Tries to convert a given value to a valid identifier suitable as a value
|
|
161
|
+
* for an "ID-attribute" of an HTML-element.
|
|
162
|
+
* @since v0.0.22
|
|
163
|
+
*/
|
|
164
|
+
export function valueToElementID(value: any): string;
|
|
165
|
+
export {};
|
package/lib/html-helper-lib.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
// [v0.1.
|
|
1
|
+
// [v0.1.047-20260413]
|
|
2
2
|
|
|
3
3
|
// === module init block ===
|
|
4
4
|
|
|
@@ -15,20 +15,12 @@ const etlHTagInputForBtn = new Set([
|
|
|
15
15
|
|
|
16
16
|
// === module main block ===
|
|
17
17
|
|
|
18
|
-
/***
|
|
19
|
-
* (* constant definitions *)
|
|
20
|
-
*/
|
|
21
|
-
|
|
22
18
|
const CSS_CLASS_CURRENT = 'current';
|
|
23
19
|
const CSS_CLASS_SELECTED = 'selected';
|
|
24
20
|
const CSS_CLASS_ACTIVE = 'active';
|
|
25
21
|
const CSS_CLASS_DISABLED = 'disabled';
|
|
26
22
|
const CSS_CLASS_HIDDEN = 'hidden';
|
|
27
23
|
|
|
28
|
-
/***
|
|
29
|
-
* (* function definitions *)
|
|
30
|
-
*/
|
|
31
|
-
|
|
32
24
|
/**
|
|
33
25
|
* Checks if the given object is an instance of an `HTMLElement`.
|
|
34
26
|
* @function isHTMLElement
|
|
@@ -263,7 +255,7 @@ function unlockHTMLElement(obj) {
|
|
|
263
255
|
* Enables an HTML-elements given by a list of a function params.
|
|
264
256
|
* @since v0.0.23
|
|
265
257
|
* @function activateHTMLElements
|
|
266
|
-
* @param {...HTMLElement}
|
|
258
|
+
* @param {...HTMLElement} args - some element
|
|
267
259
|
* @return {void}
|
|
268
260
|
*/
|
|
269
261
|
function activateHTMLElements(...args) {
|
|
@@ -276,7 +268,7 @@ function activateHTMLElements(...args) {
|
|
|
276
268
|
* Disables an HTML-elements given by a list of a function params.
|
|
277
269
|
* @since v0.0.23
|
|
278
270
|
* @function inactivateHTMLElements
|
|
279
|
-
* @param {...HTMLElement}
|
|
271
|
+
* @param {...HTMLElement} args - some element
|
|
280
272
|
* @return {void}
|
|
281
273
|
*/
|
|
282
274
|
function inactivateHTMLElements(...args) {
|
|
@@ -367,16 +359,16 @@ function readAsAttrValue(value) {
|
|
|
367
359
|
* @return {string[]}
|
|
368
360
|
*/
|
|
369
361
|
function valueToClassList(value, opt) {
|
|
362
|
+
/** @type {string[]} */
|
|
370
363
|
let result = [];
|
|
371
|
-
|
|
372
|
-
list.forEach((elem) => {
|
|
364
|
+
valueToArray(value).forEach((elem) => {
|
|
373
365
|
let value = '';
|
|
374
366
|
if (
|
|
375
367
|
typeof elem === 'string'
|
|
376
368
|
&& ((value = elem.trim()) !== '')
|
|
377
369
|
) {
|
|
378
|
-
|
|
379
|
-
if (
|
|
370
|
+
const a = value.split(/\s+/);
|
|
371
|
+
if (a.length > 0) result.push(...a);
|
|
380
372
|
};
|
|
381
373
|
});
|
|
382
374
|
if (result.length > 0 && typeof opt === 'boolean' && opt) {
|
|
@@ -454,8 +446,8 @@ function createNewHTMLElement(tagName, opt) {
|
|
|
454
446
|
};
|
|
455
447
|
// set an attributes of the element
|
|
456
448
|
if (isObject(attr)) {
|
|
457
|
-
|
|
458
|
-
for (let [ key, value ] of
|
|
449
|
+
const data = isArray(attr) ? attr : Object.entries(attr);
|
|
450
|
+
for (let [ key, value ] of data ) {
|
|
459
451
|
if (
|
|
460
452
|
((key = readAsAttrName(key)) !== '')
|
|
461
453
|
) {
|
|
@@ -482,8 +474,8 @@ function createNewHTMLElement(tagName, opt) {
|
|
|
482
474
|
};
|
|
483
475
|
// set a data-attributes of the element
|
|
484
476
|
if (isObject(dset)) {
|
|
485
|
-
|
|
486
|
-
for (let [ key, value ] of
|
|
477
|
+
const data = isArray(dset) ? dset : Object.entries(dset);
|
|
478
|
+
for (let [ key, value ] of data ) {
|
|
487
479
|
if (
|
|
488
480
|
((key = readAsAttrName(key)) !== '')
|
|
489
481
|
&& ((value = readAsAttrValue(value)) !== null)
|
|
@@ -498,10 +490,6 @@ function createNewHTMLElement(tagName, opt) {
|
|
|
498
490
|
return item;
|
|
499
491
|
};
|
|
500
492
|
|
|
501
|
-
/***
|
|
502
|
-
* (* class definitions *)
|
|
503
|
-
*/
|
|
504
|
-
|
|
505
493
|
// === module exports block ===
|
|
506
494
|
|
|
507
495
|
module.exports.CSS_CLASS_STRING = /*function(){ return*/ {
|
|
@@ -540,6 +528,3 @@ module.exports.readAsAttrValue = readAsAttrValue;
|
|
|
540
528
|
module.exports.readAsTagName = readAsTagName;
|
|
541
529
|
module.exports.readAsAttrName = readAsAttrName;
|
|
542
530
|
module.exports.valueToElementID = valueToElementID;
|
|
543
|
-
|
|
544
|
-
// * re-exported *
|
|
545
|
-
module.exports.valueToIDString = valueToIDString;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@cntwg/html-helper",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.3",
|
|
4
4
|
"description": "A base HTML-helper library for js",
|
|
5
5
|
"author": "ygracs <cs70th-om@rambler.ru>",
|
|
6
6
|
"license": "MIT",
|
|
@@ -13,11 +13,14 @@
|
|
|
13
13
|
"html"
|
|
14
14
|
],
|
|
15
15
|
"main": "./index.js",
|
|
16
|
+
"types": "./index.d.ts",
|
|
16
17
|
"files": [
|
|
17
18
|
"doc/*.md",
|
|
18
19
|
"lib/html-helper-lib.js",
|
|
19
20
|
"lib/event-hfunc.js",
|
|
21
|
+
"lib/*.d.ts",
|
|
20
22
|
"index.js",
|
|
23
|
+
"index.d.ts",
|
|
21
24
|
"CHANGELOG.md"
|
|
22
25
|
],
|
|
23
26
|
"scripts": {
|
|
@@ -26,19 +29,22 @@
|
|
|
26
29
|
"test-bs:g1": "jest base/fg-1",
|
|
27
30
|
"test-bs:g2": "jest base/fg-2",
|
|
28
31
|
"build-doc-md": "jsdoc2md",
|
|
29
|
-
"build-doc-html": "jsdoc"
|
|
32
|
+
"build-doc-html": "jsdoc",
|
|
33
|
+
"gen-dts": "npx -p typescript tsc"
|
|
30
34
|
},
|
|
31
35
|
"imports": {
|
|
32
36
|
"#lib/*": "./lib/*",
|
|
33
37
|
"#test-dir/*": "./__test__/*"
|
|
34
38
|
},
|
|
35
39
|
"dependencies": {
|
|
36
|
-
"@ygracs/bsfoc-lib-js": "
|
|
40
|
+
"@ygracs/bsfoc-lib-js": "~0.3.4"
|
|
37
41
|
},
|
|
38
42
|
"devDependencies": {
|
|
39
|
-
"
|
|
40
|
-
"jest
|
|
43
|
+
"@ygracs/test-helper": "~0.0.2-b",
|
|
44
|
+
"jest": "^30.3.0",
|
|
45
|
+
"jest-environment-jsdom": "^30.3.0",
|
|
41
46
|
"jsdoc-to-markdown": "^9.1.3",
|
|
42
|
-
"minimist": "^1.2.8"
|
|
47
|
+
"minimist": "^1.2.8",
|
|
48
|
+
"typescript": "~5.9.3"
|
|
43
49
|
}
|
|
44
50
|
}
|