@dereekb/util 13.11.14 → 13.11.15
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/eslint/index.cjs.js +10008 -394
- package/eslint/index.esm.js +9982 -392
- package/eslint/package.json +4 -4
- package/eslint/src/lib/comments.d.ts +14 -3
- package/eslint/src/lib/dbx-tag-families.d.ts +280 -0
- package/eslint/src/lib/index.d.ts +26 -3
- package/eslint/src/lib/jsdoc-parser.d.ts +116 -0
- package/eslint/src/lib/no-inline-string-empty-object-intersection.rule.d.ts +44 -0
- package/eslint/src/lib/no-inline-type-import.rule.d.ts +38 -0
- package/eslint/src/lib/no-sister-re-export.rule.d.ts +69 -0
- package/eslint/src/lib/plugin.d.ts +52 -1
- package/eslint/src/lib/prefer-canonical-jsdoc.rule.d.ts +68 -0
- package/eslint/src/lib/prefer-config-object.rule.d.ts +61 -0
- package/eslint/src/lib/prefer-maybe-type.rule.d.ts +72 -0
- package/eslint/src/lib/prefer-no-side-effects-in-jsdoc.rule.d.ts +1 -1
- package/eslint/src/lib/prefer-suggested-string.rule.d.ts +51 -0
- package/eslint/src/lib/require-constant-naming.rule.d.ts +63 -0
- package/eslint/src/lib/require-dbx-action-companion-tags.rule.d.ts +46 -0
- package/eslint/src/lib/require-dbx-auth-companion-tags.rule.d.ts +45 -0
- package/eslint/src/lib/require-dbx-docs-ui-example-companion-tags.rule.d.ts +42 -0
- package/eslint/src/lib/require-dbx-filter-companion-tags.rule.d.ts +43 -0
- package/eslint/src/lib/require-dbx-form-field-companion-tags.rule.d.ts +46 -0
- package/eslint/src/lib/require-dbx-model-companion-tags.rule.d.ts +46 -0
- package/eslint/src/lib/require-dbx-model-firebase-index-companion-tags.rule.d.ts +44 -0
- package/eslint/src/lib/require-dbx-model-snapshot-field-companion-tags.rule.d.ts +44 -0
- package/eslint/src/lib/require-dbx-pipe-companion-tags.rule.d.ts +43 -0
- package/eslint/src/lib/require-dbx-rule-companion-tags.rule.d.ts +44 -0
- package/eslint/src/lib/require-dbx-util-companion-tags.rule.d.ts +74 -0
- package/eslint/src/lib/require-dbx-web-companion-tags.rule.d.ts +43 -0
- package/eslint/src/lib/require-default-prefix-naming.rule.d.ts +60 -0
- package/eslint/src/lib/require-deprecated-alias-placement.rule.d.ts +75 -0
- package/eslint/src/lib/require-exported-jsdoc-example.rule.d.ts +61 -0
- package/eslint/src/lib/require-no-side-effects.rule.d.ts +1 -1
- package/eslint/src/lib/require-readonly-config-params.rule.d.ts +57 -0
- package/eslint/src/lib/require-single-return.rule.d.ts +42 -0
- package/fetch/index.cjs.js +95 -80
- package/fetch/index.esm.js +95 -80
- package/fetch/package.json +2 -2
- package/fetch/src/lib/error.d.ts +2 -2
- package/fetch/src/lib/fetch.d.ts +15 -15
- package/fetch/src/lib/fetch.file.d.ts +5 -5
- package/fetch/src/lib/fetch.limit.d.ts +2 -2
- package/fetch/src/lib/fetch.page.d.ts +1 -1
- package/fetch/src/lib/fetch.page.iterate.d.ts +4 -4
- package/fetch/src/lib/fetch.type.d.ts +3 -2
- package/fetch/src/lib/fetch.url.d.ts +13 -13
- package/fetch/src/lib/json.d.ts +12 -12
- package/fetch/src/lib/timeout.d.ts +2 -2
- package/fetch/src/lib/url.d.ts +11 -11
- package/index.cjs.js +2592 -2329
- package/index.esm.js +2590 -2327
- package/package.json +1 -1
- package/src/lib/array/array.boolean.d.ts +20 -20
- package/src/lib/array/array.d.ts +73 -72
- package/src/lib/array/array.factory.d.ts +8 -5
- package/src/lib/array/array.filter.d.ts +23 -20
- package/src/lib/array/array.find.d.ts +9 -8
- package/src/lib/array/array.index.d.ts +15 -14
- package/src/lib/array/array.indexed.d.ts +22 -19
- package/src/lib/array/array.make.d.ts +3 -2
- package/src/lib/array/array.map.d.ts +5 -5
- package/src/lib/array/array.number.d.ts +27 -27
- package/src/lib/array/array.random.d.ts +11 -10
- package/src/lib/array/array.set.d.ts +14 -14
- package/src/lib/array/array.string.d.ts +31 -31
- package/src/lib/array/array.unique.d.ts +22 -20
- package/src/lib/array/array.value.d.ts +3 -2
- package/src/lib/assertion/assert.error.d.ts +8 -8
- package/src/lib/assertion/assertion.d.ts +5 -5
- package/src/lib/assertion/assertion.generic.d.ts +3 -3
- package/src/lib/assertion/assertion.number.d.ts +6 -6
- package/src/lib/auth/auth.role.claims.d.ts +12 -11
- package/src/lib/auth/auth.role.d.ts +3 -3
- package/src/lib/auth/pkce.d.ts +2 -2
- package/src/lib/boolean.d.ts +11 -11
- package/src/lib/cache/cache.memoize.d.ts +6 -6
- package/src/lib/contact/domain.d.ts +9 -9
- package/src/lib/contact/email.d.ts +11 -11
- package/src/lib/contact/phone.d.ts +12 -12
- package/src/lib/contact/random.d.ts +11 -9
- package/src/lib/date/date.d.ts +60 -59
- package/src/lib/date/date.time.d.ts +2 -2
- package/src/lib/date/date.unix.d.ts +8 -8
- package/src/lib/date/duration.d.ts +17 -17
- package/src/lib/date/expires.d.ts +29 -27
- package/src/lib/date/hour.d.ts +23 -23
- package/src/lib/date/minute.d.ts +6 -6
- package/src/lib/date/time.d.ts +10 -9
- package/src/lib/date/week.d.ts +32 -31
- package/src/lib/encryption/encryption.object.d.ts +3 -3
- package/src/lib/error/error.d.ts +13 -12
- package/src/lib/error/error.server.d.ts +4 -4
- package/src/lib/file/pdf.d.ts +4 -4
- package/src/lib/filter/filter.d.ts +3 -2
- package/src/lib/function/function.boolean.d.ts +4 -3
- package/src/lib/function/function.forward.d.ts +6 -4
- package/src/lib/getter/getter.d.ts +24 -19
- package/src/lib/getter/getter.map.d.ts +6 -5
- package/src/lib/getter/getter.util.d.ts +3 -2
- package/src/lib/grouping.d.ts +25 -24
- package/src/lib/hash.d.ts +11 -10
- package/src/lib/iterable/iterable.d.ts +39 -39
- package/src/lib/iterable/iterable.map.d.ts +3 -3
- package/src/lib/key.d.ts +16 -16
- package/src/lib/map/map.d.ts +12 -12
- package/src/lib/map/map.intersection.d.ts +3 -3
- package/src/lib/map/map.key.d.ts +16 -14
- package/src/lib/misc/host.d.ts +2 -2
- package/src/lib/model/id.batch.d.ts +4 -3
- package/src/lib/model/id.factory.d.ts +4 -3
- package/src/lib/model/model.conversion.d.ts +19 -14
- package/src/lib/model/model.conversion.field.d.ts +2 -2
- package/src/lib/model/model.copy.d.ts +5 -4
- package/src/lib/model/model.d.ts +48 -46
- package/src/lib/model/model.modify.d.ts +10 -8
- package/src/lib/nodejs/stream.d.ts +6 -5
- package/src/lib/number/bitwise.dencoder.d.ts +12 -12
- package/src/lib/number/bound.d.ts +16 -13
- package/src/lib/number/dollar.d.ts +6 -5
- package/src/lib/number/encoded.d.ts +7 -7
- package/src/lib/number/factory.d.ts +4 -3
- package/src/lib/number/number.d.ts +37 -37
- package/src/lib/number/random.d.ts +11 -10
- package/src/lib/number/round.d.ts +34 -30
- package/src/lib/number/sort.d.ts +3 -2
- package/src/lib/number/transform.d.ts +5 -4
- package/src/lib/object/object.array.d.ts +6 -6
- package/src/lib/object/object.array.delta.d.ts +3 -2
- package/src/lib/object/object.d.ts +12 -12
- package/src/lib/object/object.empty.d.ts +3 -3
- package/src/lib/object/object.equal.d.ts +11 -10
- package/src/lib/object/object.filter.pojo.d.ts +74 -74
- package/src/lib/object/object.filter.tuple.d.ts +26 -26
- package/src/lib/object/object.flatten.d.ts +4 -4
- package/src/lib/object/object.key.d.ts +6 -4
- package/src/lib/object/object.map.d.ts +15 -13
- package/src/lib/page/page.d.ts +5 -5
- package/src/lib/page/page.filter.d.ts +8 -8
- package/src/lib/path/path.d.ts +98 -88
- package/src/lib/promise/callback.d.ts +2 -2
- package/src/lib/promise/is.d.ts +6 -6
- package/src/lib/promise/poll.d.ts +9 -9
- package/src/lib/promise/promise.d.ts +33 -30
- package/src/lib/promise/promise.factory.d.ts +4 -3
- package/src/lib/promise/promise.loop.d.ts +11 -11
- package/src/lib/promise/promise.task.d.ts +6 -5
- package/src/lib/promise/promise.type.d.ts +3 -3
- package/src/lib/promise/use.d.ts +3 -3
- package/src/lib/relation/relation.d.ts +15 -15
- package/src/lib/service/handler.config.d.ts +20 -16
- package/src/lib/service/handler.d.ts +3 -2
- package/src/lib/service/typed.service.d.ts +2 -2
- package/src/lib/set/set.d.ts +62 -59
- package/src/lib/set/set.delta.d.ts +5 -4
- package/src/lib/set/set.hashset.d.ts +5 -5
- package/src/lib/set/set.selection.d.ts +5 -4
- package/src/lib/sort.d.ts +11 -11
- package/src/lib/storage/storage.d.ts +2 -1
- package/src/lib/storage/storage.error.d.ts +4 -4
- package/src/lib/storage/storage.memory.d.ts +7 -7
- package/src/lib/storage/storage.object.d.ts +5 -5
- package/src/lib/string/case.d.ts +6 -6
- package/src/lib/string/char.d.ts +30 -29
- package/src/lib/string/dencoder.d.ts +25 -20
- package/src/lib/string/factory.d.ts +11 -8
- package/src/lib/string/html.d.ts +19 -19
- package/src/lib/string/mimetype.d.ts +9 -8
- package/src/lib/string/prefix.d.ts +8 -8
- package/src/lib/string/replace.d.ts +45 -39
- package/src/lib/string/search.d.ts +5 -4
- package/src/lib/string/sort.d.ts +13 -4
- package/src/lib/string/string.d.ts +44 -43
- package/src/lib/string/transform.d.ts +32 -23
- package/src/lib/string/tree.d.ts +5 -4
- package/src/lib/string/url.d.ts +5 -4
- package/src/lib/tree/tree.array.d.ts +5 -4
- package/src/lib/tree/tree.expand.d.ts +6 -6
- package/src/lib/tree/tree.explore.d.ts +13 -10
- package/src/lib/tree/tree.flatten.d.ts +10 -10
- package/src/lib/type.d.ts +42 -12
- package/src/lib/value/address.d.ts +7 -7
- package/src/lib/value/bound.d.ts +70 -66
- package/src/lib/value/build.d.ts +6 -6
- package/src/lib/value/comparator.d.ts +19 -17
- package/src/lib/value/cron.d.ts +2 -2
- package/src/lib/value/decision.d.ts +6 -5
- package/src/lib/value/equal.d.ts +11 -9
- package/src/lib/value/indexed.d.ts +101 -85
- package/src/lib/value/label.d.ts +2 -2
- package/src/lib/value/map.d.ts +20 -16
- package/src/lib/value/maybe.d.ts +36 -36
- package/src/lib/value/modifier.d.ts +24 -23
- package/src/lib/value/point.d.ts +85 -77
- package/src/lib/value/url.d.ts +2 -2
- package/src/lib/value/use.d.ts +36 -33
- package/src/lib/value/vector.d.ts +15 -14
- package/test/index.cjs.js +41 -36
- package/test/index.esm.js +41 -36
- package/test/package.json +2 -2
- package/test/src/lib/jest/jest.fail.d.ts +2 -2
- package/test/src/lib/shared/shared.d.ts +20 -20
- package/test/src/lib/shared/shared.fail.d.ts +21 -16
- package/test/src/lib/shared/shared.function.d.ts +4 -4
- package/test/src/lib/shared/shared.wrap.d.ts +10 -10
package/src/lib/value/point.d.ts
CHANGED
|
@@ -63,48 +63,48 @@ export interface LonLatPoint {
|
|
|
63
63
|
/**
|
|
64
64
|
* Type guard that checks whether the input is a {@link LatLngPoint} by testing for `lat` and `lng` properties.
|
|
65
65
|
*
|
|
66
|
-
* @param input -
|
|
67
|
-
* @returns `true` if the input has both `lat` and `lng` properties
|
|
66
|
+
* @param input - The value to test.
|
|
67
|
+
* @returns `true` if the input has both `lat` and `lng` properties.
|
|
68
68
|
*/
|
|
69
69
|
export declare function isLatLngPoint(input: LatLngPoint | unknown): input is LatLngPoint;
|
|
70
70
|
/**
|
|
71
71
|
* Creates a shallow copy of the point so that mutations to the copy do not affect the original.
|
|
72
72
|
*
|
|
73
|
-
* @param input -
|
|
74
|
-
* @returns
|
|
73
|
+
* @param input - Point to copy.
|
|
74
|
+
* @returns A new point with the same coordinates.
|
|
75
75
|
*/
|
|
76
76
|
export declare function copyLatLngPoint(input: LatLngPoint): LatLngPoint;
|
|
77
77
|
/**
|
|
78
78
|
* Checks whether two points have identical coordinates. Handles `null`/`undefined` by returning `true` only if both are nullish.
|
|
79
79
|
*
|
|
80
|
-
* @param a -
|
|
81
|
-
* @param b -
|
|
82
|
-
* @returns `true` if both points have the same `lat` and `lng`, or both are nullish
|
|
80
|
+
* @param a - First point.
|
|
81
|
+
* @param b - Second point.
|
|
82
|
+
* @returns `true` if both points have the same `lat` and `lng`, or both are nullish.
|
|
83
83
|
*/
|
|
84
84
|
export declare function isSameLatLngPoint(a: Maybe<LatLngPoint>, b: Maybe<LatLngPoint>): boolean;
|
|
85
85
|
/**
|
|
86
86
|
* Computes the difference between two points (`a - b`), optionally wrapping the result to valid lat/lng ranges.
|
|
87
87
|
*
|
|
88
|
-
* @param a -
|
|
89
|
-
* @param b -
|
|
90
|
-
* @param wrap -
|
|
91
|
-
* @returns
|
|
88
|
+
* @param a - The point to subtract from.
|
|
89
|
+
* @param b - The point to subtract.
|
|
90
|
+
* @param wrap - Whether to wrap the result to valid lat/lng ranges; defaults to `true`
|
|
91
|
+
* @returns A point representing the difference.
|
|
92
92
|
*/
|
|
93
93
|
export declare function diffLatLngPoints(a: LatLngPoint, b: LatLngPoint, wrap?: boolean): LatLngPoint;
|
|
94
94
|
/**
|
|
95
95
|
* Computes the sum of two points (`a + b`), optionally wrapping the result to valid lat/lng ranges.
|
|
96
96
|
*
|
|
97
|
-
* @param a -
|
|
98
|
-
* @param b -
|
|
99
|
-
* @param wrap -
|
|
100
|
-
* @returns
|
|
97
|
+
* @param a - The first point.
|
|
98
|
+
* @param b - The second point.
|
|
99
|
+
* @param wrap - Whether to wrap the result to valid lat/lng ranges; defaults to `true`
|
|
100
|
+
* @returns A point representing the sum.
|
|
101
101
|
*/
|
|
102
102
|
export declare function addLatLngPoints(a: LatLngPoint, b: LatLngPoint, wrap?: boolean): LatLngPoint;
|
|
103
103
|
/**
|
|
104
104
|
* Wraps a point so its latitude is capped to [-90, 90] and its longitude wraps around [-180, 180].
|
|
105
105
|
*
|
|
106
|
-
* @param a -
|
|
107
|
-
* @returns
|
|
106
|
+
* @param a - Point to wrap.
|
|
107
|
+
* @returns A new point with valid coordinates.
|
|
108
108
|
*/
|
|
109
109
|
export declare function wrapLatLngPoint(a: LatLngPoint): LatLngPoint;
|
|
110
110
|
/**
|
|
@@ -127,55 +127,55 @@ export declare const wrapLngValue: import("..").WrapNumberFunction<number>;
|
|
|
127
127
|
/**
|
|
128
128
|
* Checks whether a latitude value is within the valid range [-90, 90].
|
|
129
129
|
*
|
|
130
|
-
* @param lat -
|
|
131
|
-
* @returns `true` if the value is a valid latitude
|
|
130
|
+
* @param lat - Latitude value to validate.
|
|
131
|
+
* @returns `true` if the value is a valid latitude.
|
|
132
132
|
*/
|
|
133
133
|
export declare function isValidLatitude(lat: Latitude): boolean;
|
|
134
134
|
/**
|
|
135
135
|
* Checks whether a longitude value is within the valid range [-180, 180].
|
|
136
136
|
*
|
|
137
|
-
* @param lat -
|
|
138
|
-
* @returns `true` if the value is a valid longitude
|
|
137
|
+
* @param lat - Longitude value to validate.
|
|
138
|
+
* @returns `true` if the value is a valid longitude.
|
|
139
139
|
*/
|
|
140
140
|
export declare function isValidLongitude(lat: Longitude): boolean;
|
|
141
141
|
/**
|
|
142
142
|
* Returns the default {@link LatLngPoint} at the origin (0, 0).
|
|
143
143
|
*
|
|
144
|
-
* @returns
|
|
144
|
+
* @returns A point at latitude 0, longitude 0.
|
|
145
145
|
*/
|
|
146
146
|
export declare function defaultLatLngPoint(): LatLngPoint;
|
|
147
147
|
/**
|
|
148
148
|
* Checks whether a point or string represents the default (0, 0) location.
|
|
149
149
|
* Treats empty strings as the default.
|
|
150
150
|
*
|
|
151
|
-
* @param point -
|
|
152
|
-
* @returns `true` if the input represents the default location
|
|
151
|
+
* @param point - A point or lat/lng string to check.
|
|
152
|
+
* @returns `true` if the input represents the default location.
|
|
153
153
|
*/
|
|
154
154
|
export declare function isDefaultLatLngPoint(point: LatLngPoint | LatLngString | ''): boolean;
|
|
155
155
|
/**
|
|
156
156
|
* Checks whether a point has coordinates of exactly (0, 0).
|
|
157
157
|
*
|
|
158
|
-
* @param point -
|
|
159
|
-
* @returns `true` if both `lat` and `lng` are 0
|
|
158
|
+
* @param point - Point to check.
|
|
159
|
+
* @returns `true` if both `lat` and `lng` are 0.
|
|
160
160
|
*/
|
|
161
161
|
export declare function isDefaultLatLngPointValue(point: LatLngPoint): boolean;
|
|
162
162
|
/**
|
|
163
163
|
* Returns the south-west-most possible point (-90, -180).
|
|
164
164
|
*
|
|
165
|
-
* @returns
|
|
165
|
+
* @returns The minimum corner of the valid coordinate space.
|
|
166
166
|
*/
|
|
167
167
|
export declare function swMostLatLngPoint(): LatLngPoint;
|
|
168
168
|
/**
|
|
169
169
|
* Returns the north-east-most possible point (90, 180).
|
|
170
170
|
*
|
|
171
|
-
* @returns
|
|
171
|
+
* @returns The maximum corner of the valid coordinate space.
|
|
172
172
|
*/
|
|
173
173
|
export declare function neMostLatLngPoint(): LatLngPoint;
|
|
174
174
|
/**
|
|
175
175
|
* Returns true if the input point's lat/lng values are within the acceptable values range.
|
|
176
176
|
*
|
|
177
|
-
* @param input -
|
|
178
|
-
* @returns `true` if both lat and lng are within valid ranges
|
|
177
|
+
* @param input - Point to validate.
|
|
178
|
+
* @returns `true` if both lat and lng are within valid ranges.
|
|
179
179
|
*/
|
|
180
180
|
export declare function isValidLatLngPoint(input: LatLngPoint): boolean;
|
|
181
181
|
/**
|
|
@@ -189,17 +189,17 @@ export type LonLatTuple = [Longitude, Latitude];
|
|
|
189
189
|
/**
|
|
190
190
|
* Converts the input to a {@link LatLngTuple} using the default configuration.
|
|
191
191
|
*
|
|
192
|
-
* @param lat -
|
|
193
|
-
* @param lng -
|
|
194
|
-
* @returns
|
|
192
|
+
* @param lat - A latitude value or any lat/lng point input.
|
|
193
|
+
* @param lng - Optional longitude when `lat` is a numeric latitude.
|
|
194
|
+
* @returns A `[lat, lng]` tuple.
|
|
195
195
|
*/
|
|
196
196
|
export declare function latLngTuple(lat: LatLngPointInput, lng?: Longitude): LatLngTuple;
|
|
197
197
|
/**
|
|
198
198
|
* Converts the input to a {@link LonLatTuple} (longitude-first ordering), useful for interop with libraries like Mapbox.
|
|
199
199
|
*
|
|
200
|
-
* @param lat -
|
|
201
|
-
* @param lng -
|
|
202
|
-
* @returns
|
|
200
|
+
* @param lat - A latitude value or any lat/lng point input.
|
|
201
|
+
* @param lng - Optional longitude when `lat` is a numeric latitude.
|
|
202
|
+
* @returns A `[lng, lat]` tuple.
|
|
203
203
|
*
|
|
204
204
|
* @example
|
|
205
205
|
* ```ts
|
|
@@ -217,14 +217,15 @@ export type LatLngTupleFunctionConfig = LatLngPointFunctionConfig;
|
|
|
217
217
|
* Creates a {@link LatLngTupleFunction} that converts various input formats into `[lat, lng]` tuples,
|
|
218
218
|
* applying optional precision configuration.
|
|
219
219
|
*
|
|
220
|
+
* @param config - Optional configuration for precision and wrapping behavior.
|
|
221
|
+
* @returns Produces lat/lng tuples from flexible inputs.
|
|
222
|
+
*
|
|
220
223
|
* @dbxUtil
|
|
221
224
|
* @dbxUtilCategory value
|
|
222
225
|
* @dbxUtilKind factory
|
|
223
226
|
* @dbxUtilTags value, lat-lng, tuple, factory, geographic, normalize
|
|
224
227
|
* @dbxUtilRelated lat-lng-point-function, lat-lng-string-function
|
|
225
228
|
*
|
|
226
|
-
* @param config - optional configuration for precision and wrapping behavior
|
|
227
|
-
* @returns a function that produces lat/lng tuples from flexible inputs
|
|
228
229
|
* @__NO_SIDE_EFFECTS__
|
|
229
230
|
*/
|
|
230
231
|
export declare function latLngTupleFunction(config?: LatLngTupleFunctionConfig): LatLngTupleFunction;
|
|
@@ -239,7 +240,7 @@ export declare const DEFAULT_LAT_LNG_STRING_VALUE = "0,0";
|
|
|
239
240
|
/**
|
|
240
241
|
* Returns the default {@link LatLngString} value (`'0,0'`).
|
|
241
242
|
*
|
|
242
|
-
* @returns
|
|
243
|
+
* @returns The default lat/lng string.
|
|
243
244
|
*/
|
|
244
245
|
export declare function defaultLatLngString(): typeof DEFAULT_LAT_LNG_STRING_VALUE;
|
|
245
246
|
/**
|
|
@@ -275,8 +276,8 @@ export declare const LAT_LNG_PATTERN: RegExp;
|
|
|
275
276
|
/**
|
|
276
277
|
* Checks whether the input string matches the expected lat/lng pattern (e.g., `"30.5,-96.3"`).
|
|
277
278
|
*
|
|
278
|
-
* @param input -
|
|
279
|
-
* @returns `true` if the string is a valid lat/lng format
|
|
279
|
+
* @param input - String to test.
|
|
280
|
+
* @returns `true` if the string is a valid lat/lng format.
|
|
280
281
|
*/
|
|
281
282
|
export declare function isLatLngString(input: string): input is LatLngString;
|
|
282
283
|
/**
|
|
@@ -331,15 +332,16 @@ export type LatLngPointPrecisionFunction = (latLngPoint: LatLngPoint) => LatLngP
|
|
|
331
332
|
* Creates a {@link LatLngPointPrecisionFunction} that rounds both lat and lng values
|
|
332
333
|
* to the specified number of decimal places.
|
|
333
334
|
*
|
|
335
|
+
* @param precision - Number of decimal places to retain.
|
|
336
|
+
* @param precisionRounding - Optional rounding strategy (e.g., floor, ceil, round)
|
|
337
|
+
* @returns Rounds points to the given precision.
|
|
338
|
+
*
|
|
334
339
|
* @dbxUtil
|
|
335
340
|
* @dbxUtilCategory value
|
|
336
341
|
* @dbxUtilKind factory
|
|
337
342
|
* @dbxUtilTags value, lat-lng, precision, round, factory, geographic
|
|
338
343
|
* @dbxUtilRelated lat-lng-point-function, cut-value-to-precision-function
|
|
339
344
|
*
|
|
340
|
-
* @param precision - number of decimal places to retain
|
|
341
|
-
* @param precisionRounding - optional rounding strategy (e.g., floor, ceil, round)
|
|
342
|
-
* @returns a function that rounds points to the given precision
|
|
343
345
|
* @__NO_SIDE_EFFECTS__
|
|
344
346
|
*/
|
|
345
347
|
export declare function latLngPointPrecisionFunction(precision: LatLngPrecision, precisionRounding?: RoundToPrecisionFunctionType): LatLngPointPrecisionFunction;
|
|
@@ -352,14 +354,15 @@ export type LatLngStringFunctionConfig = LatLngPointFunctionConfig;
|
|
|
352
354
|
* Creates a {@link LatLngStringFunction} that converts various input formats into comma-separated lat/lng strings,
|
|
353
355
|
* applying optional precision configuration.
|
|
354
356
|
*
|
|
357
|
+
* @param config - Optional configuration for precision and wrapping behavior.
|
|
358
|
+
* @returns Produces lat/lng strings from flexible inputs.
|
|
359
|
+
*
|
|
355
360
|
* @dbxUtil
|
|
356
361
|
* @dbxUtilCategory value
|
|
357
362
|
* @dbxUtilKind factory
|
|
358
363
|
* @dbxUtilTags value, lat-lng, string, factory, geographic, normalize
|
|
359
364
|
* @dbxUtilRelated lat-lng-point-function, lat-lng-tuple-function
|
|
360
365
|
*
|
|
361
|
-
* @param config - optional configuration for precision and wrapping behavior
|
|
362
|
-
* @returns a function that produces lat/lng strings from flexible inputs
|
|
363
366
|
* @__NO_SIDE_EFFECTS__
|
|
364
367
|
*/
|
|
365
368
|
export declare function latLngStringFunction(config?: LatLngStringFunctionConfig): LatLngStringFunction;
|
|
@@ -374,38 +377,38 @@ export interface LatLngPointFunctionConfig {
|
|
|
374
377
|
/**
|
|
375
378
|
* LatLngPrecision to use
|
|
376
379
|
*/
|
|
377
|
-
precision?: LatLngPrecision
|
|
380
|
+
readonly precision?: Maybe<LatLngPrecision>;
|
|
378
381
|
/**
|
|
379
382
|
* Precision rounding to use.
|
|
380
383
|
*/
|
|
381
|
-
precisionRounding?: RoundToPrecisionFunctionType;
|
|
384
|
+
readonly precisionRounding?: RoundToPrecisionFunctionType;
|
|
382
385
|
/**
|
|
383
386
|
* Whether or not to wrap invalid LatLng values. If false, the values are validated and a default value is used instead.
|
|
384
387
|
*
|
|
385
388
|
* Is true by default.
|
|
386
389
|
*/
|
|
387
|
-
wrap?: boolean;
|
|
390
|
+
readonly wrap?: boolean;
|
|
388
391
|
/**
|
|
389
392
|
* Whether or not to valiate the input. Is ignored if wrap is not false.
|
|
390
393
|
*/
|
|
391
|
-
validate?: boolean;
|
|
394
|
+
readonly validate?: boolean;
|
|
392
395
|
/**
|
|
393
396
|
* The default LatLngPoint to return if an invalid point is entered. Only used if validate is true.
|
|
394
397
|
*/
|
|
395
|
-
default?: Factory<LatLngPoint>;
|
|
398
|
+
readonly default?: Factory<LatLngPoint>;
|
|
396
399
|
/**
|
|
397
400
|
* Treat tuples as LonLat instead of LatLng.
|
|
398
401
|
*
|
|
399
402
|
* False by default
|
|
400
403
|
*/
|
|
401
|
-
readLonLatTuples?: boolean;
|
|
404
|
+
readonly readLonLatTuples?: boolean;
|
|
402
405
|
}
|
|
403
406
|
/**
|
|
404
407
|
* Creates a {@link LatLngPoint} using the default configuration. Convenience wrapper around {@link latLngPointFunction}.
|
|
405
408
|
*
|
|
406
|
-
* @param lat -
|
|
407
|
-
* @param lng -
|
|
408
|
-
* @returns
|
|
409
|
+
* @param lat - A latitude value or any lat/lng point input.
|
|
410
|
+
* @param lng - Optional longitude when `lat` is a numeric latitude.
|
|
411
|
+
* @returns The parsed and normalized point.
|
|
409
412
|
*
|
|
410
413
|
* @example
|
|
411
414
|
* ```ts
|
|
@@ -418,9 +421,9 @@ export declare function latLngPoint(lat: LatLngPointInput, lng?: Longitude): Lat
|
|
|
418
421
|
* Creates a {@link LatLngPointFunction} that normalizes various input formats (numbers, strings, tuples, objects)
|
|
419
422
|
* into a {@link LatLngPoint}, with configurable precision, wrapping, and validation.
|
|
420
423
|
*
|
|
421
|
-
* @param config -
|
|
422
|
-
* @returns
|
|
423
|
-
* @throws {Error}
|
|
424
|
+
* @param config - Optional configuration for precision, wrapping, validation, and tuple ordering.
|
|
425
|
+
* @returns Produces points from flexible inputs.
|
|
426
|
+
* @throws {Error} When the input cannot be parsed into a valid point.
|
|
424
427
|
*
|
|
425
428
|
* @dbxUtil
|
|
426
429
|
* @dbxUtilCategory value
|
|
@@ -434,22 +437,23 @@ export declare function latLngPoint(lat: LatLngPointInput, lng?: Longitude): Lat
|
|
|
434
437
|
* const result = fn(30.59929, -96.38315);
|
|
435
438
|
* // result.lat === 30.599, result.lng === -96.383
|
|
436
439
|
* ```
|
|
440
|
+
*
|
|
437
441
|
* @__NO_SIDE_EFFECTS__
|
|
438
442
|
*/
|
|
439
443
|
export declare function latLngPointFunction(config?: LatLngPointFunctionConfig): LatLngPointFunction;
|
|
440
444
|
/**
|
|
441
445
|
* Parses a comma-separated lat/lng string into a {@link LatLngPoint}. Invalid numeric values default to 0.
|
|
442
446
|
*
|
|
443
|
-
* @param latLngString -
|
|
444
|
-
* @returns
|
|
447
|
+
* @param latLngString - String in the format `"lat,lng"`
|
|
448
|
+
* @returns The parsed point.
|
|
445
449
|
*/
|
|
446
450
|
export declare function latLngPointFromString(latLngString: LatLngString | string): LatLngPoint;
|
|
447
451
|
/**
|
|
448
452
|
* Validates a point and returns it if valid, or a default point otherwise.
|
|
449
453
|
*
|
|
450
|
-
* @param latLngPoint -
|
|
451
|
-
* @param defaultValue -
|
|
452
|
-
* @returns
|
|
454
|
+
* @param latLngPoint - Point to validate.
|
|
455
|
+
* @param defaultValue - Optional factory for the fallback point; defaults to `defaultLatLngPoint`
|
|
456
|
+
* @returns The original point if valid, or the default.
|
|
453
457
|
*/
|
|
454
458
|
export declare function validLatLngPoint(latLngPoint: LatLngPoint, defaultValue?: Factory<LatLngPoint>): LatLngPoint;
|
|
455
459
|
/**
|
|
@@ -459,14 +463,15 @@ export type ValidLatLngPointFunction = (latLngPoint: LatLngPoint) => LatLngPoint
|
|
|
459
463
|
/**
|
|
460
464
|
* Creates a {@link ValidLatLngPointFunction} that returns the input point when valid, or a default point otherwise.
|
|
461
465
|
*
|
|
466
|
+
* @param defaultValue - Factory for the fallback point; defaults to `defaultLatLngPoint`
|
|
467
|
+
* @returns A validation function.
|
|
468
|
+
*
|
|
462
469
|
* @dbxUtil
|
|
463
470
|
* @dbxUtilCategory value
|
|
464
471
|
* @dbxUtilKind factory
|
|
465
472
|
* @dbxUtilTags value, lat-lng, validate, fallback, factory, geographic
|
|
466
473
|
* @dbxUtilRelated valid-lat-lng-point, is-valid-lat-lng-point
|
|
467
474
|
*
|
|
468
|
-
* @param defaultValue - factory for the fallback point; defaults to `defaultLatLngPoint`
|
|
469
|
-
* @returns a validation function
|
|
470
475
|
* @__NO_SIDE_EFFECTS__
|
|
471
476
|
*/
|
|
472
477
|
export declare function validLatLngPointFunction(defaultValue?: Factory<LatLngPoint>): ValidLatLngPointFunction;
|
|
@@ -511,14 +516,15 @@ export type LatLngDataPointFunction<T extends LatLngRef> = (data: T) => LatLngDa
|
|
|
511
516
|
/**
|
|
512
517
|
* Creates a {@link LatLngDataPointFunction} that wraps a {@link LatLngRef} object with its resolved point coordinates.
|
|
513
518
|
*
|
|
519
|
+
* @param config - Optional configuration for precision and wrapping behavior.
|
|
520
|
+
* @returns Produces data points from lat/lng references.
|
|
521
|
+
*
|
|
514
522
|
* @dbxUtil
|
|
515
523
|
* @dbxUtilCategory value
|
|
516
524
|
* @dbxUtilKind factory
|
|
517
525
|
* @dbxUtilTags value, lat-lng, data-point, factory, geographic, ref
|
|
518
526
|
* @dbxUtilRelated lat-lng-point-function
|
|
519
527
|
*
|
|
520
|
-
* @param config - optional configuration for precision and wrapping behavior
|
|
521
|
-
* @returns a function that produces data points from lat/lng references
|
|
522
528
|
* @__NO_SIDE_EFFECTS__
|
|
523
529
|
*/
|
|
524
530
|
export declare function latLngDataPointFunction<T extends LatLngRef>(config?: LatLngPointFunctionConfig): LatLngDataPointFunction<T>;
|
|
@@ -529,15 +535,15 @@ export interface RandomLatLngFactoryConfig {
|
|
|
529
535
|
/**
|
|
530
536
|
* South-west corner of the bounding box for random generation. Partial values default to the minimum valid coordinates.
|
|
531
537
|
*/
|
|
532
|
-
sw?: Partial<LatLngPoint>;
|
|
538
|
+
readonly sw?: Partial<LatLngPoint>;
|
|
533
539
|
/**
|
|
534
540
|
* North-east corner of the bounding box for random generation. Partial values default to the maximum valid coordinates.
|
|
535
541
|
*/
|
|
536
|
-
ne?: Partial<LatLngPoint>;
|
|
542
|
+
readonly ne?: Partial<LatLngPoint>;
|
|
537
543
|
/**
|
|
538
544
|
* Precision of the LatLng to keep.
|
|
539
545
|
*/
|
|
540
|
-
precision?: LatLngPrecision;
|
|
546
|
+
readonly precision?: LatLngPrecision;
|
|
541
547
|
}
|
|
542
548
|
/**
|
|
543
549
|
* A factory that produces random {@link LatLngPoint} values.
|
|
@@ -547,14 +553,15 @@ export type RandomLatLngFactory = () => LatLngPoint;
|
|
|
547
553
|
* Creates a {@link RandomLatLngFactory} that generates random points within the specified bounding box.
|
|
548
554
|
* The bounding box corners are capped/wrapped to valid coordinate ranges.
|
|
549
555
|
*
|
|
556
|
+
* @param config - Optional bounding box and precision configuration.
|
|
557
|
+
* @returns A factory that produces random points within the bounds.
|
|
558
|
+
*
|
|
550
559
|
* @dbxUtil
|
|
551
560
|
* @dbxUtilCategory value
|
|
552
561
|
* @dbxUtilKind factory
|
|
553
562
|
* @dbxUtilTags value, lat-lng, random, factory, geographic, bounding-box
|
|
554
563
|
* @dbxUtilRelated random-lat-lng-from-center-factory, random-number-factory
|
|
555
564
|
*
|
|
556
|
-
* @param config - optional bounding box and precision configuration
|
|
557
|
-
* @returns a factory that produces random points within the bounds
|
|
558
565
|
* @__NO_SIDE_EFFECTS__
|
|
559
566
|
*/
|
|
560
567
|
export declare function randomLatLngFactory(config?: RandomLatLngFactoryConfig): RandomLatLngFactory;
|
|
@@ -565,28 +572,29 @@ export interface RandomLatLngFromCenterFactoryConfig extends Pick<RandomLatLngFa
|
|
|
565
572
|
/**
|
|
566
573
|
* Center from which a rectangle is generated to pick random
|
|
567
574
|
*/
|
|
568
|
-
center: LatLngPoint;
|
|
575
|
+
readonly center: LatLngPoint;
|
|
569
576
|
/**
|
|
570
577
|
* Max distance from the center.
|
|
571
578
|
*/
|
|
572
|
-
latDistance: number;
|
|
579
|
+
readonly latDistance: number;
|
|
573
580
|
/**
|
|
574
581
|
* Max lng distance from the center.
|
|
575
582
|
*/
|
|
576
|
-
lngDistance: number;
|
|
583
|
+
readonly lngDistance: number;
|
|
577
584
|
}
|
|
578
585
|
/**
|
|
579
586
|
* Creates a {@link RandomLatLngFactory} that generates random points within a rectangle
|
|
580
587
|
* centered on the given point, extending by `latDistance` and `lngDistance` in each direction.
|
|
581
588
|
*
|
|
589
|
+
* @param config - Center point, distances, and optional precision.
|
|
590
|
+
* @returns A factory that produces random points near the center.
|
|
591
|
+
*
|
|
582
592
|
* @dbxUtil
|
|
583
593
|
* @dbxUtilCategory value
|
|
584
594
|
* @dbxUtilKind factory
|
|
585
595
|
* @dbxUtilTags value, lat-lng, random, factory, geographic, center
|
|
586
596
|
* @dbxUtilRelated random-lat-lng-factory, random-number-factory
|
|
587
597
|
*
|
|
588
|
-
* @param config - center point, distances, and optional precision
|
|
589
|
-
* @returns a factory that produces random points near the center
|
|
590
598
|
* @__NO_SIDE_EFFECTS__
|
|
591
599
|
*/
|
|
592
600
|
export declare function randomLatLngFromCenterFactory(config: RandomLatLngFromCenterFactoryConfig): RandomLatLngFactory;
|
package/src/lib/value/url.d.ts
CHANGED
|
@@ -3,8 +3,8 @@
|
|
|
3
3
|
*
|
|
4
4
|
* Operates via simple string splitting rather than URL parsing, so it works with partial or non-standard URLs.
|
|
5
5
|
*
|
|
6
|
-
* @param url -
|
|
7
|
-
* @returns
|
|
6
|
+
* @param url - The full URL string to clean.
|
|
7
|
+
* @returns The URL string with query parameters and hash fragments removed.
|
|
8
8
|
*
|
|
9
9
|
* @example
|
|
10
10
|
* ```ts
|
package/src/lib/value/use.d.ts
CHANGED
|
@@ -11,10 +11,10 @@ export type UseValue<I, O = void> = MapFunction<I, O>;
|
|
|
11
11
|
* Applies the `use` function to the input if it is defined, otherwise returns the `defaultValue`.
|
|
12
12
|
* Provides a safe pattern for consuming nullable values with a fallback.
|
|
13
13
|
*
|
|
14
|
-
* @param input -
|
|
15
|
-
* @param use -
|
|
16
|
-
* @param defaultValue -
|
|
17
|
-
* @returns
|
|
14
|
+
* @param input - The possibly null/undefined value to consume.
|
|
15
|
+
* @param use - Function to apply when input is defined.
|
|
16
|
+
* @param defaultValue - Fallback value or getter used when input is null/undefined.
|
|
17
|
+
* @returns The result of `use`, or the default value if input was null/undefined.
|
|
18
18
|
*
|
|
19
19
|
* @example
|
|
20
20
|
* ```ts
|
|
@@ -39,8 +39,14 @@ export type MappedUseFunction<A, I> = <O = void>(input: Maybe<A>, use: UseValue<
|
|
|
39
39
|
* Creates a {@link MappedUseFunction} that transforms the input through the given `map` before applying the consumer.
|
|
40
40
|
* If the mapped result is null/undefined, the default value is returned instead.
|
|
41
41
|
*
|
|
42
|
-
* @param map -
|
|
43
|
-
* @returns
|
|
42
|
+
* @param map - Transforms the outer input into the type expected by the consumer.
|
|
43
|
+
* @returns A MappedUseFunction that maps then consumes.
|
|
44
|
+
*
|
|
45
|
+
* @dbxUtil
|
|
46
|
+
* @dbxUtilCategory value
|
|
47
|
+
* @dbxUtilKind factory
|
|
48
|
+
* @dbxUtilTags value, use, map, factory, optional, fallback
|
|
49
|
+
* @dbxUtilRelated wrap-use-function, use-context-function
|
|
44
50
|
*
|
|
45
51
|
* @example
|
|
46
52
|
* ```ts
|
|
@@ -54,12 +60,6 @@ export type MappedUseFunction<A, I> = <O = void>(input: Maybe<A>, use: UseValue<
|
|
|
54
60
|
* // fallback === 'default'
|
|
55
61
|
* ```
|
|
56
62
|
*
|
|
57
|
-
* @dbxUtil
|
|
58
|
-
* @dbxUtilCategory value
|
|
59
|
-
* @dbxUtilKind factory
|
|
60
|
-
* @dbxUtilTags value, use, map, factory, optional, fallback
|
|
61
|
-
* @dbxUtilRelated wrap-use-function, use-context-function
|
|
62
|
-
*
|
|
63
63
|
* @__NO_SIDE_EFFECTS__
|
|
64
64
|
*/
|
|
65
65
|
export declare function mappedUseFunction<A, I>(map: MapFunction<A, Maybe<I>>): MappedUseFunction<A, I>;
|
|
@@ -67,15 +67,16 @@ export declare function mappedUseFunction<A, I>(map: MapFunction<A, Maybe<I>>):
|
|
|
67
67
|
* Wraps an existing {@link MappedUseFunction} with an additional mapping step, allowing further transformation
|
|
68
68
|
* of the intermediate value before it reaches the consumer.
|
|
69
69
|
*
|
|
70
|
+
* @param mappedUseFn - The existing mapped use function to wrap.
|
|
71
|
+
* @param map - Additional transformation applied to the intermediate value.
|
|
72
|
+
* @returns A new MappedUseFunction with the extra mapping layer.
|
|
73
|
+
*
|
|
70
74
|
* @dbxUtil
|
|
71
75
|
* @dbxUtilCategory value
|
|
72
76
|
* @dbxUtilKind factory
|
|
73
77
|
* @dbxUtilTags value, use, map, wrap, compose, factory
|
|
74
78
|
* @dbxUtilRelated mapped-use-function, use-value
|
|
75
79
|
*
|
|
76
|
-
* @param mappedUseFn - the existing mapped use function to wrap
|
|
77
|
-
* @param map - additional transformation applied to the intermediate value
|
|
78
|
-
* @returns a new MappedUseFunction with the extra mapping layer
|
|
79
80
|
* @__NO_SIDE_EFFECTS__
|
|
80
81
|
*/
|
|
81
82
|
export declare function wrapUseFunction<A, B, I>(mappedUseFn: MappedUseFunction<A, B>, map: MapFunction<B, Maybe<I>>): MappedUseFunction<A, I>;
|
|
@@ -88,15 +89,16 @@ export type UseContextFunction<I> = <O>(input: Maybe<I>) => Maybe<O>;
|
|
|
88
89
|
* Creates a {@link UseContextFunction} by binding a consumer and optional default value, so callers
|
|
89
90
|
* only need to supply the input.
|
|
90
91
|
*
|
|
92
|
+
* @param use - The consumer function to bind.
|
|
93
|
+
* @param defaultValue - Fallback when input is null/undefined.
|
|
94
|
+
* @returns A single-argument function that applies the bound consumer.
|
|
95
|
+
*
|
|
91
96
|
* @dbxUtil
|
|
92
97
|
* @dbxUtilCategory value
|
|
93
98
|
* @dbxUtilKind factory
|
|
94
99
|
* @dbxUtilTags value, use, context, factory, bind, default
|
|
95
100
|
* @dbxUtilRelated use-value, mapped-use-function
|
|
96
101
|
*
|
|
97
|
-
* @param use - the consumer function to bind
|
|
98
|
-
* @param defaultValue - fallback when input is null/undefined
|
|
99
|
-
* @returns a single-argument function that applies the bound consumer
|
|
100
102
|
* @__NO_SIDE_EFFECTS__
|
|
101
103
|
*/
|
|
102
104
|
export declare function useContextFunction<I, O>(use: UseValue<I, O>, defaultValue?: GetterOrValue<O>): UseContextFunction<I>;
|
|
@@ -107,10 +109,10 @@ export type UseAsync<I, O = void> = MapFunction<I, PromiseOrValue<O>>;
|
|
|
107
109
|
/**
|
|
108
110
|
* Async variant of {@link useValue}. Awaits the consumer result and supports async default value getters.
|
|
109
111
|
*
|
|
110
|
-
* @param input -
|
|
111
|
-
* @param use -
|
|
112
|
-
* @param defaultValue -
|
|
113
|
-
* @returns
|
|
112
|
+
* @param input - The possibly null/undefined value to consume.
|
|
113
|
+
* @param use - Async-capable consumer function.
|
|
114
|
+
* @param defaultValue - Fallback value or getter when input is null/undefined.
|
|
115
|
+
* @returns Promise resolving to the consumer result or the default value.
|
|
114
116
|
*
|
|
115
117
|
* @example
|
|
116
118
|
* ```ts
|
|
@@ -131,8 +133,14 @@ export type MappedUseAsyncFunction<A, I> = <O = void>(input: Maybe<A>, use: UseA
|
|
|
131
133
|
* Creates a {@link MappedUseAsyncFunction} that transforms the input through the given `map` (which may return a Promise)
|
|
132
134
|
* before applying the async consumer.
|
|
133
135
|
*
|
|
134
|
-
* @param map -
|
|
135
|
-
* @returns
|
|
136
|
+
* @param map - Transforms the outer input, optionally asynchronously, into the type expected by the consumer.
|
|
137
|
+
* @returns A MappedUseAsyncFunction that maps then asynchronously consumes.
|
|
138
|
+
*
|
|
139
|
+
* @dbxUtil
|
|
140
|
+
* @dbxUtilCategory value
|
|
141
|
+
* @dbxUtilKind factory
|
|
142
|
+
* @dbxUtilTags value, use, async, map, factory, promise
|
|
143
|
+
* @dbxUtilRelated wrap-use-async-function, mapped-use-function
|
|
136
144
|
*
|
|
137
145
|
* @example
|
|
138
146
|
* ```ts
|
|
@@ -143,12 +151,6 @@ export type MappedUseAsyncFunction<A, I> = <O = void>(input: Maybe<A>, use: UseA
|
|
|
143
151
|
* // result === 'hello'
|
|
144
152
|
* ```
|
|
145
153
|
*
|
|
146
|
-
* @dbxUtil
|
|
147
|
-
* @dbxUtilCategory value
|
|
148
|
-
* @dbxUtilKind factory
|
|
149
|
-
* @dbxUtilTags value, use, async, map, factory, promise
|
|
150
|
-
* @dbxUtilRelated wrap-use-async-function, mapped-use-function
|
|
151
|
-
*
|
|
152
154
|
* @__NO_SIDE_EFFECTS__
|
|
153
155
|
*/
|
|
154
156
|
export declare function mappedUseAsyncFunction<A, I>(map: MapFunction<A, Maybe<PromiseOrValue<Maybe<I>>>>): MappedUseAsyncFunction<A, I>;
|
|
@@ -156,15 +158,16 @@ export declare function mappedUseAsyncFunction<A, I>(map: MapFunction<A, Maybe<P
|
|
|
156
158
|
* Wraps an existing {@link MappedUseAsyncFunction} with an additional async-capable mapping step,
|
|
157
159
|
* allowing further transformation of the intermediate value before it reaches the consumer.
|
|
158
160
|
*
|
|
161
|
+
* @param mappedUsePromiseFn - The existing async mapped use function to wrap.
|
|
162
|
+
* @param map - Additional transformation (sync or async) applied to the intermediate value.
|
|
163
|
+
* @returns A new MappedUseAsyncFunction with the extra mapping layer.
|
|
164
|
+
*
|
|
159
165
|
* @dbxUtil
|
|
160
166
|
* @dbxUtilCategory value
|
|
161
167
|
* @dbxUtilKind factory
|
|
162
168
|
* @dbxUtilTags value, use, async, map, wrap, compose, factory, promise
|
|
163
169
|
* @dbxUtilRelated mapped-use-async-function, wrap-use-function
|
|
164
170
|
*
|
|
165
|
-
* @param mappedUsePromiseFn - the existing async mapped use function to wrap
|
|
166
|
-
* @param map - additional transformation (sync or async) applied to the intermediate value
|
|
167
|
-
* @returns a new MappedUseAsyncFunction with the extra mapping layer
|
|
168
171
|
* @__NO_SIDE_EFFECTS__
|
|
169
172
|
*/
|
|
170
173
|
export declare function wrapUseAsyncFunction<A, B, I>(mappedUsePromiseFn: MappedUseAsyncFunction<A, B>, map: MapFunction<B, Maybe<PromiseOrValue<Maybe<I>>>>): MappedUseAsyncFunction<A, I>;
|
|
@@ -16,17 +16,17 @@ export type VectorTuple = [number, number];
|
|
|
16
16
|
* If both values are non-nullish, delegates to {@link vectorsAreEqual}.
|
|
17
17
|
* If both are nullish, uses strict equality (`===`).
|
|
18
18
|
*
|
|
19
|
-
* @param a -
|
|
20
|
-
* @param b -
|
|
21
|
-
* @returns `true` if both vectors are equal or both are nullish
|
|
19
|
+
* @param a - First vector.
|
|
20
|
+
* @param b - Second vector.
|
|
21
|
+
* @returns `true` if both vectors are equal or both are nullish.
|
|
22
22
|
*/
|
|
23
23
|
export declare function isSameVector(a: Maybe<Partial<Vector>>, b: Maybe<Partial<Vector>>): boolean;
|
|
24
24
|
/**
|
|
25
25
|
* Returns `true` if both vectors have the same `x` and `y` values using strict equality.
|
|
26
26
|
*
|
|
27
|
-
* @param a -
|
|
28
|
-
* @param b -
|
|
29
|
-
* @returns `true` if both vectors have identical `x` and `y` values
|
|
27
|
+
* @param a - First vector.
|
|
28
|
+
* @param b - Second vector.
|
|
29
|
+
* @returns `true` if both vectors have identical `x` and `y` values.
|
|
30
30
|
*/
|
|
31
31
|
export declare function vectorsAreEqual(a: Partial<Vector>, b: Partial<Vector>): boolean;
|
|
32
32
|
/**
|
|
@@ -39,8 +39,8 @@ export type VectorResizeFunction = (input: Vector) => Vector;
|
|
|
39
39
|
* For each axis, if a minimum is specified, the result uses whichever value is larger (input or minimum).
|
|
40
40
|
* If a minimum is not specified for an axis, the input value is passed through unchanged.
|
|
41
41
|
*
|
|
42
|
-
* @param minSize -
|
|
43
|
-
* @returns
|
|
42
|
+
* @param minSize - The minimum dimensions to enforce.
|
|
43
|
+
* @returns A resize function that clamps each axis to the specified minimum.
|
|
44
44
|
*
|
|
45
45
|
* @dbxUtil
|
|
46
46
|
* @dbxUtilCategory value
|
|
@@ -54,6 +54,7 @@ export type VectorResizeFunction = (input: Vector) => Vector;
|
|
|
54
54
|
* resize({ x: 3, y: 10 });
|
|
55
55
|
* // { x: 5, y: 10 }
|
|
56
56
|
* ```
|
|
57
|
+
*
|
|
57
58
|
* @__NO_SIDE_EFFECTS__
|
|
58
59
|
*/
|
|
59
60
|
export declare function vectorMinimumSizeResizeFunction(minSize: Partial<Vector>): VectorResizeFunction;
|
|
@@ -87,9 +88,9 @@ export interface Rectangle {
|
|
|
87
88
|
*
|
|
88
89
|
* Degenerate rectangles (where corners coincide on an axis) are considered non-overlapping.
|
|
89
90
|
*
|
|
90
|
-
* @param a -
|
|
91
|
-
* @param b -
|
|
92
|
-
* @returns `true` if the rectangles share any interior area
|
|
91
|
+
* @param a - First rectangle.
|
|
92
|
+
* @param b - Second rectangle.
|
|
93
|
+
* @returns `true` if the rectangles share any interior area.
|
|
93
94
|
*
|
|
94
95
|
* @example
|
|
95
96
|
* ```ts
|
|
@@ -107,8 +108,8 @@ export declare function rectangleOverlapsRectangle(a: Rectangle, b: Rectangle):
|
|
|
107
108
|
* Returns the overlapping {@link Rectangle} if the two inputs intersect,
|
|
108
109
|
* or `undefined` if they do not overlap.
|
|
109
110
|
*
|
|
110
|
-
* @param a -
|
|
111
|
-
* @param b -
|
|
112
|
-
* @returns
|
|
111
|
+
* @param a - First rectangle.
|
|
112
|
+
* @param b - Second rectangle.
|
|
113
|
+
* @returns The overlapping {@link Rectangle}, or `undefined` if the rectangles do not intersect.
|
|
113
114
|
*/
|
|
114
115
|
export declare function getOverlappingRectangle(a: Rectangle, b: Rectangle): Maybe<Rectangle>;
|