powerpagestoolkit 1.0.14 → 1.0.21
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/index.d.ts +113 -1
- package/package.json +1 -1
package/index.d.ts
CHANGED
|
@@ -1,36 +1,147 @@
|
|
|
1
1
|
declare module "powerpagestoolkit" {
|
|
2
|
+
/**
|
|
3
|
+
* Class representing a reference to a DOM node.
|
|
4
|
+
*/
|
|
2
5
|
class DOMNodeReference {
|
|
6
|
+
/**
|
|
7
|
+
* Creates an instance of DOMNodeReference.
|
|
8
|
+
* @param {string} querySelector - The CSS selector to find the desired DOM element.
|
|
9
|
+
*/
|
|
3
10
|
constructor(querySelector: string);
|
|
11
|
+
|
|
4
12
|
element: HTMLElement | null;
|
|
5
13
|
isLoaded: boolean;
|
|
6
14
|
|
|
15
|
+
/**
|
|
16
|
+
* Initializes the DOMNodeReference instance by waiting for the element to be available in the DOM.
|
|
17
|
+
* @returns {Promise<Proxy>} A promise that resolves to a Proxy of the DOMNodeReference instance.
|
|
18
|
+
* @throws {Error} Throws an error if the element cannot be found using the provided query selector.
|
|
19
|
+
*/
|
|
7
20
|
init(): Promise<this>;
|
|
8
21
|
|
|
22
|
+
/**
|
|
23
|
+
* Hides the element by setting its display style to "none".
|
|
24
|
+
*/
|
|
9
25
|
hide(): void;
|
|
26
|
+
|
|
27
|
+
/**
|
|
28
|
+
* Shows the element by restoring its default display style.
|
|
29
|
+
*/
|
|
10
30
|
show(): void;
|
|
31
|
+
|
|
32
|
+
/**
|
|
33
|
+
* Hides the parent element by setting its display style to "none".
|
|
34
|
+
*/
|
|
11
35
|
hideParent(): void;
|
|
36
|
+
|
|
37
|
+
/**
|
|
38
|
+
* Shows the parent element by restoring its default display style.
|
|
39
|
+
*/
|
|
12
40
|
showParent(): void;
|
|
41
|
+
|
|
42
|
+
/**
|
|
43
|
+
* Hides the container (grandparent of the element) by setting its display style to "none".
|
|
44
|
+
*/
|
|
13
45
|
hideContainer(): void;
|
|
46
|
+
|
|
47
|
+
/**
|
|
48
|
+
* Shows the container (grandparent of the element) by restoring its default display style.
|
|
49
|
+
*/
|
|
14
50
|
showContainer(): void;
|
|
51
|
+
|
|
52
|
+
/**
|
|
53
|
+
* Sets the value of the HTML element.
|
|
54
|
+
* @param {string} value - The value to set for the HTML element.
|
|
55
|
+
*/
|
|
15
56
|
setValue(value: string): void;
|
|
57
|
+
|
|
58
|
+
/**
|
|
59
|
+
* Gets the value of the HTML element.
|
|
60
|
+
* @returns {string} The current value of the HTML element.
|
|
61
|
+
*/
|
|
16
62
|
getValue(): string;
|
|
63
|
+
|
|
64
|
+
/**
|
|
65
|
+
* Appends child elements to the HTML element.
|
|
66
|
+
* @param {...HTMLElement} elements - The elements to append to the HTML element.
|
|
67
|
+
*/
|
|
17
68
|
append(...elements: HTMLElement[]): void;
|
|
69
|
+
|
|
70
|
+
/**
|
|
71
|
+
* Inserts elements after the HTML element.
|
|
72
|
+
* @param {...HTMLElement} elements - The elements to insert after the HTML element.
|
|
73
|
+
*/
|
|
18
74
|
after(...elements: HTMLElement[]): void;
|
|
75
|
+
|
|
76
|
+
/**
|
|
77
|
+
* Retrieves the label associated with the HTML element.
|
|
78
|
+
* @returns {HTMLElement} The label element associated with this element.
|
|
79
|
+
* @throws {Error} Throws an error if the label cannot be found.
|
|
80
|
+
*/
|
|
19
81
|
getLabel(): HTMLElement;
|
|
82
|
+
|
|
83
|
+
/**
|
|
84
|
+
* Appends child elements to the label associated with the HTML element.
|
|
85
|
+
* @param {...HTMLElement} elements - The elements to append to the label.
|
|
86
|
+
*/
|
|
20
87
|
appendToLabel(...elements: HTMLElement[]): void;
|
|
88
|
+
|
|
89
|
+
/**
|
|
90
|
+
* Adds a click event listener to the HTML element.
|
|
91
|
+
* @param {Function} eventHandler - The function to execute when the element is clicked.
|
|
92
|
+
*/
|
|
21
93
|
addClickListener(eventHandler: () => void): void;
|
|
94
|
+
|
|
95
|
+
/**
|
|
96
|
+
* Adds a change event listener to the HTML element.
|
|
97
|
+
* @param {Function} eventHandler - The function to execute when the element's value changes.
|
|
98
|
+
*/
|
|
22
99
|
addChangeListener(eventHandler: () => void): void;
|
|
100
|
+
|
|
101
|
+
/**
|
|
102
|
+
* Unchecks both the yes and no radio buttons if they exist.
|
|
103
|
+
*/
|
|
23
104
|
uncheckRadios(): void;
|
|
105
|
+
|
|
106
|
+
/**
|
|
107
|
+
* Creates a validation instance for the field.
|
|
108
|
+
* @param {Function} evaluationFunction - The function used to evaluate the field.
|
|
109
|
+
* @param {string} fieldDisplayName - The field name to display in error if validation fails.
|
|
110
|
+
*/
|
|
24
111
|
createValidation(
|
|
25
112
|
evaluationFunction: (value: any) => boolean,
|
|
26
113
|
fieldDisplayName: string
|
|
27
114
|
): void;
|
|
115
|
+
|
|
116
|
+
/**
|
|
117
|
+
* Adds a tooltip with specified text to the label associated with the HTML element.
|
|
118
|
+
* @param {string} text - The text to display in the tooltip.
|
|
119
|
+
*/
|
|
28
120
|
addLabelTooltip(text: string): void;
|
|
121
|
+
|
|
122
|
+
/**
|
|
123
|
+
* Sets the inner HTML content of the HTML element.
|
|
124
|
+
* @param {string} text - The text to set as the inner HTML of the element.
|
|
125
|
+
*/
|
|
29
126
|
setTextContent(text: string): void;
|
|
127
|
+
|
|
128
|
+
/**
|
|
129
|
+
* Executes a callback function once the element is fully loaded.
|
|
130
|
+
* If the element is already loaded, the callback is called immediately.
|
|
131
|
+
* Otherwise, a MutationObserver is used to detect when the element is added to the DOM.
|
|
132
|
+
* @param {Function} callback - A callback function to execute once the element is loaded.
|
|
133
|
+
*/
|
|
30
134
|
onceLoaded(callback: (instance: this) => void): void;
|
|
31
135
|
}
|
|
32
136
|
|
|
33
|
-
|
|
137
|
+
/**
|
|
138
|
+
* Creates and initializes a DOMNodeReference instance.
|
|
139
|
+
* @async
|
|
140
|
+
* @function createDOMNodeReference
|
|
141
|
+
* @param {string} querySelector - The CSS selector for the desired DOM element.
|
|
142
|
+
* @returns {Promise<DOMNodeReference>} A promise that resolves to a Proxy of the initialized DOMNodeReference instance.
|
|
143
|
+
*/
|
|
144
|
+
export default function createDOMNodeReference(
|
|
34
145
|
querySelector: string
|
|
35
146
|
): Promise<DOMNodeReference>;
|
|
36
147
|
|
|
@@ -39,6 +150,7 @@ declare module "powerpagestoolkit" {
|
|
|
39
150
|
value(): any; // Adjust this type based on the structure of your schema values
|
|
40
151
|
}
|
|
41
152
|
|
|
153
|
+
|
|
42
154
|
export interface API {
|
|
43
155
|
/**
|
|
44
156
|
* Creates a new record in DataVerse.
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "powerpagestoolkit",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.21",
|
|
4
4
|
"description": "Reference, manipulate, and engage with Power Pages sites through the nodes in the DOM; use a variety of custom methods that allow customizing your power pages site quicker and easier. ",
|
|
5
5
|
"main": "index.js",
|
|
6
6
|
"types": "index.d.ts",
|