@ixfx/ui 0.50.3 → 0.56.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.
Files changed (38) hide show
  1. package/LICENSE +26 -1
  2. package/dist/chunk-BN_g-Awi.js +18 -0
  3. package/dist/index.d.ts +557 -0
  4. package/dist/index.js +958 -0
  5. package/package.json +32 -18
  6. package/bundle/chunk-Cl8Af3a2.js +0 -1
  7. package/bundle/index.d.ts +0 -569
  8. package/bundle/index.d.ts.map +0 -1
  9. package/bundle/index.js +0 -2
  10. package/bundle/index.js.map +0 -1
  11. package/dist/__tests__/test.d.ts +0 -2
  12. package/dist/__tests__/test.d.ts.map +0 -1
  13. package/dist/__tests__/test.js +0 -1
  14. package/dist/src/index.d.ts +0 -2
  15. package/dist/src/index.d.ts.map +0 -1
  16. package/dist/src/index.js +0 -1
  17. package/dist/src/rx/browser-resize.d.ts +0 -26
  18. package/dist/src/rx/browser-resize.d.ts.map +0 -1
  19. package/dist/src/rx/browser-resize.js +0 -41
  20. package/dist/src/rx/browser-theme-change.d.ts +0 -13
  21. package/dist/src/rx/browser-theme-change.d.ts.map +0 -1
  22. package/dist/src/rx/browser-theme-change.js +0 -28
  23. package/dist/src/rx/colour.d.ts +0 -8
  24. package/dist/src/rx/colour.d.ts.map +0 -1
  25. package/dist/src/rx/colour.js +0 -20
  26. package/dist/src/rx/dom-source.d.ts +0 -96
  27. package/dist/src/rx/dom-source.d.ts.map +0 -1
  28. package/dist/src/rx/dom-source.js +0 -374
  29. package/dist/src/rx/dom-types.d.ts +0 -128
  30. package/dist/src/rx/dom-types.d.ts.map +0 -1
  31. package/dist/src/rx/dom-types.js +0 -1
  32. package/dist/src/rx/dom.d.ts +0 -284
  33. package/dist/src/rx/dom.d.ts.map +0 -1
  34. package/dist/src/rx/dom.js +0 -727
  35. package/dist/src/rx/index.d.ts +0 -7
  36. package/dist/src/rx/index.d.ts.map +0 -1
  37. package/dist/src/rx/index.js +0 -5
  38. package/dist/tsconfig.tsbuildinfo +0 -1
package/LICENSE CHANGED
@@ -1,6 +1,31 @@
1
1
  MIT License
2
2
 
3
- Copyright (c) 2021-2025 Clint Heyer
3
+ Copyright (c) 2021-2026 Clint Heyer
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
22
+
23
+ ---
24
+
25
+ Package: bezier-js
26
+ https://github.com/Pomax/bezierjs
27
+
28
+ Copyright (c) 2023 Pomax
4
29
 
5
30
  Permission is hereby granted, free of charge, to any person obtaining a copy
6
31
  of this software and associated documentation files (the "Software"), to deal
@@ -0,0 +1,18 @@
1
+ //#region rolldown:runtime
2
+ var __defProp = Object.defineProperty;
3
+ var __exportAll = (all, symbols) => {
4
+ let target = {};
5
+ for (var name in all) {
6
+ __defProp(target, name, {
7
+ get: all[name],
8
+ enumerable: true
9
+ });
10
+ }
11
+ if (symbols) {
12
+ __defProp(target, Symbol.toStringTag, { value: "Module" });
13
+ }
14
+ return target;
15
+ };
16
+
17
+ //#endregion
18
+ export { __exportAll as t };
@@ -0,0 +1,557 @@
1
+ import { EventSourceOptions } from "@ixfx/rx/from";
2
+ import * as Rx from "@ixfx/rx";
3
+ import { Reactive, ReactiveInitial, ReactiveNonInitial, ReactiveWritable } from "@ixfx/rx";
4
+ import { Colour } from "@ixfx/visual";
5
+ import { Interval, Pathed, RecursivePartial } from "@ixfx/core";
6
+ import { HslScalar } from "@ixfx/visual/colour";
7
+
8
+ //#region src/rx/browser-resize.d.ts
9
+ /**
10
+ * Observe when element resizes. Specify `interval` to debounce, uses 100ms by default.
11
+ *
12
+ * ```
13
+ * const o = resizeObservable(myEl, 500);
14
+ * o.subscribe(() => {
15
+ * // called 500ms after last resize
16
+ * });
17
+ * ```
18
+ * @param elem
19
+ * @param interval Tiemout before event gets triggered
20
+ * @returns
21
+ */
22
+ declare const browserResizeObservable: (elem: Readonly<Element>, interval?: Interval) => any;
23
+ /**
24
+ * Returns an Reactive for window resize. Default 100ms debounce.
25
+ * @param elapsed
26
+ * @returns
27
+ */
28
+ declare const windowResize: (elapsed?: Interval) => any;
29
+ //#endregion
30
+ //#region src/rx/browser-theme-change.d.ts
31
+ /**
32
+ * Observe when a class changes on a target element, by default the document.
33
+ * Useful for tracking theme changes.
34
+ *
35
+ * ```js
36
+ * const c = cssClassChange();
37
+ * c.on(msg => {
38
+ * // some class has changed on the document
39
+ * });
40
+ * ```
41
+ */
42
+ declare const cssClassChange: (target?: HTMLElement) => Reactive<MutationRecord[]>;
43
+ //#endregion
44
+ //#region src/rx/colour.d.ts
45
+ type ReactiveColour = ReactiveWritable<HslScalar> & {
46
+ setHsl: (hsl: HslScalar) => void;
47
+ };
48
+ declare function colour(initialValue: HslScalar): ReactiveColour & ReactiveInitial<HslScalar>;
49
+ declare function colour(): ReactiveColour & ReactiveNonInitial<HslScalar>;
50
+ //#endregion
51
+ //#region src/rx/dom-types.d.ts
52
+ type DomBindValueTarget = {
53
+ /**
54
+ * If _true_ `innerHTML` is set (a shortcut for elField:`innerHTML`)
55
+ */
56
+ htmlContent?: boolean;
57
+ /**
58
+ * If _true_, 'textContent' is set (a shortcut for elField:'textContext')
59
+ */
60
+ textContent?: boolean;
61
+ /**
62
+ * If set, this DOM element field is set. Eg 'textContent'
63
+ */
64
+ elField?: string;
65
+ /**
66
+ * If set, this DOM attribute is set, Eg 'width'
67
+ */
68
+ attribName?: string;
69
+ /**
70
+ * If set, this CSS variable is set, Eg 'hue' (sets '--hue')
71
+ */
72
+ cssVariable?: string;
73
+ /**
74
+ * If set, this CSS property is set, Eg 'background-color'
75
+ */
76
+ cssProperty?: string;
77
+ };
78
+ type ElementBind = {
79
+ /**
80
+ * Tag name for this binding.
81
+ * Overrides `defaultTag`
82
+ */
83
+ tagName?: string;
84
+ /**
85
+ * If _true_, sub-paths are appended to element, rather than `container`
86
+ */
87
+ nestChildren?: boolean;
88
+ transform?: (value: any) => string;
89
+ };
90
+ type ElementsOptions = {
91
+ container: HTMLElement | string;
92
+ defaultTag: string;
93
+ binds: Record<string, DomBindValueTarget & ElementBind>;
94
+ };
95
+ type DomBindTargetNode = {
96
+ query?: string;
97
+ element?: HTMLElement;
98
+ };
99
+ type DomBindTargetNodeResolved = {
100
+ element: HTMLElement;
101
+ };
102
+ type DomBindUnresolvedSource<TSource, TDestination> = DomBindTargetNode & DomBindSourceValue<TSource, TDestination> & DomBindValueTarget;
103
+ type DomBindResolvedSource<TSource, TDestination> = DomBindTargetNodeResolved & DomBindSourceValue<TSource, TDestination> & DomBindValueTarget;
104
+ type DomBindSourceValue<TSource, TDestination> = {
105
+ twoway?: boolean;
106
+ /**
107
+ * Field from source value to pluck and use.
108
+ * This will also be the value passed to the transform
109
+ */
110
+ sourceField?: keyof TSource;
111
+ transform?: (input: TSource) => TDestination;
112
+ transformValue?: (input: any) => TDestination;
113
+ };
114
+ type DomBindInputOptions<TSource, TDestination> = DomBindSourceValue<TSource, TDestination> & {
115
+ transformFromInput: (input: TDestination) => TSource;
116
+ };
117
+ type BindUpdateOpts<V> = {
118
+ initial: (v: V, el: HTMLElement) => void;
119
+ binds: Record<string, DomBindValueTarget & {
120
+ transform?: (value: any) => string;
121
+ }>;
122
+ };
123
+ type DomCreateOptions = {
124
+ tagName: string;
125
+ parentEl: string | HTMLElement;
126
+ };
127
+ type PipeDomBinding = {
128
+ /**
129
+ * Remove binding and optionally delete element(s) (false by default)
130
+ */
131
+ remove(deleteElements: boolean): void;
132
+ };
133
+ type DomValueOptions = EventSourceOptions & {
134
+ /**
135
+ * If true, the current value will be emitted even though it wasn't
136
+ * triggered by an event.
137
+ * Default: false
138
+ */
139
+ emitInitialValue: boolean;
140
+ attributeName: string;
141
+ fieldName: string;
142
+ /**
143
+ * Respond to when value has changed or when value is changing
144
+ * Default: `changed`
145
+ */
146
+ when: `changed` | `changing`;
147
+ fallbackValue: string;
148
+ upstreamSource?: Reactive<unknown>;
149
+ upstreamFilter?: (value: unknown) => string;
150
+ };
151
+ type DomFormOptions<T extends Record<string, unknown>> = EventSourceOptions & {
152
+ /**
153
+ * If true, the current value will be emitted even though it wasn't
154
+ * triggered by an event.
155
+ * Default: false
156
+ */
157
+ emitInitialValue: boolean;
158
+ /**
159
+ * Respond to when value has changed or when value is changing
160
+ * Default: `changed`
161
+ */
162
+ when: `changed` | `changing`;
163
+ upstreamSource?: Reactive<T>;
164
+ upstreamFilter?: (name: string, value: unknown) => string;
165
+ };
166
+ type DomNumberInputValueOptions = DomValueOptions & {
167
+ /**
168
+ * If true, sets up INPUT element to operate with relative values
169
+ */
170
+ relative?: boolean;
171
+ /**
172
+ * If true, when setting up, sets max to be on left side
173
+ */
174
+ inverted?: boolean;
175
+ upstreamSource?: Reactive<number>;
176
+ };
177
+ //#endregion
178
+ //#region src/rx/dom-source.d.ts
179
+ /**
180
+ * Reactive getting/setting of values to a HTML INPUT element.
181
+ *
182
+ * Options:
183
+ * - relative: if _true_, values are 0..1 (default: false)
184
+ * - inverted: if _true_, values are 1..0 (default: false)
185
+ *
186
+ * If element is missing a 'type' attribute, this will be set to 'range'.
187
+ * @param targetOrQuery
188
+ * @param options
189
+ * @returns
190
+ */
191
+ declare function domNumberInputValue(targetOrQuery: HTMLInputElement | string, options?: Partial<DomNumberInputValueOptions>): ReactiveInitial<number> & ReactiveWritable<number>;
192
+ declare function domHslInputValue(targetOrQuery: HTMLInputElement | string, options?: Partial<DomValueOptions>): ReactiveInitial<Colour.HslScalar> & Reactive<Colour.HslScalar> & ReactiveWritable<Colour.HslScalar>;
193
+ /**
194
+ * A stream of values when the a HTMLInputElement changes. Eg a <input type="range">
195
+ * ```js
196
+ * const r = Rx.From.domInputValue(`#myEl`);
197
+ * r.onValue(value => {
198
+ * // value will be string
199
+ * });
200
+ * ```
201
+ *
202
+ * Options:
203
+ * * emitInitialValue: If _true_ emits the HTML value of element (default: false)
204
+ * * attributeName: If set, this is the HTML attribute value is set to when writing to stream (default: 'value')
205
+ * * fieldName: If set, this is the DOM object field set when writing to stream (default: 'value')
206
+ * * when: 'changed'|'changing' when values are emitted. (default: 'changed')
207
+ * * fallbackValue: Fallback value to use if field/attribute cannot be read (default: '')
208
+ * @param targetOrQuery
209
+ * @param options
210
+ * @returns
211
+ */
212
+ declare function domInputValue(targetOrQuery: HTMLInputElement | string, options?: Partial<DomValueOptions>): {
213
+ el: HTMLInputElement;
214
+ } & ReactiveInitial<string> & ReactiveWritable<string>;
215
+ /**
216
+ * Listens for data changes from elements within a HTML form element.
217
+ * Input elements must have a 'name' attribute.
218
+ *
219
+ * Simple usage:
220
+ * ```js
221
+ * const rx = Rx.From.domForm(`#my-form`);
222
+ * rx.onValue(value => {
223
+ * // Object containing values from form
224
+ * });
225
+ *
226
+ * rx.last(); // Read current values of form
227
+ * ```
228
+ *
229
+ * UI can be updated
230
+ * ```js
231
+ * // Set using an object of key-value pairs
232
+ * rx.set({
233
+ * size: 'large'
234
+ * });
235
+ *
236
+ * // Or set a single name-value pair
237
+ * rx.setNamedValue(`size`, `large`);
238
+ * ```
239
+ *
240
+ * If an 'upstream' reactive is provided, this is used to set initial values of the UI, overriding
241
+ * whatever may be in the HTML. Upstream changes modify UI elements, but UI changes do not modify the upstream
242
+ * source.
243
+ *
244
+ * ```js
245
+ * // Create a reactive object
246
+ * const obj = Rx.From.object({
247
+ * when: `2024-10-03`,
248
+ * size: 12,
249
+ * checked: true
250
+ * });
251
+ *
252
+ * // Use this as initial values for a HTML form
253
+ * // (assuming appropriate INPUT/SELECT elements exist)
254
+ * const rx = Rx.From.domForm(`form`, {
255
+ * upstreamSource: obj
256
+ * });
257
+ *
258
+ * // Listen for changes in the UI
259
+ * rx.onValue(value => {
260
+ *
261
+ * });
262
+ * ```
263
+ * @param formElOrQuery
264
+ * @param options
265
+ * @returns
266
+ */
267
+ declare function domForm<T extends Record<string, any>>(formElOrQuery: HTMLFormElement | string, options?: Partial<DomFormOptions<T>>): {
268
+ setNamedValue: (name: string, value: any) => void;
269
+ el: HTMLFormElement;
270
+ } & ReactiveInitial<T> & ReactiveWritable<T>;
271
+ //#endregion
272
+ //#region src/rx/dom.d.ts
273
+ /**
274
+ * Reactive stream of array of elements that match `query`.
275
+ * @param query
276
+ * @returns
277
+ */
278
+ declare function fromDomQuery(query: string): Rx.Reactive<HTMLElement[]> & {
279
+ set(value: HTMLElement[]): void;
280
+ } & {
281
+ onField(fieldName: string, handler: (result: Rx.ObjectFieldHandler) => void): () => void;
282
+ onDiff(changes: (changes: Pathed.PathDataChange<any>[]) => void): () => void;
283
+ update(changedPart: (RecursivePartial<HTMLElement> | undefined)[]): HTMLElement[];
284
+ updateField(field: string, value: any): void;
285
+ } & {
286
+ last(): HTMLElement[];
287
+ };
288
+ /**
289
+ * Updates an element's `textContent` when the source value changes.
290
+ * ```js
291
+ * bindText(source, `#blah`);
292
+ * ```
293
+ * @param elOrQuery
294
+ * @param source
295
+ * @param bindOpts
296
+ */
297
+ declare const bindText: <TSource>(source: Rx.Reactive<TSource>, elOrQuery: string | HTMLElement | null, bindOpts?: Partial<DomBindSourceValue<TSource, string>>) => PipeDomBinding;
298
+ /**
299
+ * Updates an element's `value` (as well as the 'value' attribute) when the source value changes.s
300
+ * @param source
301
+ * @param elOrQuery
302
+ * @param bindOpts
303
+ * @returns
304
+ */
305
+ declare const bindValueText: <TSource>(source: Rx.Reactive<TSource>, elOrQuery: string | HTMLInputElement | null, bindOpts?: Partial<DomBindSourceValue<TSource, string>>) => PipeDomBinding;
306
+ /**
307
+ * Updates an element's `innerHTML` when the source value changes
308
+ * ```js
309
+ * bindHtml(source, `#blah`);
310
+ * ```
311
+ *
312
+ * Uses {@link bindElement}, with `{elField:'innerHTML'}` as the options.
313
+ * @param elOrQuery
314
+ * @param source
315
+ * @param bindOpts
316
+ * @returns
317
+ */
318
+ declare const bindHtml: <TSource>(source: Rx.Reactive<TSource>, elOrQuery: string | HTMLElement | null, bindOpts?: DomBindSourceValue<TSource, string>) => PipeDomBinding;
319
+ /**
320
+ * Shortcut to bind to an elements attribute
321
+ * @param elOrQuery
322
+ * @param source
323
+ * @param attribute
324
+ * @param bindOpts
325
+ * @returns
326
+ */
327
+ /**
328
+ * Shortcut to bind to a CSS variable
329
+ * @param elOrQuery
330
+ * @param source
331
+ * @param cssVariable
332
+ * @param bindOpts
333
+ * @returns
334
+ */
335
+ /**
336
+ * Creates a new HTML element, calling {@link bind} on it to update when `source` emits new values.
337
+ *
338
+ *
339
+ * ```js
340
+ * // Set textContent of a SPAN with values from `source`
341
+ * create(source, { tagName: `span`, parentEl: document.body })
342
+ * ```
343
+ *
344
+ * If `parentEl` is not given in the options, the created element needs to be manually added
345
+ * ```js
346
+ * const b = create(source);
347
+ * someEl.append(b.el); // Append manually
348
+ * ```
349
+ *
350
+ * ```
351
+ * // Set 'title' attribute based on values from `source`
352
+ * create(source, { parentEl: document.body, attribName: `title` })
353
+ * ```
354
+ * @param source
355
+ * @param options
356
+ * @returns
357
+ */
358
+ /**
359
+ * Update a DOM element's field, attribute or CSS variable when `source` produces a value.
360
+ *
361
+ * ```js
362
+ * // Access via DOM query. Binds to 'textContent' by default
363
+ * bind(readableSource, `#someEl`);
364
+ *
365
+ * // Set innerHTML instead
366
+ * bind(readableSource, someEl, { elField: `innerHTML` });
367
+ *
368
+ * // An attribute
369
+ * bind(readableSource, someEl, { attribName: `width` });
370
+ *
371
+ * // A css variable ('--' optiona)
372
+ * bind(readableSource, someEl, { cssVariable: `hue` });
373
+ *
374
+ * // Pluck a particular field from source data.
375
+ * // Ie someEl.textContent = value.colour
376
+ * bind(readableSource, someEl, { sourceField: `colour` });
377
+ *
378
+ * // Transform value before setting it to field
379
+ * bind(readableSource, someEl, {
380
+ * field: `innerHTML`,
381
+ * transform: (v) => `Colour: ${v.colour}`
382
+ * })
383
+ * ```
384
+ *
385
+ * If `source` has an initial value, this is used when first bound.
386
+ *
387
+ * Returns {@link PipeDomBinding} to control binding:
388
+ * ```js
389
+ * const bind = bind(source, `#someEl`);
390
+ * bind.remove(); // Unbind
391
+ * bind.remove(true); // Unbind and remove HTML element
392
+ * ```
393
+ *
394
+ * If several fields need to be updated based on a new value, consider using {@link bindUpdate} instead.
395
+ * @param elOrQuery Element to update to, or query string such as '#someid'
396
+ * @param source Source of data
397
+ * @param binds Bindings
398
+ */
399
+ declare const bindElement: <TSource, TDestination>(source: Rx.Reactive<TSource>, elOrQuery: string | HTMLElement | null, ...binds: (DomBindSourceValue<TSource, TDestination> & DomBindValueTarget)[]) => PipeDomBinding;
400
+ /**
401
+ * Binds `source` to one or more element(s). One or more bindings for the same source
402
+ * can be provided.
403
+ *
404
+ * ```js
405
+ * bind(source,
406
+ * // Binds .name field of source values to textContent of #some-element
407
+ * { query: `#some-element`, sourceField: `name` },
408
+ * { query: `section`, }
409
+ * );
410
+ * ```
411
+ *
412
+ * Can update
413
+ * * CSS variables
414
+ * * CSS styles
415
+ * * textContent / innerHTML
416
+ * * HTML DOM attributes and object fields
417
+ *
418
+ * Can use a particular field on source values, or use the whole value. These can
419
+ * pass through `transformValue` or `transform` respectively.
420
+ *
421
+ * Returns a function to unbind from source and optionally remove HTML element
422
+ * ```js
423
+ * const unbind = bind( . . . );
424
+ * unbind(); // Unbind
425
+ * unbind(true); // Unbind and remove HTML element(s)
426
+ * ```
427
+ * @param source
428
+ * @param bindsUnresolvedElements
429
+ * @returns
430
+ */
431
+ declare const bind: <TSource, TDestination>(source: Rx.Reactive<TSource>, ...bindsUnresolvedElements: DomBindUnresolvedSource<TSource, TDestination>[]) => PipeDomBinding;
432
+ /**
433
+ * Calls `updater` whenever `source` produces a value. Useful when several fields from a value
434
+ * are needed to update an element.
435
+ * ```js
436
+ * bindUpdate(source, `#someEl`, (v, el) => {
437
+ * el.setAttribute(`width`, v.width);
438
+ * el.setAttribute(`height`, v.height);
439
+ * });
440
+ * ```
441
+ *
442
+ * Returns a {@link PipeDomBinding} to manage binding
443
+ * ```js
444
+ * const b = bindUpdate(...);
445
+ * b.remove(); // Disconnect binding
446
+ * b.remove(true); // Disconnect binding and remove element
447
+ * b.el; // HTML element
448
+ * ```
449
+ * @param elOrQuery
450
+ * @param source
451
+ * @param updater
452
+ * @returns
453
+ */
454
+ declare const bindUpdate: <V>(source: Rx.Reactive<V>, elOrQuery: string | HTMLElement, updater: (v: V, el: HTMLElement) => void) => PipeDomBinding;
455
+ /**
456
+ * Updates a HTML element based on diffs on an object.
457
+ * ```js
458
+ * // Wrap an object
459
+ * const o = Rx.object({ name: `Jane`, ticks: 0 });
460
+ * const b = bindDiffUpdate(`#test`, o, (diffs, el) => {
461
+ * // el = reference to #test
462
+ * // diff = Array of Changes,
463
+ * // eg [ { path: `ticks`, value: 797, previous: 0 } ]
464
+ * for (const diff of diffs) {
465
+ * if (diff.path === `ticks`) el.textContent = `${diff.previous} -> ${diff.value}`
466
+ * }
467
+ * })
468
+ *
469
+ * // Eg. update field
470
+ * o.updateField(`ticks`, Math.floor(Math.random()*1000));
471
+ * ```
472
+ *
473
+ * If `initial` is provided as an option, this will be called if `source` has an initial value. Without this, the DOM won't be updated until the first data
474
+ * update happens.
475
+ * ```js
476
+ * bindDiffUpdate(el, source, updater, {
477
+ * initial: (v, el) => {
478
+ * el.innerHTML = v.name;
479
+ * }
480
+ * })
481
+ * ```
482
+ * @param elOrQuery
483
+ * @param source
484
+ * @param updater
485
+ * @param opts
486
+ * @returns
487
+ */
488
+ declare const bindDiffUpdate: <V>(source: Rx.ReactiveDiff<V>, elOrQuery: string | HTMLElement | null, updater: (diffs: Pathed.PathDataChange<any>[], el: HTMLElement) => void, opts?: Partial<BindUpdateOpts<V>>) => PipeDomBinding & {
489
+ refresh: () => void;
490
+ };
491
+ /**
492
+ * Creates a new HTML element and calls `bindUpdate` so values from `source` can be used
493
+ * to update it.
494
+ *
495
+ *
496
+ * ```js
497
+ * // Creates a span, adding it to <body>
498
+ * const b = createUpdate(dataSource, (value, el) => {
499
+ * el.width = value.width;
500
+ * el.height = value.height;
501
+ * }, {
502
+ * tagName: `SPAN`,
503
+ * parentEl: document.body
504
+ * })
505
+ * ```
506
+ * @param source
507
+ * @param updater
508
+ * @param options
509
+ * @returns
510
+ */
511
+ /**
512
+ * Creates, updates & deletes elements based on pathed values from a reactive.
513
+ *
514
+ * This means that elements are only manipulated if its associated data changes,
515
+ * and elements are not modified if there's no need to.
516
+ * @param source
517
+ * @param options
518
+ */
519
+ declare const elements: <T>(source: Rx.ReactiveDiff<T> | (Rx.ReactiveDiff<T> & Rx.ReactiveInitial<T>), options: Partial<ElementsOptions>) => void;
520
+ declare function win(): {
521
+ dispose: (reason?: string) => void;
522
+ size: Rx.Reactive<{
523
+ lazy: string;
524
+ transform: () => {
525
+ width: number;
526
+ height: number;
527
+ };
528
+ }> & {
529
+ last(): {
530
+ lazy: string;
531
+ transform: () => {
532
+ width: number;
533
+ height: number;
534
+ };
535
+ };
536
+ };
537
+ pointer: Rx.Reactive<{
538
+ lazy: string;
539
+ transform: (args: Event | undefined) => {
540
+ x: number;
541
+ y: number;
542
+ };
543
+ }> & {
544
+ last(): {
545
+ lazy: string;
546
+ transform: (args: Event | undefined) => {
547
+ x: number;
548
+ y: number;
549
+ };
550
+ };
551
+ };
552
+ };
553
+ declare namespace index_d_exports {
554
+ export { BindUpdateOpts, DomBindInputOptions, DomBindResolvedSource, DomBindSourceValue, DomBindTargetNode, DomBindTargetNodeResolved, DomBindUnresolvedSource, DomBindValueTarget, DomCreateOptions, DomFormOptions, DomNumberInputValueOptions, DomValueOptions, ElementBind, ElementsOptions, PipeDomBinding, ReactiveColour, bind, bindDiffUpdate, bindElement, bindHtml, bindText, bindUpdate, bindValueText, browserResizeObservable, colour, cssClassChange, domForm, domHslInputValue, domInputValue, domNumberInputValue, elements, fromDomQuery, win, windowResize };
555
+ }
556
+ //#endregion
557
+ export { index_d_exports as RxUi };