@tempots/ui 10.0.0 → 10.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.
- package/index.cjs +1 -1
- package/index.js +881 -852
- package/package.json +1 -1
- package/renderables/router/location.d.ts +29 -1
package/package.json
CHANGED
|
@@ -1,7 +1,27 @@
|
|
|
1
|
-
import { Provider, Signal } from '@tempots/dom';
|
|
1
|
+
import { Provider, Signal, Value } from '@tempots/dom';
|
|
2
2
|
import { LocationData } from './location-data';
|
|
3
3
|
import { NavigationOptions } from './navigation-options';
|
|
4
4
|
export type { NavigationOptions } from './navigation-options';
|
|
5
|
+
/**
|
|
6
|
+
* Options that control how `LocationHandle.match` and `matchSignal` interpret URL parts.
|
|
7
|
+
*
|
|
8
|
+
* @public
|
|
9
|
+
*/
|
|
10
|
+
export type LocationMatchOptions = {
|
|
11
|
+
/**
|
|
12
|
+
* Whether the search parameters should participate in the match. Defaults to `true`.
|
|
13
|
+
*/
|
|
14
|
+
includeSearch?: boolean;
|
|
15
|
+
/**
|
|
16
|
+
* Whether the hash fragment should participate in the match. Defaults to `true`.
|
|
17
|
+
*/
|
|
18
|
+
includeHash?: boolean;
|
|
19
|
+
/**
|
|
20
|
+
* Keys that should be ignored when comparing search parameters.
|
|
21
|
+
*/
|
|
22
|
+
ignoreSearchParams?: string[];
|
|
23
|
+
};
|
|
24
|
+
export declare const evaluateLocationMatch: (location: LocationData, matcher: string | RegExp | ((location: LocationData) => boolean), options: LocationMatchOptions | undefined) => boolean;
|
|
5
25
|
/**
|
|
6
26
|
* A read/write navigation handle exposed by the Location provider.
|
|
7
27
|
*
|
|
@@ -88,6 +108,14 @@ export type LocationHandle = {
|
|
|
88
108
|
* Runs mutations against a draft copy and commits once after the callback finishes.
|
|
89
109
|
*/
|
|
90
110
|
run: (mutate: (draft: LocationDraft) => void, options?: NavigationOptions) => void;
|
|
111
|
+
/**
|
|
112
|
+
* Evaluates whether the current location matches the provided matcher, honouring match options.
|
|
113
|
+
*/
|
|
114
|
+
match: (matcher: string | RegExp | ((location: LocationData) => boolean), options?: LocationMatchOptions) => boolean;
|
|
115
|
+
/**
|
|
116
|
+
* Returns a reactive signal that mirrors the result of `match`.
|
|
117
|
+
*/
|
|
118
|
+
matchSignal: (matcher: Value<string | RegExp | ((location: LocationData) => boolean)>, options?: LocationMatchOptions) => Signal<boolean>;
|
|
91
119
|
};
|
|
92
120
|
/**
|
|
93
121
|
* Draft object provided inside `LocationHandle.run` for staged updates.
|