mount-observer 0.0.112 → 0.1.1

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.
Files changed (181) hide show
  1. package/Events.js +62 -26
  2. package/Events.ts +52 -30
  3. package/MountObserver.js +285 -514
  4. package/MountObserver.ts +362 -538
  5. package/README.md +149 -56
  6. package/SharedMutationObserver.js +70 -0
  7. package/SharedMutationObserver.ts +96 -0
  8. package/attrCoordinates.js +93 -0
  9. package/attrCoordinates.ts +122 -0
  10. package/index.js +3 -0
  11. package/index.ts +22 -0
  12. package/loadImports.js +47 -0
  13. package/loadImports.ts +56 -0
  14. package/mediaQuery.js +86 -0
  15. package/mediaQuery.ts +113 -0
  16. package/package.json +11 -119
  17. package/playwright.config.ts +0 -1
  18. package/types.d.ts +104 -0
  19. package/whereAttr.js +174 -0
  20. package/whereAttr.ts +221 -0
  21. package/LICENSE +0 -21
  22. package/Newish.js +0 -145
  23. package/Newish.ts +0 -169
  24. package/ObsAttr.js +0 -18
  25. package/ObsAttr.ts +0 -18
  26. package/RootMutObs.js +0 -49
  27. package/RootMutObs.ts +0 -58
  28. package/Synthesizer.js +0 -125
  29. package/Synthesizer.ts +0 -130
  30. package/bindish.js +0 -15
  31. package/bindish.ts +0 -22
  32. package/compose.js +0 -148
  33. package/compose.ts +0 -164
  34. package/doCleanup.js +0 -31
  35. package/doCleanup.ts +0 -34
  36. package/getWhereAttrSelector.js +0 -83
  37. package/getWhereAttrSelector.ts +0 -92
  38. package/preloadContent.js +0 -44
  39. package/preloadContent.ts +0 -47
  40. package/readAttrs.ts +0 -60
  41. package/refid/README.md +0 -259
  42. package/refid/arr.js +0 -4
  43. package/refid/arr.ts +0 -4
  44. package/refid/camelToKebab.js +0 -4
  45. package/refid/camelToKebab.ts +0 -4
  46. package/refid/genIds.js +0 -190
  47. package/refid/genIds.ts +0 -177
  48. package/refid/getAdjRefs.js +0 -38
  49. package/refid/getAdjRefs.ts +0 -38
  50. package/refid/getContext.js +0 -13
  51. package/refid/getContext.ts +0 -14
  52. package/refid/getCount.js +0 -8
  53. package/refid/getCount.ts +0 -8
  54. package/refid/getIsh.js +0 -35
  55. package/refid/getIsh.ts +0 -37
  56. package/refid/hostish.js +0 -18
  57. package/refid/hostish.ts +0 -20
  58. package/refid/ism.js +0 -78
  59. package/refid/ism.ts +0 -81
  60. package/refid/itemprops.js +0 -60
  61. package/refid/itemprops.ts +0 -67
  62. package/refid/joinMatching.js +0 -56
  63. package/refid/joinMatching.ts +0 -54
  64. package/refid/nudge.js +0 -23
  65. package/refid/nudge.ts +0 -23
  66. package/refid/regIsh.js +0 -27
  67. package/refid/regIsh.ts +0 -31
  68. package/refid/secretKeys.js +0 -5
  69. package/refid/secretKeys.ts +0 -5
  70. package/refid/splitRefs.js +0 -6
  71. package/refid/splitRefs.ts +0 -6
  72. package/refid/stdVal.js +0 -15
  73. package/refid/stdVal.ts +0 -15
  74. package/refid/via.js +0 -114
  75. package/refid/via.ts +0 -113
  76. package/slotkin/affine.js +0 -39
  77. package/slotkin/affine.ts +0 -46
  78. package/slotkin/beKindred.js +0 -45
  79. package/slotkin/beKindred.ts +0 -55
  80. package/slotkin/getBreadth.js +0 -19
  81. package/slotkin/getBreadth.ts +0 -21
  82. package/slotkin/getFrag.js +0 -22
  83. package/slotkin/getFrag.ts +0 -21
  84. package/slotkin/toQuery.js +0 -12
  85. package/slotkin/toQuery.ts +0 -13
  86. package/slotkin/wrap.js +0 -13
  87. package/slotkin/wrap.ts +0 -18
  88. package/ts-refs/LICENSE +0 -21
  89. package/ts-refs/README.md +0 -18
  90. package/ts-refs/be-a-beacon/types.d.ts +0 -22
  91. package/ts-refs/be-alit/types.d.ts +0 -1
  92. package/ts-refs/be-based/types.d.ts +0 -32
  93. package/ts-refs/be-bound/types.d.ts +0 -65
  94. package/ts-refs/be-buttoned-up/types.d.ts +0 -21
  95. package/ts-refs/be-calculating/types.d.ts +0 -57
  96. package/ts-refs/be-clonable/types.d.ts +0 -28
  97. package/ts-refs/be-committed/types.d.ts +0 -26
  98. package/ts-refs/be-consoling/types.d.ts +0 -25
  99. package/ts-refs/be-counted/types.d.ts +0 -88
  100. package/ts-refs/be-delible/types.d.ts +0 -26
  101. package/ts-refs/be-directive/types.d.ts +0 -43
  102. package/ts-refs/be-dispatching/types.d.ts +0 -41
  103. package/ts-refs/be-elevating/types.d.ts +0 -55
  104. package/ts-refs/be-enhanced/types.d.ts +0 -32
  105. package/ts-refs/be-enhancing/types.d.ts +0 -31
  106. package/ts-refs/be-evanescent/types.d.ts +0 -20
  107. package/ts-refs/be-eventing/types.d.ts +0 -27
  108. package/ts-refs/be-exportable/types.d.ts +0 -26
  109. package/ts-refs/be-fetching/types.d.ts +0 -73
  110. package/ts-refs/be-flashy/types.d.ts +0 -27
  111. package/ts-refs/be-formalizing/types.d.ts +0 -29
  112. package/ts-refs/be-formidable/types.d.ts +0 -64
  113. package/ts-refs/be-giddy/types.d.ts +0 -26
  114. package/ts-refs/be-gingerly/types.d.ts +0 -19
  115. package/ts-refs/be-gone/types.d.ts +0 -24
  116. package/ts-refs/be-hashing-out/types.d.ts +0 -22
  117. package/ts-refs/be-hive/types.d.ts +0 -18
  118. package/ts-refs/be-imbued/types.d.ts +0 -30
  119. package/ts-refs/be-included/types.d.ts +0 -20
  120. package/ts-refs/be-inclusive/types.d.ts +0 -30
  121. package/ts-refs/be-intersectional/types.d.ts +0 -37
  122. package/ts-refs/be-intl/types.d.ts +0 -28
  123. package/ts-refs/be-invoking/types.d.ts +0 -28
  124. package/ts-refs/be-joining/types.d.ts +0 -26
  125. package/ts-refs/be-kvetching/types.d.ts +0 -24
  126. package/ts-refs/be-lazy/types.d.ts +0 -29
  127. package/ts-refs/be-literate/types.d.ts +0 -29
  128. package/ts-refs/be-mediating/types.d.ts +0 -34
  129. package/ts-refs/be-methodical/types.d.ts +0 -20
  130. package/ts-refs/be-modding/types.d.ts +0 -18
  131. package/ts-refs/be-observant/types.d.ts +0 -27
  132. package/ts-refs/be-observing/types.d.ts +0 -84
  133. package/ts-refs/be-parsed/types.d.ts +0 -19
  134. package/ts-refs/be-parsing/types.d.ts +0 -37
  135. package/ts-refs/be-persistent/types.d.ts +0 -66
  136. package/ts-refs/be-propagating/types.d.ts +0 -26
  137. package/ts-refs/be-reformable/types.d.ts +0 -48
  138. package/ts-refs/be-render-neutral/types.d.ts +0 -31
  139. package/ts-refs/be-scoped/types.d.ts +0 -24
  140. package/ts-refs/be-sharing/types.d.ts +0 -17
  141. package/ts-refs/be-switched/types.d.ts +0 -155
  142. package/ts-refs/be-typed/types.d.ts +0 -36
  143. package/ts-refs/be-value-added/types.d.ts +0 -34
  144. package/ts-refs/be-valued/types.d.ts +0 -22
  145. package/ts-refs/be-written/types.d.ts +0 -59
  146. package/ts-refs/css-charts/types.d.ts +0 -38
  147. package/ts-refs/css-echarts/types.d.ts +0 -13
  148. package/ts-refs/data-props/types.d.ts +0 -27
  149. package/ts-refs/do-inc/types.d.ts +0 -28
  150. package/ts-refs/do-invoke/types.d.ts +0 -28
  151. package/ts-refs/do-toggle/types.d.ts +0 -27
  152. package/ts-refs/em-bower/types.d.ts +0 -24
  153. package/ts-refs/fetch-for/types.d.ts +0 -37
  154. package/ts-refs/folder-picker/types.d.ts +0 -43
  155. package/ts-refs/for-fetch/doc.d.ts +0 -98
  156. package/ts-refs/for-fetch/types.d.ts +0 -83
  157. package/ts-refs/mount-observer/types.d.ts +0 -248
  158. package/ts-refs/mt-si/types.d.ts +0 -21
  159. package/ts-refs/per-each/types.d.ts +0 -51
  160. package/ts-refs/soak-up/types.d.ts +0 -36
  161. package/ts-refs/trans-render/XV/types.d.ts +0 -69
  162. package/ts-refs/trans-render/asmr/types.d.ts +0 -138
  163. package/ts-refs/trans-render/be/types.d.ts +0 -198
  164. package/ts-refs/trans-render/dss/types.d.ts +0 -57
  165. package/ts-refs/trans-render/froop/types.d.ts +0 -416
  166. package/ts-refs/trans-render/funions/types.d.ts +0 -12
  167. package/ts-refs/trans-render/lib/mixins/types.d.ts +0 -42
  168. package/ts-refs/trans-render/lib/prs/types.d.ts +0 -40
  169. package/ts-refs/trans-render/lib/types.d.ts +0 -489
  170. package/ts-refs/trans-render/types.d.ts +0 -583
  171. package/ts-refs/wc-info/SimpleWCInfo.d.ts +0 -15
  172. package/ts-refs/when-resolved/types.d.ts +0 -30
  173. package/ts-refs/xp-as/types.d.ts +0 -20
  174. package/ts-refs/xtal-element/types.d.ts +0 -43
  175. package/ts-refs/xtal-frappe-chart/types.d.ts +0 -193
  176. package/upShadowSearch.js +0 -25
  177. package/upShadowSearch.ts +0 -23
  178. package/waitForEvent.js +0 -12
  179. package/waitForEvent.ts +0 -13
  180. package/waitForIsh.js +0 -21
  181. package/waitForIsh.ts +0 -20
@@ -1,42 +0,0 @@
1
- import {UnitOfWork, ITransformer, RHS, ToTransformer, XForm} from '../../types';
2
-
3
- export interface TemplMgmtProps<MCProps extends Partial<HTMLElement> = HTMLElement, MCMethods = MCProps>{
4
- mainTemplate?: HTMLTemplateElement | string;
5
- unsafeTCount: number;
6
- styles?: CSSStyleSheet[] | string;
7
- clonedTemplate?: Node | undefined;
8
- shadowRootMode?: 'open' | 'closed' | undefined | false;
9
- //xform: Partial<{[key: string]: RHS<any, any>}>,
10
- /**
11
- * transform within ShadowRoot if applicable
12
- */
13
- xform: XForm<any, any, any>,
14
- /**
15
- * transform applied to light children, if applicable
16
- * Use ":root" to match on the root element
17
- */
18
- lcXform: XForm<any, any>,
19
- xformImpl?: () => Promise<ToTransformer<MCProps, MCMethods>>,
20
- skipTemplateClone?: boolean;
21
- //homeInOn?: Partial<{[key in keyof MCProps]: Partial<{[key: string]: RHS<MCProps, MCMethods>}>}>;
22
- }
23
-
24
-
25
- export interface TemplMgmtActions{
26
- doTransforms(self: this): void;
27
- cloneTemplate(self: this): void;
28
- }
29
-
30
- export interface TemplMgmtBase extends HTMLElement, TemplMgmtProps, TemplMgmtActions{}
31
-
32
- // export interface LocalizerProps {
33
-
34
- // }
35
- // export interface LocalizerMethods{
36
- // localize(model: any, transformer: ITransformer<any, any>, uow: UnitOfWork<any, any>, matchingElement: Element): string | Partial<HTMLDataElement> | Partial<HTMLTimeElement> | undefined;
37
- // }
38
-
39
- // export interface Localizer extends HTMLElement, LocalizerProps, LocalizerMethods {}
40
-
41
- // export type LocalizerType = {new(): Localizer }
42
-
@@ -1,40 +0,0 @@
1
- import { Scope } from "../types";
2
-
3
- export type ElTypes = '$' | '#' | '@' | '/' | '-' | '|' | '%' | '~';
4
-
5
-
6
- export interface ElO {
7
- /**
8
- * User of the name "prop" is a bit loose. It is really a kind of identifier that
9
- * **may** map to a prop, but it will typically not will map to an actual prop of the
10
- * observed element, but rather to some property of a view model of the hosting element
11
- * or of a peer, non-visual "web component as a service" sitting somewhere inside the Shadow
12
- * DOM scope.
13
- */
14
- prop?: string,
15
- subProp?: string,
16
- elType?: ElTypes,
17
- perimeter?: string,
18
- event?: string,
19
- //TODO
20
- floor?: string,
21
- marker?: string,
22
- scope?: Scope,
23
- }
24
-
25
- export interface RegExpExt<TStatementGroup = any>{
26
- regExp: RegExp | string,
27
- defaultVals: Partial<TStatementGroup>,
28
- dssKeys?: [string, string][],
29
- dssArrayKeys?: [string, string][],
30
- statementPartParser?: StatementPartParser,
31
-
32
- }
33
-
34
- export interface StatementPartParser {
35
- splitWord: string,
36
- propMap: {[key: string]: Array<RegExpExt>},
37
- parsedRegExps?: boolean,
38
- }
39
-
40
- export type RegExpOrRegExpExt<TStatementGroup = any> = RegExp | RegExpExt<TStatementGroup>;
@@ -1,489 +0,0 @@
1
- import {RHS, ToTransformer} from '../types';
2
-
3
-
4
- export type matchTypes = 'parts'| 'part' | 'id' | 'classes' | 'class' | 'attribs' | 'attrib' | 'elements' | 'element' | 'names' | 'name' | 'props' | 'placeholders';
5
-
6
- export interface QueryInfo{
7
- query: string;
8
- match: string;
9
- attrib?: string;
10
- lhsProp?: string;
11
- first?: boolean;
12
- verb?: string;
13
- havingAlso?: QueryInfo[];
14
- havingInner?: QueryInfo;
15
- }
16
-
17
-
18
- export type PropSettings<T extends Partial<HTMLElement> = HTMLElement, HostProps = any> = {
19
- [P in keyof T]?: keyof HostProps;
20
- };
21
-
22
- export type EventSettings = {[key: string] : ((e: Event) => void) | string | INotify};
23
-
24
- export interface IMinimalNotify{
25
-
26
- nudge?: boolean;
27
-
28
- debug?: boolean;
29
-
30
- eventListenerOptions?: boolean | AddEventListenerOptions | undefined;
31
-
32
- doInit?: boolean;
33
- }
34
-
35
- export interface IDIYNotify extends IMinimalNotify{
36
- doOnly?: (target: Element, key: string, mn: IMinimalNotify, e?: Event) => void;
37
- }
38
-
39
- export interface IValFromEventInstructions<TSelf = any, TProps = any, TActions = TProps> {
40
- /**
41
- * Hardcoded value to set on recipient element.
42
- */
43
- val?: any
44
- /**
45
- * path to get value from target
46
- */
47
- valFromTarget?: keyof TSelf;
48
- /**
49
- * path to get value from target
50
- */
51
- vft?: keyof TSelf | `${keyof TSelf & string}.${string}`;
52
- /**
53
- * path to get value from event
54
- */
55
- valFromEvent?: string;
56
- /**
57
- * path to get value from event
58
- */
59
- vfe?: string;
60
-
61
- propName?: string;
62
-
63
- clone?: boolean;
64
-
65
- parseValAs?: 'int' | 'float' | 'bool' | 'date' | 'truthy' | 'falsy' | undefined | 'string' | 'object';
66
-
67
- trueVal?: any;
68
-
69
- falseVal?: any;
70
- }
71
-
72
-
73
- export interface INotify<TSelf = any, TProps = any, TActions = TProps> extends IMinimalNotify, IValFromEventInstructions<TSelf, TProps, TActions>{
74
-
75
- navTo?: string;
76
-
77
- /**
78
- * Pass property or invoke fn onto custom or built-in element hosting the contents of p-u element.
79
- */
80
- //toHost: boolean;
81
- /**
82
- * Id of Dom Element. Uses import-like syntax:
83
- * ./my-id searches for #my-id within ShadowDOM realm of instance.
84
- * ../my-id searches for #my-id one ShadowDOM level up.
85
- * /my-id searches from outside any ShadowDOM.
86
- * @attr
87
- */
88
- toUpShadow?: string;
89
-
90
- /**
91
- * abbrev of toUpShadow
92
- */
93
- to?: string
94
-
95
- /**
96
- * Pass property or invoke fn onto itself
97
- */
98
- toSelf?: boolean;
99
-
100
- /**
101
- * Pass property to the nearest previous sibling / ancestor element matching this css pattern, using .previousElement(s)/.parentElement.matches method.
102
- * Does not pass outside ShadowDOM realm.
103
- */
104
- toNearestUpMatch?: string;
105
-
106
- toClosest?: string;
107
-
108
- /**
109
- * to closest or host ("itemscope" attribute or shadow DOM boundary)
110
- */
111
- tocoho?: boolean | string; //to closest or host
112
-
113
- /**
114
- * Name of property to set on matching (upstream) element.
115
- * @attr
116
- */
117
- prop?: keyof TProps & string;
118
-
119
- /**
120
- * Name of method or property arrow function to invoke on matching (upstream) element.
121
- */
122
- fn?: keyof TActions & string;
123
-
124
- dispatch?: string;
125
-
126
- withArgs?: ('self' | 'val' | 'event')[];
127
-
128
- plusEq?: boolean | string | number;
129
-
130
- eqConst?: any;
131
-
132
- toggleProp?: boolean;
133
-
134
-
135
-
136
- as?: 'str-attr' | 'bool-attr' | 'obj-attr',
137
-
138
-
139
-
140
-
141
- thenDo?: (target: Element, key: string, n: INotify, e?: Event) => void;
142
-
143
-
144
-
145
- }
146
-
147
- export interface INotifyHookupInfo{
148
- controller: AbortController;
149
- }
150
-
151
- export interface IConditional<MCProps extends Partial<HTMLElement> = HTMLElement>{
152
- /**
153
- * Name of property to check if truthy
154
- */
155
- if?: keyof MCProps;
156
- /**
157
- * If condition value
158
- */
159
- ifVal?: boolean;
160
- lhs?: string;
161
- lhsVal?: any;
162
- rhs?: string;
163
- rhsVal?: any;
164
- op?: '==' | '!=' | '>' | '<' | '>=' | '<=' | '===' | '!==' | undefined;
165
- }
166
- export type AttribsSettings = { [key: string]: string | boolean | number | undefined | null | string[]};
167
- export type PSettings<T extends Partial<HTMLElement> = HTMLElement, HostProps = any> = [PropSettings<T, HostProps> | undefined];
168
- export type PESettings<T extends Partial<HTMLElement> = HTMLElement> = [props: PropSettings<T> | undefined, on: EventSettings | undefined];
169
- export type PEUnionSettings<T extends Partial<HTMLElement> = HTMLElement> = PSettings<T> | PESettings<T>;
170
- export type PEASettings<T extends Partial<HTMLElement> = HTMLElement> =
171
- [props: PropSettings<T> | undefined, events: EventSettings | undefined, attribs: AttribsSettings | undefined];
172
- export type PEAUnionSettings<T extends Partial<HTMLElement> = HTMLElement> = PEUnionSettings<T> | PEASettings<T>;
173
-
174
- export type ConditionalSettings<T extends Partial<HTMLElement> = HTMLElement> =
175
- [boolean, IConditional<T>, ...any]
176
-
177
-
178
- export interface TRElementProps {
179
- propChangeQueue?: Set<string>;
180
- inReflectMode?: boolean;
181
-
182
- }
183
-
184
- export interface TRElementActions{
185
- attachQR(): void;
186
- detachQR(): void;
187
- attributeChangedCallback?(n: string, ov: string, nv: string): void;
188
- }
189
-
190
-
191
-
192
-
193
-
194
-
195
-
196
-
197
- // export interface Transform<TMixinComposite = any> extends LogicOp<TMixinComposite>{
198
- // match: {[key: string]: MatchRHS<TMixinComposite>}
199
- // }
200
-
201
-
202
-
203
- export type MatchRHS<TMixinComposite = any> = string;
204
-
205
-
206
-
207
-
208
- export interface HasPropChangeQueue{
209
- propChangeQueue: Set<string> | undefined;
210
- QR: undefined | ((name: string, self: HasPropChangeQueue) => void);
211
- }
212
-
213
-
214
-
215
- export interface ProxyPropChangeInfo{
216
- oldVal: any,
217
- newVal: any,
218
- prop: string
219
- }
220
-
221
-
222
-
223
-
224
- export interface ITSChecker{
225
- notChanged(host: Element, fragment: Element | DocumentFragment): boolean;
226
- }
227
-
228
-
229
-
230
- export type TargetTuple =
231
- /**
232
- * Use the native .closest() function to get the target
233
- */
234
- | ['closest', string]
235
- /**
236
- * abbrev for closet
237
- */
238
- | ['c', string]
239
- /**
240
- * Find nearest previous sibling, parent, previous sibling of parent, etc that matches this string.
241
- */
242
- | ['upSearch', string]
243
- /**
244
- * abbrev for upSearch
245
- */
246
- | ['us', string]
247
- /**
248
- * Tries .closest([string value]).
249
- * If that comes out to null, do .getRootNode().host
250
- */
251
- | ['closestOrHost', string]
252
- /**
253
- * abbrev for closestOrHost
254
- */
255
- | ['coh', string]
256
- /**
257
- * Find nearest previous element sibling that matches this string
258
- */
259
- | ['previous', string]
260
- /**
261
- * Find first element matching string within root node.
262
- */
263
- | ['withinRootNode', string]
264
- /**
265
- * abbrev for withinRootNode
266
- */
267
- | ['wrn', string]
268
- /**
269
- * hostish
270
- */
271
- | ['h', (boolean | string)?, boolean?]
272
- | ['hostish', (boolean | string)?, boolean?]
273
- /**
274
- * Find first element matching string within itemscope.
275
- */
276
- | ['withinItemScope', string, boolean?]
277
- /**
278
- * abbrev for within item scope
279
- */
280
- | ['wis', string, boolean?]
281
- | ['within', string, string]
282
- | ['wi', string, string]
283
- /**
284
- * First first element matching string within form.
285
- */
286
- | ['withinForm', string]
287
- /**
288
- * abbrev for within form
289
- */
290
- | ['wf', string]
291
-
292
- ;
293
- /**
294
- * Target selector in upward direction.
295
- */
296
- export type Target =
297
- | TargetTuple
298
- /**
299
- * Use the parent element as the target
300
- */
301
- | 'parent'
302
- /**
303
- * abbrev for parent
304
- */
305
- | 'p'
306
- /**
307
- * Use the previous element sibling as the target.
308
- */
309
- | 'previousElementSibling'
310
- /**
311
- * abbrev for previous element sibling.
312
- */
313
- | 'pes'
314
- /**
315
- * Search previous element siblings for target that matches the query.
316
- */
317
- | `previous${camelQry}` |
318
-
319
- /**
320
- * Use the parent as the target. If no parent, use root node.
321
- */
322
- 'parentOrRootNode' |
323
- /**
324
- * abbrev for parent or root node
325
- */
326
- 'porn' |
327
- /**
328
- * Do "closest" for element with "-"" in the name. If non found, get host of getRootNode()
329
- */
330
- 'hostish' |
331
- /**
332
- * Use the element itself as the target
333
- */
334
- 'self' |
335
- /**
336
- * abbrev for self
337
- */
338
- 's' |
339
- `closest${camelQry}` |
340
-
341
- /**
342
- * [TODO]
343
- * do upsearch for matching itemref
344
- */
345
- 'nearestScope' |
346
-
347
-
348
- /**
349
- * Find nearest previous sibling, parent, previous sibling of parent, etc that matches this string.
350
- */
351
- `upSearchFor${camelQry}` |
352
-
353
-
354
-
355
- /**
356
- * Tries .closest matching string. If that's null, does .getRootNode().host
357
- */
358
- `closest${camelQry}OrHost` |
359
-
360
- /**
361
- * Searches for first element within the rootNode that matches the camelQry.
362
- */
363
- `${camelQry}WithinRootNode` |
364
-
365
-
366
- /**
367
- * get host
368
- */
369
- 'host' |
370
- /**
371
- * abbrev for host
372
- */
373
- 'h'
374
- ;
375
-
376
- export type ScopeTuple = TargetTuple
377
- /**
378
- * Similar to closestOrHost, but just get the root fragment via getRootNode()
379
- */
380
- | ['closestOrRootNode', string]
381
- /**
382
- * abbrev for closestOrRootNode
383
- */
384
- | ['corn', string]
385
- ;
386
- /**
387
- * Outer boundary for transformation
388
- */
389
- export type Scope = Target | ScopeTuple |
390
- /**
391
- * use native function getRootNode() to set the target
392
- *
393
- */
394
- 'rootNode' |
395
- /**
396
- * abbrev for rootNode
397
- */
398
- 'rn' |
399
- `closest${camelQry}OrRootNode` |
400
-
401
-
402
- 'shadowDOM' |
403
- /**
404
- * abbrev for shadow DOM
405
- */
406
- 'sd'
407
-
408
- ;
409
-
410
- //https://stackoverflow.com/questions/38123222/proper-way-to-declare-json-object-in-typescript
411
- type JSONValue =
412
- | string
413
- | number
414
- | boolean
415
- | null
416
- | JSONValue[]
417
- | {[key: string]: JSONValue}
418
-
419
- interface JSONObject {
420
- [k: string]: JSONValue
421
- }
422
- interface JSONArray extends Array<JSONValue> {}
423
-
424
- export interface getValArg {
425
- host?: any;
426
- }
427
-
428
-
429
-
430
- export type keyOfCtxNavElement = keyof ICTXNavElement & string;
431
-
432
- export type keyofICTXCamelQryPrompt = `${keyof ICTXCamelQryPrompt & string}.${camelQry}`;
433
-
434
- export type keyofCTXNavRecursive = (keyof ICTXNavRecursive & string) | keyofICTXCamelQryPrompt;
435
-
436
-
437
-
438
- export type AffectOptions =
439
- `${keyOfCtxNavElement}`
440
- | `${keyofCTXNavRecursive}`
441
- | `${keyofCTXNavRecursive}.${keyofCTXNavRecursive}`
442
- //| `${keyofCTXNavRecursive}.${keyofCTXNavRecursive}.${keyofCTXNavRecursive}`
443
- // | `${keyofCTXNavRecursive}.${keyofCTXNavRecursive}.${keyofCTXNavRecursive}.${keyofCTXNavRecursive}`
444
-
445
- ;
446
-
447
-
448
-
449
- export interface ICTXNavRecursive<T = any>{
450
- $?: T;
451
- hostCtx?: T;
452
- }
453
-
454
- /**
455
- * E = element
456
- * P = part
457
- * C = class
458
- * I = itemscope
459
- * A = attribute
460
- * N = name
461
- */
462
- export type camelQry = `${string}E` | `${string}P` | `${string}C` | `${string}Id` | `${string}I` | `${string}A` | `${string}N` | `${string}M`;
463
-
464
- export interface ExpectedCamelQry<T = any>{
465
- [key: camelQry] : ICtxNav<T>
466
- }
467
-
468
- export interface ICTXNavElement{
469
- self?: Element;
470
- host?: Element;
471
- }
472
-
473
- export interface ICTXCamelQryPrompt<T = any>{
474
- ancestor?: ExpectedCamelQry<T>;
475
- elder?: ExpectedCamelQry<T>;
476
- }
477
-
478
- export interface ICtxNav<T = any> extends ICTXNavRecursive<T>, ICTXNavElement, ICTXCamelQryPrompt<T> {
479
- beScoped?: EventTarget;
480
-
481
- xtalState(): Promise<EventTarget | undefined>;
482
- }
483
-
484
-
485
-
486
- export type ConvertOptions = 'bool' | 'int' | 'float' | 'date' | 'truthy' | 'falsy' | 'string' | 'object' | 'regExp' | 'number';
487
-
488
-
489
-