mount-observer 0.0.112 → 0.1.0

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 (179) hide show
  1. package/Events.js +28 -26
  2. package/Events.ts +34 -30
  3. package/MountObserver.js +235 -520
  4. package/MountObserver.ts +281 -542
  5. package/README.md +149 -56
  6. package/attrCoordinates.js +93 -0
  7. package/attrCoordinates.ts +122 -0
  8. package/constants.js +6 -0
  9. package/constants.ts +7 -0
  10. package/index.js +3 -0
  11. package/index.ts +19 -0
  12. package/loadImports.js +47 -0
  13. package/loadImports.ts +56 -0
  14. package/package.json +8 -119
  15. package/playwright.config.ts +0 -1
  16. package/types.d.ts +86 -0
  17. package/whereAttr.js +174 -0
  18. package/whereAttr.ts +221 -0
  19. package/LICENSE +0 -21
  20. package/Newish.js +0 -145
  21. package/Newish.ts +0 -169
  22. package/ObsAttr.js +0 -18
  23. package/ObsAttr.ts +0 -18
  24. package/RootMutObs.js +0 -49
  25. package/RootMutObs.ts +0 -58
  26. package/Synthesizer.js +0 -125
  27. package/Synthesizer.ts +0 -130
  28. package/bindish.js +0 -15
  29. package/bindish.ts +0 -22
  30. package/compose.js +0 -148
  31. package/compose.ts +0 -164
  32. package/doCleanup.js +0 -31
  33. package/doCleanup.ts +0 -34
  34. package/getWhereAttrSelector.js +0 -83
  35. package/getWhereAttrSelector.ts +0 -92
  36. package/preloadContent.js +0 -44
  37. package/preloadContent.ts +0 -47
  38. package/readAttrs.ts +0 -60
  39. package/refid/README.md +0 -259
  40. package/refid/arr.js +0 -4
  41. package/refid/arr.ts +0 -4
  42. package/refid/camelToKebab.js +0 -4
  43. package/refid/camelToKebab.ts +0 -4
  44. package/refid/genIds.js +0 -190
  45. package/refid/genIds.ts +0 -177
  46. package/refid/getAdjRefs.js +0 -38
  47. package/refid/getAdjRefs.ts +0 -38
  48. package/refid/getContext.js +0 -13
  49. package/refid/getContext.ts +0 -14
  50. package/refid/getCount.js +0 -8
  51. package/refid/getCount.ts +0 -8
  52. package/refid/getIsh.js +0 -35
  53. package/refid/getIsh.ts +0 -37
  54. package/refid/hostish.js +0 -18
  55. package/refid/hostish.ts +0 -20
  56. package/refid/ism.js +0 -78
  57. package/refid/ism.ts +0 -81
  58. package/refid/itemprops.js +0 -60
  59. package/refid/itemprops.ts +0 -67
  60. package/refid/joinMatching.js +0 -56
  61. package/refid/joinMatching.ts +0 -54
  62. package/refid/nudge.js +0 -23
  63. package/refid/nudge.ts +0 -23
  64. package/refid/regIsh.js +0 -27
  65. package/refid/regIsh.ts +0 -31
  66. package/refid/secretKeys.js +0 -5
  67. package/refid/secretKeys.ts +0 -5
  68. package/refid/splitRefs.js +0 -6
  69. package/refid/splitRefs.ts +0 -6
  70. package/refid/stdVal.js +0 -15
  71. package/refid/stdVal.ts +0 -15
  72. package/refid/via.js +0 -114
  73. package/refid/via.ts +0 -113
  74. package/slotkin/affine.js +0 -39
  75. package/slotkin/affine.ts +0 -46
  76. package/slotkin/beKindred.js +0 -45
  77. package/slotkin/beKindred.ts +0 -55
  78. package/slotkin/getBreadth.js +0 -19
  79. package/slotkin/getBreadth.ts +0 -21
  80. package/slotkin/getFrag.js +0 -22
  81. package/slotkin/getFrag.ts +0 -21
  82. package/slotkin/toQuery.js +0 -12
  83. package/slotkin/toQuery.ts +0 -13
  84. package/slotkin/wrap.js +0 -13
  85. package/slotkin/wrap.ts +0 -18
  86. package/ts-refs/LICENSE +0 -21
  87. package/ts-refs/README.md +0 -18
  88. package/ts-refs/be-a-beacon/types.d.ts +0 -22
  89. package/ts-refs/be-alit/types.d.ts +0 -1
  90. package/ts-refs/be-based/types.d.ts +0 -32
  91. package/ts-refs/be-bound/types.d.ts +0 -65
  92. package/ts-refs/be-buttoned-up/types.d.ts +0 -21
  93. package/ts-refs/be-calculating/types.d.ts +0 -57
  94. package/ts-refs/be-clonable/types.d.ts +0 -28
  95. package/ts-refs/be-committed/types.d.ts +0 -26
  96. package/ts-refs/be-consoling/types.d.ts +0 -25
  97. package/ts-refs/be-counted/types.d.ts +0 -88
  98. package/ts-refs/be-delible/types.d.ts +0 -26
  99. package/ts-refs/be-directive/types.d.ts +0 -43
  100. package/ts-refs/be-dispatching/types.d.ts +0 -41
  101. package/ts-refs/be-elevating/types.d.ts +0 -55
  102. package/ts-refs/be-enhanced/types.d.ts +0 -32
  103. package/ts-refs/be-enhancing/types.d.ts +0 -31
  104. package/ts-refs/be-evanescent/types.d.ts +0 -20
  105. package/ts-refs/be-eventing/types.d.ts +0 -27
  106. package/ts-refs/be-exportable/types.d.ts +0 -26
  107. package/ts-refs/be-fetching/types.d.ts +0 -73
  108. package/ts-refs/be-flashy/types.d.ts +0 -27
  109. package/ts-refs/be-formalizing/types.d.ts +0 -29
  110. package/ts-refs/be-formidable/types.d.ts +0 -64
  111. package/ts-refs/be-giddy/types.d.ts +0 -26
  112. package/ts-refs/be-gingerly/types.d.ts +0 -19
  113. package/ts-refs/be-gone/types.d.ts +0 -24
  114. package/ts-refs/be-hashing-out/types.d.ts +0 -22
  115. package/ts-refs/be-hive/types.d.ts +0 -18
  116. package/ts-refs/be-imbued/types.d.ts +0 -30
  117. package/ts-refs/be-included/types.d.ts +0 -20
  118. package/ts-refs/be-inclusive/types.d.ts +0 -30
  119. package/ts-refs/be-intersectional/types.d.ts +0 -37
  120. package/ts-refs/be-intl/types.d.ts +0 -28
  121. package/ts-refs/be-invoking/types.d.ts +0 -28
  122. package/ts-refs/be-joining/types.d.ts +0 -26
  123. package/ts-refs/be-kvetching/types.d.ts +0 -24
  124. package/ts-refs/be-lazy/types.d.ts +0 -29
  125. package/ts-refs/be-literate/types.d.ts +0 -29
  126. package/ts-refs/be-mediating/types.d.ts +0 -34
  127. package/ts-refs/be-methodical/types.d.ts +0 -20
  128. package/ts-refs/be-modding/types.d.ts +0 -18
  129. package/ts-refs/be-observant/types.d.ts +0 -27
  130. package/ts-refs/be-observing/types.d.ts +0 -84
  131. package/ts-refs/be-parsed/types.d.ts +0 -19
  132. package/ts-refs/be-parsing/types.d.ts +0 -37
  133. package/ts-refs/be-persistent/types.d.ts +0 -66
  134. package/ts-refs/be-propagating/types.d.ts +0 -26
  135. package/ts-refs/be-reformable/types.d.ts +0 -48
  136. package/ts-refs/be-render-neutral/types.d.ts +0 -31
  137. package/ts-refs/be-scoped/types.d.ts +0 -24
  138. package/ts-refs/be-sharing/types.d.ts +0 -17
  139. package/ts-refs/be-switched/types.d.ts +0 -155
  140. package/ts-refs/be-typed/types.d.ts +0 -36
  141. package/ts-refs/be-value-added/types.d.ts +0 -34
  142. package/ts-refs/be-valued/types.d.ts +0 -22
  143. package/ts-refs/be-written/types.d.ts +0 -59
  144. package/ts-refs/css-charts/types.d.ts +0 -38
  145. package/ts-refs/css-echarts/types.d.ts +0 -13
  146. package/ts-refs/data-props/types.d.ts +0 -27
  147. package/ts-refs/do-inc/types.d.ts +0 -28
  148. package/ts-refs/do-invoke/types.d.ts +0 -28
  149. package/ts-refs/do-toggle/types.d.ts +0 -27
  150. package/ts-refs/em-bower/types.d.ts +0 -24
  151. package/ts-refs/fetch-for/types.d.ts +0 -37
  152. package/ts-refs/folder-picker/types.d.ts +0 -43
  153. package/ts-refs/for-fetch/doc.d.ts +0 -98
  154. package/ts-refs/for-fetch/types.d.ts +0 -83
  155. package/ts-refs/mount-observer/types.d.ts +0 -248
  156. package/ts-refs/mt-si/types.d.ts +0 -21
  157. package/ts-refs/per-each/types.d.ts +0 -51
  158. package/ts-refs/soak-up/types.d.ts +0 -36
  159. package/ts-refs/trans-render/XV/types.d.ts +0 -69
  160. package/ts-refs/trans-render/asmr/types.d.ts +0 -138
  161. package/ts-refs/trans-render/be/types.d.ts +0 -198
  162. package/ts-refs/trans-render/dss/types.d.ts +0 -57
  163. package/ts-refs/trans-render/froop/types.d.ts +0 -416
  164. package/ts-refs/trans-render/funions/types.d.ts +0 -12
  165. package/ts-refs/trans-render/lib/mixins/types.d.ts +0 -42
  166. package/ts-refs/trans-render/lib/prs/types.d.ts +0 -40
  167. package/ts-refs/trans-render/lib/types.d.ts +0 -489
  168. package/ts-refs/trans-render/types.d.ts +0 -583
  169. package/ts-refs/wc-info/SimpleWCInfo.d.ts +0 -15
  170. package/ts-refs/when-resolved/types.d.ts +0 -30
  171. package/ts-refs/xp-as/types.d.ts +0 -20
  172. package/ts-refs/xtal-element/types.d.ts +0 -43
  173. package/ts-refs/xtal-frappe-chart/types.d.ts +0 -193
  174. package/upShadowSearch.js +0 -25
  175. package/upShadowSearch.ts +0 -23
  176. package/waitForEvent.js +0 -12
  177. package/waitForEvent.ts +0 -13
  178. package/waitForIsh.js +0 -21
  179. package/waitForIsh.ts +0 -20
@@ -1,583 +0,0 @@
1
- import { MountContext, PipelineStage } from "../mount-observer/types";
2
- import { ConvertOptions, Scope } from "./lib/types";
3
- import { EMC} from './be/types';
4
-
5
-
6
- export type PropAttrQueryType =
7
- | '|' //microdata itemprop
8
- | '@' //form element name
9
- | '#' //id
10
- | '%' //part
11
- | '.' //class
12
- //| '-' //marker
13
- | '$' //microdata itemprop + itemscope attributes (nested)
14
- | '-o'
15
-
16
- export type PropAttrPair<TProps> = `${PropAttrQueryType} ${keyof TProps & string}`;
17
-
18
- export type PropQueryExpression<TProps, TElement = {}> =
19
-
20
- | `* ${CSSQuery}`
21
- | `:root`
22
- | `${keyof HTMLElementTagNameMap}`
23
- | `${PropAttrPair<TProps>}`
24
- | `${PropAttrPair<TProps>} -s ${keyof TElement & string}`
25
- | `${PropAttrPair<TProps>} ${PropAttrPair<TProps>}`
26
- | `${PropAttrPair<TProps>} ${PropAttrPair<TProps>} -s ${keyof TElement & string}`
27
- // | `${PropAttrPair<TProps>} ${PropAttrPair<TProps>} ${PropAttrPair<TProps>}`
28
- // | `${PropAttrPair<TProps>} ${PropAttrPair<TProps>} ${PropAttrPair<TProps>} -s ${keyof TElement & string}`
29
- //
30
-
31
- ;
32
-
33
- //#region derived expressions
34
- export type Expr0 = [string, number];
35
- export type Expr1 = [...Expr0, string];
36
- export type Expr2 = [...Expr1, number];
37
- export type Expr3 = [...Expr2, string];
38
- export type Expr4 = [...Expr3, number];
39
- export type Expr5 = [...Expr4, string];
40
- export type Expr6 = [...Expr5, number];
41
- export type Expr7 = [...Expr6, string];
42
- export type Expr8 = [...Expr7, number];
43
- export type Expr9 = [...Expr8, string];
44
- export type Expr10 = [...Expr9, number];
45
- export type Expr11 = [...Expr10, string];
46
- export type Expr12 = [...Expr11, number];
47
-
48
- //export type Action<TProps> = (matchingElement: Element, pique: IMountOrchestrator<TProps>) => Promise<Derivative<TProps>> | Promise<void>;
49
- export type InterpolatingExpression = Expr0 | Expr1 | Expr2 | Expr3 | Expr4 | Expr5 | Expr6 | Expr7 | Expr8 | Expr9 | Expr10 | Expr11 | Expr12;
50
- export type NumberExpression = [number];
51
- export type DerivationCriteria<TProps, TMethods> = {
52
- //TODO
53
- path: string,
54
- from?: number,
55
- //TODO
56
- as?: ConvertOptions,
57
- //TODO - applicable to arrays
58
- filter?: keyof TMethods & string | ((val: any) => boolean),
59
- //TODO
60
- //map?: keyof TModhods & string | ((val: any) => any,
61
- };
62
-
63
- export interface TransformOptions{
64
- propagator?: MarkedUpEventTarget,
65
- propagatorIsReady?: boolean,
66
- skipInit?: boolean,
67
- useViewTransition?: boolean,
68
- outside?: string,
69
- }
70
-
71
- export type Derivative<TProps, TMethods, TElement = {}> =
72
- | number
73
- | InterpolatingExpression
74
- | ((model: TProps & TMethods, transform: ITransformer<TProps, TMethods, TElement>, uow: UnitOfWork<TProps, TMethods, TElement>, matchingElement: Element) => any)
75
- | NumberExpression
76
- | DerivationCriteria<TProps, TMethods>
77
- // only works if lhs has field/property
78
- | keyof TMethods & string
79
- // combined observe an 0
80
- | keyof TProps & string
81
- | boolean
82
- ;
83
- //#endregion
84
-
85
- export interface Engagement<TMethods>{
86
- /** Invoked when the element is encountered. */
87
- do?: keyof TMethods & string,
88
- /** Invoked when a previously matching element is no longer matching. */
89
- undo?: keyof TMethods & string,
90
- /** Invoked when a previously matching element is disconnected. */
91
- forget?: keyof TMethods & string,
92
- /**
93
- * Can be used for any kind of label, but most common use is for specifying a behavior/enhancement
94
- * to attach.
95
- */
96
- be?: EMC,
97
- with?: any,
98
- waitForResolved?: boolean,
99
- dep?: () => void;
100
-
101
-
102
- }
103
-
104
-
105
- export type onMountStatusChange = 'onMount' | 'onDismount' | 'onDisconnect';
106
-
107
- export interface EngagementCtx<TModel> {
108
- be?: string,
109
- with?: any,
110
- type: onMountStatusChange,
111
- mountContext: MountContext
112
- }
113
-
114
- export type EngagementOrKeyOrEMC<TMethods, TProps = TMethods> =
115
- | (keyof TMethods & string)
116
- | Engagement<TMethods>
117
- | EMC<any, TProps>
118
- ;
119
-
120
- export type EngagementOrEMC<TMethods, TProps = TMethods> =
121
- | Engagement<TMethods>
122
- | EMC<any, TProps>
123
-
124
- export type Engagements<TMethods, TProps = TMethods> =
125
- | EngagementOrKeyOrEMC<TMethods>
126
- | Array<EngagementOrKeyOrEMC<TMethods>>
127
- ;
128
-
129
- export interface IMountOrchestrator<TProps, TMethods = TProps>{
130
- //TODO add all the methods
131
- }
132
-
133
- // export type OneOrMore<TProps> =
134
- // | keyof TProps & string
135
- // | `${keyof TProps & string} ${keyof TProps & string}`
136
-
137
-
138
-
139
-
140
- export type LHS<TProps, TElement={}> = PropQueryExpression<TProps, TElement>;
141
-
142
- export type CSSQuery = string;
143
-
144
- export interface ConditionGate<TProps, TMethods, TElement = {}>{
145
- ifAllOf?: number[],
146
- ifNoneOf?: number[],
147
- ifEqual?: [number, number | [number] | string],
148
- d?: Derivative<TProps, TMethods, TElement>,
149
-
150
- }
151
-
152
- export interface ScopingConfig<TProps=any, TMethods = TProps> {
153
- name: string;
154
- config?: IshConfig<TProps, TMethods>;
155
- }
156
-
157
- export type ScopeInstructions<TProps=any, TMethods=TProps> =
158
- | ScopingConfig
159
- ;
160
-
161
- export interface ScopedLoop<TProps = any, TMethods = TProps>{
162
- config?: IshConfig<TProps, TMethods>;
163
- options: Partial<Clone$Options>
164
- }
165
-
166
- export type WhereConditions =
167
- | string //css matches
168
- | {
169
- matches: string,
170
- mediaMatches: string,
171
- containerQuery: string,
172
- }
173
-
174
- export type IfInstructions<TProps, TMethods, TElement = {}> = string | boolean | number | [number] | ConditionGate<TProps, TMethods, TElement> ;
175
-
176
- export interface ObservePropParams {
177
- derivePropFrom?: string,
178
- }
179
- export type PropOrComputedProp<TProps, TMethods = TProps> =
180
- | keyof TProps & string
181
- | [keyof TProps & string, (val: any) => any]
182
- | [keyof TProps & string, keyof TMethods & string]
183
- | ObservePropParams
184
- | `:${string}`
185
-
186
- export interface CrossProduct<TProps, TMethods> {
187
- x: string | Array<string>,
188
- y: (keyof TProps & TMethods & string) | Array<keyof TProps & TMethods & string>
189
- }
190
-
191
- export interface ForEach<TProps, TMethods, TElement = {}>{
192
- each?: 0,
193
- /** css query to locate the template */
194
- clone?: string,
195
- /** within scope for locating the template */
196
- wi?: 'node' | 'rootNode' | 'upShadowSearch'
197
- indexProp?: string,
198
- xform: XForm<TProps, TMethods, TElement> & Info,
199
- appendTo?: string,
200
- timestampProp?: string,
201
- outOfRangeAction?: string,
202
- outOfRangeProp?: string,
203
- }
204
-
205
- // export interface MapInstructions<TProps, TMethods, TElement = {}>{
206
- // // itemCss: CSSQuery,
207
- // // each: string | [string, IshConfig<TProps, TMethods, TElement>],
208
- // // in: string | [string, IshConfig<TProps, TMethods, TElement>],
209
- // }
210
-
211
- export interface ForEachInterface{
212
- init(): Promise<void>;
213
- update(model: any[]): Promise<void>;
214
- }
215
- export interface UnitOfWork<TProps, TMethods = TProps, TElement = {}>{
216
- /**
217
- * add event listener
218
- */
219
- addEventListener?: AddEventListenerType<TProps, TMethods> | Array<AddEventListenerType<TProps, TMethods>>,
220
- /**
221
- * abbrev. for addEventListener
222
- */
223
- a?: 0 | AddEventListenerType<TProps, TMethods> | Array<AddEventListenerType<TProps, TMethods>>,
224
-
225
- /**
226
- * Specify how the value we want to apply to the target element should be derived from the observed props.
227
- * derived value from observed props
228
- */
229
- derivedValFromModel?: Derivative<TProps, TMethods, TElement>,
230
- /**
231
- * Specify how the value we want to apply to the target element should be derived from the observed props.
232
- * abbrev. for derivedValSpecs
233
- */
234
- d?: Derivative<TProps, TMethods, TElement>,
235
-
236
- /**
237
- * Specify what to do when the element is encountered, and/or when it goes out of scope.
238
- * Register the found element in some way.
239
- * Actions not tied to observed props or user actions.
240
- */
241
- engage?: Engagements<TMethods>
242
- /**
243
- * Specify what to do when the element is encountered, and/or when it goes out of scope.
244
- * Register the found element in some way.
245
- * Actions not tied to observed props or user actions.
246
- * Abbrev. for engagementActions
247
- */
248
- e?: Engagements<TMethods>,
249
-
250
- forEachBinding?: ForEach<any, any, any>
251
- /**
252
- * for each -- deprecated?
253
- */
254
- f?: ForEach<any, any, any>,
255
-
256
- /**
257
- * ifs ands or buts -- conditions on the model
258
- */
259
- ifs?: IfInstructions<TProps, TMethods, TElement>,
260
- /**
261
- * ifs ands or buts -- conditions on the model
262
- * abbrev for ifs
263
- */
264
- i?: IfInstructions<TProps, TMethods, TElement>,
265
-
266
- /**
267
- * method of matching element to pass derived value into
268
- * [TODO]
269
- */
270
- invoke?: string,
271
-
272
-
273
- /**
274
- * modify the model in a (mostly) declarative way
275
- */
276
- modifyModel?: ModificationUnitOfWork<TProps, TMethods, TElement> | Array<ModificationUnitOfWork<TProps, TMethods, TElement>>,
277
- /**
278
- * modify the model in a (mostly) declarative way
279
- * abbreviation for modifyModel
280
- */
281
- m?: ModificationUnitOfWork<TProps, TMethods, TElement> | Array<ModificationUnitOfWork<TProps, TMethods, TElement>>,
282
-
283
- /**
284
- * List of props to observe from the model
285
- */
286
- observedProps?: keyof TProps & string | PropOrComputedProp<TProps, TMethods> | PropOrComputedProp<TProps, TMethods>[],
287
- /**
288
- * List of props to observe from the model
289
- * abbrev. for observedProps
290
- */
291
- o?: keyof TProps & string | PropOrComputedProp<TProps, TMethods> | PropOrComputedProp<TProps, TMethods>[],
292
-
293
- /**
294
- * set specified property of the matching element to the (derived) value
295
- */
296
- setProp?: (keyof TElement & string) | {},
297
- /**
298
- * set specified property of the matching element to the (derived) value
299
- * abbrev of setProp
300
- */
301
- s?: (keyof TElement & string) | {},
302
- /**
303
- * set specified attribute of the matching element to the (derived) value
304
- *
305
- */
306
- setAttr?: string,
307
- /**
308
- * set specified attribute of the matching element to the (derived) value
309
- * abbrev of setAttr
310
- */
311
- sa?: string,
312
- /**
313
- * set specified style of the matching element to the (derived) value
314
- */
315
- ss?: string,
316
-
317
- /**
318
- * two way bind the listed props to data- attributes
319
- */
320
- data?: Array<keyof TProps & string>
321
-
322
- /**
323
- * negate to
324
- */
325
- negTo?: string,
326
-
327
- /**
328
- * Where condition for selecting the target elements.
329
- */
330
- whereConditions?: WhereConditions,
331
- /**
332
- * Where conditions for selecting the target elements
333
- * abbrev. for whereConditions
334
- */
335
- w?: WhereConditions,
336
-
337
- y?: number | YieldSettings<TProps>,
338
-
339
- $?: ScopeInstructions<TProps, TMethods>,
340
-
341
- $$?: ScopedLoop<TProps, TMethods>,
342
-
343
- nudge?: boolean,
344
- }
345
-
346
- export interface YieldSettings<TProps>{
347
- to?: keyof TProps,
348
- as?: 'date' | 'number'
349
- }
350
-
351
- export type ValueFromElement<TProps, TMethods, TElement = {}> =
352
- (
353
- matchingElement: Element,
354
- transformer: ITransformer<TProps, TMethods, TElement>,
355
- mod: ModificationUnitOfWork<TProps, TMethods, TElement>
356
- ) => any
357
-
358
- export interface ModificationUnitOfWork<TProps, TMethods, TElement = {}>{
359
- on: string,
360
- //Double check that the event is the type expected
361
- instanceOf?: any,
362
- /**
363
- * Increment
364
- */
365
- inc?: keyof TProps & string,
366
- /**
367
- * Increment by specified number, or by specified property coming from matching element
368
- */
369
- byAmt?: number | string,
370
- /**
371
- * Set this prop on the host
372
- */
373
- s?: keyof TProps & string,
374
- /**
375
- * [TODO] -- Set Custom State --only available for xtal-element
376
- */
377
- ss?: string,
378
- /**
379
- * [TODO] -- Set attribute
380
- */
381
- sa?: string,
382
- /**
383
- * [TODO] enhance / engage the host, or register the host in some way
384
- * don't implement this until a good use case is found, make sure it makes sense.
385
- */
386
- e?: Engagements<TMethods>,
387
- /**
388
- * [TODO] Set hardcoded value
389
- */
390
- to?: any,
391
- toValFrom?: string | ValueFromElement<TProps, TMethods, TElement>;
392
- toggle?: keyof TProps & string,
393
- stopPropagation?: boolean,
394
- }
395
-
396
- export interface QuenitOfWork<TProps, TMethods, TElement = {}> extends UnitOfWork<TProps, TMethods, TElement>{
397
- q: string,
398
- qi?: QueryInfo,
399
- }
400
-
401
- export type UnitOfWorkRHS<TProps, TMethods, TElement = {}> =
402
- | 0
403
- | keyof TMethods & string
404
- | keyof TProps & string
405
- | UnitOfWork<TProps, TMethods, TElement>
406
- | XForm<any, any, any> & Info //unclear if this is necessary
407
- ;
408
-
409
- export type RHS<TProps = any, TMethods = TProps, TElements = Element> = UnitOfWorkRHS<TProps, TMethods, TElements> | Array<UnitOfWork<TProps, TMethods, TElements>>;
410
-
411
- export interface AttrMap{
412
- type: PropAttrQueryType,
413
- name: string
414
- }
415
-
416
- export interface QueryInfo{
417
- isRootQry?: boolean,
418
- localPropCamelCase?: string,
419
- cssQuery?: CSSQuery,
420
- outside?: CSSQuery,
421
- o?: string[],
422
- s?: string[],
423
- localName?: string,
424
- //w?: WhereConditions,
425
- css?: string,
426
- hostPropToAttrMap?: Array<AttrMap>
427
- }
428
-
429
- export type TransformerTarget = Element | DocumentFragment | Element[] | ShadowRoot | Document;
430
-
431
- export type Model = {
432
- [key: string]: any
433
- }
434
-
435
- export type EventListenerAction<TProps, TMethods> = (keyof TMethods & string) | ((e: Event, t: ITransformer<TProps, TMethods>, uow: UnitOfWork<TProps, TMethods>) => void);
436
-
437
- export type AddEventListenerType<TProps, TMethods> =
438
- | keyof TMethods & string
439
- | AddEventListener<TProps, TMethods>;
440
-
441
- export interface AddEventListener<TProps, TMethods>{
442
- on: string,
443
- do: EventListenerAction<TProps, TMethods>,
444
- options?: boolean | EventListenerOptions,
445
- }
446
-
447
- export type XForm<TProps, TMethods, TElement = {}> = Partial<{
448
- [key in LHS<TProps & TMethods, TElement>]: RHS<TProps, TMethods, TElement>;
449
- }>;
450
-
451
- export interface Info {
452
- 411?: {
453
- w?: string,
454
- //idxFrom?: string
455
- }
456
- }
457
-
458
-
459
-
460
- export interface ITransformer<TProps, TMethods, TElement = {}>{
461
- target: TransformerTarget,
462
- model: TProps & TMethods,
463
- xform: XForm<TProps, TMethods, TElement> & Info,
464
- options: TransformOptions,
465
- initializedMods: Set<ModificationUnitOfWork<TProps, TMethods, TElement>>,
466
- //propagator?: EventTarget,
467
- }
468
-
469
- export type ToTransformer<TProps, TMethods, TElement = {}> = (
470
- target: TransformerTarget,
471
- model: TProps & TMethods,
472
- xform: XForm<TProps, TMethods, TElement>,
473
- propagator?: EventTarget
474
- ) => ITransformer<TProps, TMethods>;
475
-
476
- export interface MarkedUpEventTarget extends EventTarget{
477
- ___props?: Set<string>;
478
- ___nestedProps?: Map<string, any>;
479
- }
480
-
481
- export interface TransRenderEndUserProps<ModelProps, ModelMethods = ModelProps, TElement = {}>{
482
- xform: XForm<ModelProps, ModelMethods, TElement>;
483
- scope: Scope;
484
- //model?: ModelProps & ModelMethods;
485
- options?: TransformOptions;
486
- }
487
-
488
- export interface TransRenderProps<ModelProps, ModelMethods = ModelProps> extends TransRenderEndUserProps<ModelProps, ModelMethods>{
489
-
490
- }
491
-
492
- export interface TransRenderMethods{
493
- getTarget(): Promise<Document | ShadowRoot | DocumentFragment | Element>,
494
- getXForm(): Promise<XForm<any, any>>,
495
- getModel(): Promise<any>,
496
- skipInit: boolean,
497
- }
498
-
499
- import {IshConfig, OConfig} from './froop/types';
500
- export interface MntCfg<TProps = any, TActions = TProps, ETProps = TProps> extends OConfig<TProps, TActions, ETProps>{
501
- mainTemplate: string | HTMLTemplateElement,
502
- /**
503
- * Only set to true if shadow dom is used and the light children play a critical role as far as
504
- * progressive enhancement.
505
- */
506
- appendOnClone?: boolean,
507
- /**
508
- * transform within ShadowRoot if applicable
509
- */
510
- xform?: XForm<TProps, TActions>,
511
- /**
512
- * transform applied to light children, if applicable
513
- * Use ":root" to match on the root element
514
- */
515
- lcXform?: XForm<TProps, TActions>,
516
-
517
-
518
- /**
519
- * transforms within ShadowRoot if applicable that uses view transitions
520
- */
521
- xxform?: XForm<TProps, TActions>
522
-
523
- styles?: /*CSSStyleSheet[] |*/ string | string[] | CSSStyleSheet | Array<CSSStyleSheet>;
524
-
525
- shadowRootInit?: ShadowRootInit,
526
-
527
- assumeCSR?: boolean,
528
-
529
-
530
- }
531
-
532
- export interface MountProps<TProps = any, TActions = TProps, ETProps = TProps>{
533
- readonly clonedTemplate?: DocumentFragment;
534
- deferHydration?: boolean;
535
- readonly hydrated?: boolean;
536
- readonly csr?: boolean;
537
- readonly xform?: XForm<TProps, TActions>,
538
- readonly xxform?: XForm<TProps, TActions>,
539
- }
540
- export type PMP<TProps = any, TActions = TProps, ETProps = TProps> = Partial<MountProps<TProps, TActions, ETProps>>;
541
- export type ProPMP<TProps = any, TActions = TProps, ETProps = TProps> = Promise<PMP<TProps, TActions, ETProps>>
542
-
543
- export interface MountActions<TProps = any, TActions = TProps, ETProps = TProps>{
544
- cloneMT(self: this): PMP;
545
- // inspect(self: this): PMP
546
- // mount(self: this): ProPMP
547
- initCSRXform(self: this): ProPMP<TProps, TActions, ETProps>;
548
- initSSRXform(self: this): ProPMP<TProps, TActions, ETProps>;
549
- onNoXForm(self: this): ProPMP<TProps, TActions, ETProps>;
550
-
551
- mountClone(self: this): Partial<MountProps<TProps, TActions, ETProps>>;
552
- }
553
-
554
- export interface IObject$tring{
555
- strVal: string | undefined;
556
- objVal: any;
557
- arrVal: any[] | undefined;
558
- parse(): Promise<void>;
559
- }
560
-
561
- export type ZeroOrMore<T> = T | Array<T> | undefined;
562
-
563
- /**
564
- * https://x.com/mattpocockuk/status/1821926395380986219
565
- */
566
- export type StringWithAutocompleteOptions<TOptions> =
567
- | (string & {})
568
- | TOptions;
569
-
570
- export interface Clone$Options{
571
- //ish: HasIshList,
572
- ish: any,
573
- ishContainer: Element,
574
- seedEl: Element,
575
- idxStart: number,
576
- itemScopes: Array<string>,
577
- mapIdxTo?: string,
578
- itemTemplates: Array<HTMLTemplateElement>;
579
- baseCrumb: string,
580
- idleTimeout: number,
581
- //model?: any,
582
- //listScope: string
583
- }
@@ -1,15 +0,0 @@
1
- export interface SimpleWCInfo<TProps = any, TPublicMethods = any>{
2
- tagName: string;
3
- cssParts?: {[key: string]: string};
4
- props?: any;
5
- methods?: any;
6
- nonAttribProps?: (keyof TProps)[];
7
- cssProps?: {[key: string]: string};
8
- slots?: {[key: string]: string};
9
- events?: {[key: string]: string};
10
- name: string,
11
- description: string,
12
- homepage: string,
13
- license: string,
14
-
15
- }
@@ -1,30 +0,0 @@
1
- import {IEnhancement, BEAllProps} from '../trans-render/be/types';
2
- import { Specifier } from "../trans-render/dss/types";
3
-
4
- export interface EndUserProps extends IEnhancement{
5
- }
6
-
7
- export interface AllProps extends EndUserProps{
8
- parsedStatements: Array<ResolvingParameters>,
9
- rawStatements?: Array<string>
10
- }
11
-
12
- export type AP = AllProps;
13
-
14
- export type PAP = Partial<AP>;
15
-
16
- export type ProPAP = Promise<PAP>;
17
-
18
- export type BAP = AP & BEAllProps;
19
-
20
- export interface Actions{
21
- hydrate(self: BAP): ProPAP;
22
- }
23
-
24
- export interface ResolvingParameters{
25
- remoteSpecifierString: string;
26
- remoteSpecifier: Specifier;
27
- localSpecifierString: string;
28
- localSpecifier: Specifier;
29
- remotePropertyPath: string;
30
- }
@@ -1,20 +0,0 @@
1
- import {IEnhancement, BEAllProps} from '../trans-render/be/types';
2
-
3
- export interface EndUserProps extends IEnhancement{
4
- }
5
-
6
- export interface AllProps extends EndUserProps{
7
- props: EventTarget;
8
- }
9
-
10
- export type AP = AllProps;
11
-
12
- export type PAP = Partial<AP>;
13
-
14
- export type ProPAP = Promise<PAP>;
15
-
16
- export type BAP = AP & BEAllProps;
17
-
18
- export interface Actions {
19
-
20
- }
@@ -1,43 +0,0 @@
1
- import { XForm } from "trans-render/types";
2
- import { PropInfo, Actions } from 'trans-render/froop/types';
3
- import {Scope} from 'trans-render/lib/types';
4
- import { Compacts, WCConfig } from "../trans-render/froop/types";
5
-
6
- export interface PropInferenceCriteria{
7
- cssSelector: string,
8
- attrForProp: string,
9
-
10
- }
11
-
12
- export interface EndUserProps<TProps = any, TActions = TProps> extends WCConfig<TProps, TActions>{
13
- aka?: string,
14
- inferProps?: boolean,
15
- xform?: XForm<TProps, TActions>,
16
- lcXform?: XForm<TProps, TActions>,
17
- shadowRootMode?: ShadowRootMode,
18
- propDefaults?: Partial<TProps>,
19
- propInfo: Partial<{[key in keyof TProps]: PropInfo}>,
20
- compacts?: Compacts<TProps, TActions>,
21
- targetScope?: Scope,
22
- assumeCSR?: boolean,
23
- propInferenceCriteria?: Array<PropInferenceCriteria>,
24
- inherits?: string | {new(): HTMLElement} | (() => Promise<{new(): HTMLElement}>),
25
- actions?: Actions<TProps, TActions>,
26
- /**
27
- * form associated
28
- */
29
- fa?: boolean,
30
- mainTemplate?: string | HTMLTemplateElement
31
- }
32
-
33
- export interface AP<TProps = any, TActions = TProps> extends EndUserProps<TProps, TActions>{
34
- mainTemplate?: HTMLTemplateElement,
35
- styles?: string,
36
- }
37
- export type ProAP = Promise<AP>
38
-
39
- export interface Actions {
40
- getTemplate(self: this): ProAP,
41
- define(self: this): ProAP,
42
- }
43
-