@manyducks.co/dolla 0.69.4 → 0.69.5
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/lib/app.d.ts +0 -3
- package/lib/index.js +111 -137
- package/lib/index.js.map +4 -4
- package/lib/routing.d.ts +4 -4
- package/lib/stores/language.d.ts +2 -2
- package/lib/stores/router.d.ts +1 -1
- package/lib/views/default-crash-page.d.ts +7 -0
- package/lib/views/default-view.d.ts +2 -0
- package/package.json +1 -1
package/lib/routing.d.ts
CHANGED
|
@@ -31,13 +31,13 @@ export type RouteFragment = {
|
|
|
31
31
|
type: FragTypes;
|
|
32
32
|
value: string | number | null;
|
|
33
33
|
};
|
|
34
|
-
export type
|
|
34
|
+
export type ParsedRoute<T> = {
|
|
35
35
|
pattern: string;
|
|
36
36
|
fragments: RouteFragment[];
|
|
37
37
|
meta: T;
|
|
38
38
|
};
|
|
39
39
|
export type RouteMatchOptions<T> = {
|
|
40
|
-
willMatch?: (route:
|
|
40
|
+
willMatch?: (route: ParsedRoute<T>) => boolean;
|
|
41
41
|
};
|
|
42
42
|
/**
|
|
43
43
|
* Separates a URL path into multiple fragments.
|
|
@@ -63,14 +63,14 @@ export declare function parseQueryParams(query: string): Record<string, string |
|
|
|
63
63
|
* @param url - Path to match against routes.
|
|
64
64
|
* @param options - Options to customize how matching operates.
|
|
65
65
|
*/
|
|
66
|
-
export declare function matchRoutes<T>(routes:
|
|
66
|
+
export declare function matchRoutes<T>(routes: ParsedRoute<T>[], url: string, options?: RouteMatchOptions<T>): RouteMatch<T> | undefined;
|
|
67
67
|
/**
|
|
68
68
|
* Sort routes descending by specificity. Guarantees that the most specific route matches first
|
|
69
69
|
* no matter the order in which they were added.
|
|
70
70
|
*
|
|
71
71
|
* Routes without named params and routes with more fragments are weighted more heavily.
|
|
72
72
|
*/
|
|
73
|
-
export declare function sortRoutes<T>(routes:
|
|
73
|
+
export declare function sortRoutes<T>(routes: ParsedRoute<T>[]): ParsedRoute<T>[];
|
|
74
74
|
/**
|
|
75
75
|
* Converts a route pattern into a set of matchable fragments.
|
|
76
76
|
*
|
package/lib/stores/language.d.ts
CHANGED
|
@@ -17,13 +17,13 @@ type LanguageOptions = {
|
|
|
17
17
|
/**
|
|
18
18
|
* Default language to load on startup
|
|
19
19
|
*/
|
|
20
|
-
|
|
20
|
+
defaultLanguage?: string;
|
|
21
21
|
};
|
|
22
22
|
export declare function LanguageStore(ctx: StoreContext<LanguageOptions>): {
|
|
23
23
|
$isLoaded: Readable<boolean>;
|
|
24
24
|
$currentLanguage: Readable<string | undefined>;
|
|
25
25
|
supportedLanguages: string[];
|
|
26
|
-
setLanguage(tag: string)
|
|
26
|
+
setLanguage: (tag: string) => Promise<void>;
|
|
27
27
|
/**
|
|
28
28
|
* Returns a Readable of the translated value.
|
|
29
29
|
|
package/lib/stores/router.d.ts
CHANGED
|
@@ -2,7 +2,7 @@ import { type History } from "history";
|
|
|
2
2
|
import { type Markup } from "../markup.js";
|
|
3
3
|
import { type StoreContext } from "../store.js";
|
|
4
4
|
import { type Stringable } from "../types.js";
|
|
5
|
-
import { View } from "../view.js";
|
|
5
|
+
import { type View } from "../view.js";
|
|
6
6
|
export interface Route {
|
|
7
7
|
path: string;
|
|
8
8
|
redirect?: string;
|