march-hare 0.13.5 → 0.13.8
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/dist/types/index.d.ts
CHANGED
|
@@ -1,10 +1,31 @@
|
|
|
1
|
-
import { Operation, Process, Inspect, Box } from 'immertation';
|
|
1
|
+
import { Operation, Process, Inspect as ImmInspect, Box } from 'immertation';
|
|
2
2
|
import { ActionId, Task, Tasks } from '../boundary/components/tasks/types.js';
|
|
3
3
|
import { Fault } from '../error/types.js';
|
|
4
4
|
import { Env } from '../boundary/components/env/types.js';
|
|
5
5
|
import { Coalesce, Invocation } from '../resource/types.js';
|
|
6
6
|
import { WithHandle } from '../with/types.js';
|
|
7
7
|
import * as React from "react";
|
|
8
|
+
/**
|
|
9
|
+
* Bounded recursion depths for {@link Inspect}. Matches Immertation's
|
|
10
|
+
* `DepthLimiter` shape so the two stay in lock-step.
|
|
11
|
+
*/
|
|
12
|
+
type DepthLimiter = [never, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12];
|
|
13
|
+
/** Union of all keys across each arm of `T`. */
|
|
14
|
+
type UnionKeys<T> = T extends T ? keyof T : never;
|
|
15
|
+
/** The value at `K` for each arm of `T`, falling back to `undefined` if `K` is absent on that arm. */
|
|
16
|
+
type ValueAt<T, K extends PropertyKey> = T extends T ? K extends keyof T ? T[K] : undefined : never;
|
|
17
|
+
/**
|
|
18
|
+
* March-hare's `Inspect<T>` wraps Immertation's so that property
|
|
19
|
+
* navigation works when `T` is a discriminated union (e.g. the App's
|
|
20
|
+
* Env union). For each key that appears on **any** union arm, the
|
|
21
|
+
* resulting Inspect is `Inspect<ValueAt<T, K>>` — arms missing
|
|
22
|
+
* the key contribute `undefined`, so optional chaining stays sound.
|
|
23
|
+
*
|
|
24
|
+
* For a single concrete `T`, the wrapper is transparent.
|
|
25
|
+
*/
|
|
26
|
+
export type Inspect<T, D extends number = 12> = ImmInspect<T> & ([D] extends [0] ? object : {
|
|
27
|
+
[K in UnionKeys<T> as ValueAt<T, K> extends (...args: unknown[]) => unknown ? never : K]: Inspect<ValueAt<T, K>, DepthLimiter[D]>;
|
|
28
|
+
});
|
|
8
29
|
/**
|
|
9
30
|
* Chainable handle returned from `context.actions.resource(invocation)`.
|
|
10
31
|
*
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "march-hare",
|
|
3
|
-
"version": "0.13.
|
|
3
|
+
"version": "0.13.8",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"packageManager": "yarn@1.22.22",
|
|
@@ -24,7 +24,7 @@
|
|
|
24
24
|
"figlet": "^1.7.0",
|
|
25
25
|
"find-up": "^8.0.0",
|
|
26
26
|
"gray-matter": "^4.0.3",
|
|
27
|
-
"immertation": "^0.1.
|
|
27
|
+
"immertation": "^0.1.31",
|
|
28
28
|
"kleur": "^4.1.5",
|
|
29
29
|
"tinyglobby": "^0.2.17"
|
|
30
30
|
},
|