powerpagestoolkit 2.7.1 → 2.7.2

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,150 @@
1
+ /// <reference path="../core/DOMNodeReference.ts"/>
2
+
3
+ declare interface CreationOptions {
4
+ /**
5
+ * Should this call return an array of instantiated references, or just a single?
6
+ * Defaults to false, returning a single instance.
7
+ */
8
+ multiple?: (() => boolean) | boolean;
9
+
10
+ /**
11
+ * Optionally specify the element within which to search for the element targeted by 'target'.
12
+ * Defaults to 'document.body'.
13
+ */
14
+ root?: HTMLElement;
15
+
16
+ /**
17
+ * Optionally specify the amount of time that should be waited to find the targeted element before throwing an error.
18
+ * Useful for async DOM loading. Relies on MutationObserver.
19
+ * WARNING: Implementing multiple references with timeout can result in infinite loading.
20
+ */
21
+ timeoutMs?: number;
22
+ }
23
+
24
+ declare interface SystemForm extends Object {
25
+ "@odata.context": string;
26
+ "@odata.etag": string;
27
+ "overwritetime@OData.Community.Display.V1.FormattedValue": string;
28
+ overwritetime: Date;
29
+ "isdesktopenabled@OData.Community.Display.V1.FormattedValue": string;
30
+ isdesktopenabled: boolean;
31
+ "publishedon@OData.Community.Display.V1.FormattedValue": Date;
32
+ publishedon: Date;
33
+ "_organizationid_value@OData.Community.Display.V1.FormattedValue": string;
34
+ "_organizationid_value@Microsoft.Dynamics.CRM.associatednavigationproperty": string;
35
+ "_organizationid_value@Microsoft.Dynamics.CRM.lookuplogicalname": string;
36
+ _organizationid_value: string;
37
+ formxml: string;
38
+ introducedversion: string;
39
+ "isairmerged@OData.Community.Display.V1.FormattedValue": string;
40
+ isairmerged: boolean;
41
+ "istabletenabled@OData.Community.Display.V1.FormattedValue": string;
42
+ istabletenabled: boolean;
43
+ solutionid: string;
44
+ formidunique: string;
45
+ "ismanaged@OData.Community.Display.V1.FormattedValue": string;
46
+ ismanaged: boolean;
47
+ "isdefault@OData.Community.Display.V1.FormattedValue": string;
48
+ isdefault: boolean;
49
+ "objecttypecode@OData.Community.Display.V1.FormattedValue": string;
50
+ objecttypecode: string;
51
+ "type@OData.Community.Display.V1.FormattedValue": string;
52
+ type: number;
53
+ "componentstate@OData.Community.Display.V1.FormattedValue": string;
54
+ componentstate: number;
55
+ "formpresentation@OData.Community.Display.V1.FormattedValue": string;
56
+ formpresentation: number;
57
+ "formactivationstate@OData.Community.Display.V1.FormattedValue": string;
58
+ formactivationstate: number;
59
+ name: string;
60
+ "versionnumber@OData.Community.Display.V1.FormattedValue": string;
61
+ versionnumber: number;
62
+ formjson: string;
63
+ description: string;
64
+ formid: string;
65
+ }
66
+
67
+ declare interface Form extends Partial<SystemForm> {
68
+ formxml: string;
69
+ }
70
+
71
+ declare interface BusinessRule {
72
+ /**
73
+ * @param condition A function that returns a boolean to determine
74
+ * the visibility of the target element. If `condition()` returns true, the element is shown;
75
+ * otherwise, it is hidden.
76
+
77
+ * @param clearValuesOnHide Should the values in the targeted field be cleared when hidden? Defaults to true
78
+ */
79
+ setVisibility?: [
80
+ condition: (this: DOMNodeReference) => boolean,
81
+ clearValuesOnHide?: boolean
82
+ ];
83
+ /**
84
+ * @param isRequired Function determining if field is required
85
+ * @param isValid Function validating field input.
86
+ */
87
+ setRequired?: [
88
+ isRequired: () => boolean,
89
+ isValid: (this: DOMNodeReference, isRequired: boolean) => boolean
90
+ ];
91
+ /**
92
+ * @param condition A function to determine if the value provided should be applied to this field
93
+ * @param value The value to set for the HTML element.
94
+ * for parents of boolean radios, pass true or false as value, or
95
+ * an expression returning a boolean
96
+ */
97
+ setValue?: [
98
+ condition: (this: DOMNodeReference) => boolean,
99
+ value: (() => any) | any
100
+ ];
101
+ /**
102
+ * @param condition A function to determine if this field
103
+ * should be enabled in a form, or disabled. True || 1 = disabled. False || 0 = enabled
104
+ */
105
+ setDisabled?: () => boolean;
106
+ }
107
+
108
+ declare interface CreationOptions {
109
+ /**
110
+ * Should this call return an array of instantiated references, or just a single?
111
+ * Defaults to false, returning a single instance.
112
+ */
113
+ multiple?: (() => boolean) | boolean;
114
+
115
+ /**
116
+ * Optionally specify the element within which to search for the element targeted by 'target'.
117
+ * Defaults to 'document.body'.
118
+ */
119
+ root?: HTMLElement;
120
+
121
+ /**
122
+ * Optionally specify the amount of time that should be waited to find the targeted element before throwing an error.
123
+ * Useful for async DOM loading. Relies on MutationObserver.
124
+ * WARNING: Implementing multiple references with timeout can result in infinite loading.
125
+ */
126
+ timeoutMs?: number;
127
+ }
128
+
129
+ declare const Page_Validators: any[];
130
+
131
+ declare interface ElementValue {
132
+ value: any;
133
+ checked?: boolean;
134
+ }
135
+
136
+ declare type RadioType = "truthy" | "falsy";
137
+
138
+ declare interface BoundEventListener {
139
+ element: Element;
140
+ event: keyof HTMLElementEventMap;
141
+ handler: (e: Event) => unknown;
142
+ }
143
+
144
+ declare type FormElement =
145
+ | HTMLInputElement
146
+ | HTMLSelectElement
147
+ | HTMLTextAreaElement
148
+ | HTMLSpanElement
149
+ | HTMLButtonElement
150
+ | HTMLFieldSetElement;
@@ -0,0 +1,5 @@
1
+ import API from "./core/API.d.ts";
2
+ import createRef from "./core/createDOMNodeReferences.d.ts";
3
+ import waitFor from "./core/waitFor.d.ts";
4
+ import bindForm from "./core/bindForm.d.ts";
5
+ export { API, bindForm, createRef, waitFor };