@manyducks.co/dolla 0.74.0 → 0.75.1

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.
@@ -24,7 +24,7 @@ export declare class HTML implements DOMHandle {
24
24
  setChildren(next: DOMHandle[]): void;
25
25
  getUpdateKey(type: string, value: string | number): string;
26
26
  applyProps(element: HTMLElement | SVGElement, props: Record<string, unknown>): void;
27
- applyStyles(element: HTMLElement | SVGElement, styles: Record<string, any>, stopCallbacks: StopFunction[]): () => void;
27
+ applyStyles(element: HTMLElement | SVGElement, styles: string | Record<string, any>, stopCallbacks: StopFunction[]): () => void;
28
28
  applyClasses(element: HTMLElement | SVGElement, classes: unknown, stopCallbacks: StopFunction[]): () => void;
29
29
  }
30
30
  export {};
@@ -23,9 +23,9 @@ export interface Route {
23
23
  */
24
24
  path: string;
25
25
  /**
26
- * Path to redirect to when this route is matched.
26
+ * Path to redirect to when this route is matched, or a callback function that returns such path.
27
27
  */
28
- redirect?: string;
28
+ redirect?: string | ((ctx: RouteRedirectContext) => string) | ((ctx: RouteRedirectContext) => Promise<string>);
29
29
  /**
30
30
  * View to display when this route is matched.
31
31
  */
@@ -42,7 +42,7 @@ export interface Route {
42
42
  export interface RouteConfig {
43
43
  pattern: string;
44
44
  meta: {
45
- redirect?: string | ((ctx: RedirectContext) => void);
45
+ redirect?: string | ((ctx: RouteRedirectContext) => string) | ((ctx: RouteRedirectContext) => Promise<string>);
46
46
  pattern?: string;
47
47
  layers?: RouteLayer[];
48
48
  beforeMatch?: (ctx: RouteMatchContext) => void | Promise<void>;
@@ -53,9 +53,9 @@ export interface RouteLayer {
53
53
  markup: Markup;
54
54
  }
55
55
  /**
56
- * Properties passed to a redirect function.
56
+ * Object passed to redirect callbacks. Contains information useful for determining how to redirect.
57
57
  */
58
- export interface RedirectContext {
58
+ export interface RouteRedirectContext {
59
59
  /**
60
60
  * The path as it appears in the URL bar.
61
61
  */
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@manyducks.co/dolla",
3
- "version": "0.74.0",
3
+ "version": "0.75.1",
4
4
  "description": "Front-end components, routing and state management.",
5
5
  "main": "lib/index.js",
6
6
  "types": "./index.d.ts",