@ic-reactor/candid 3.0.13-beta.0 → 3.0.14-beta.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/README.md +28 -0
- package/dist/visitor/arguments/helpers.d.ts +5 -5
- package/dist/visitor/arguments/helpers.d.ts.map +1 -1
- package/dist/visitor/arguments/helpers.js.map +1 -1
- package/dist/visitor/arguments/index.d.ts +12 -2
- package/dist/visitor/arguments/index.d.ts.map +1 -1
- package/dist/visitor/arguments/index.js +136 -12
- package/dist/visitor/arguments/index.js.map +1 -1
- package/dist/visitor/arguments/types.d.ts +112 -359
- package/dist/visitor/arguments/types.d.ts.map +1 -1
- package/dist/visitor/returns/types.d.ts +3 -4
- package/dist/visitor/returns/types.d.ts.map +1 -1
- package/dist/visitor/types.d.ts +14 -0
- package/dist/visitor/types.d.ts.map +1 -1
- package/package.json +2 -2
- package/src/visitor/arguments/helpers.ts +5 -5
- package/src/visitor/arguments/index.test.ts +43 -22
- package/src/visitor/arguments/index.ts +167 -32
- package/src/visitor/arguments/schema.test.ts +114 -4
- package/src/visitor/arguments/types.ts +178 -444
- package/src/visitor/returns/types.ts +4 -27
- package/src/visitor/types.ts +45 -0
|
@@ -4,25 +4,15 @@ import type {
|
|
|
4
4
|
FunctionType,
|
|
5
5
|
ActorMethodReturnType,
|
|
6
6
|
} from "@ic-reactor/core"
|
|
7
|
+
import type { VisitorDataType, TextFormat, NumberFormat } from "../types"
|
|
8
|
+
|
|
9
|
+
export type { TextFormat, NumberFormat }
|
|
7
10
|
|
|
8
11
|
// ════════════════════════════════════════════════════════════════════════════
|
|
9
12
|
// Core Types & Formats
|
|
10
13
|
// ════════════════════════════════════════════════════════════════════════════
|
|
11
14
|
|
|
12
|
-
export type NodeType =
|
|
13
|
-
| "record"
|
|
14
|
-
| "variant"
|
|
15
|
-
| "tuple"
|
|
16
|
-
| "optional"
|
|
17
|
-
| "vector"
|
|
18
|
-
| "blob"
|
|
19
|
-
| "recursive"
|
|
20
|
-
| "principal"
|
|
21
|
-
| "number"
|
|
22
|
-
| "text"
|
|
23
|
-
| "boolean"
|
|
24
|
-
| "null"
|
|
25
|
-
| "unknown"
|
|
15
|
+
export type NodeType = VisitorDataType
|
|
26
16
|
|
|
27
17
|
export type DisplayType =
|
|
28
18
|
| "string"
|
|
@@ -38,19 +28,6 @@ export type DisplayType =
|
|
|
38
28
|
| "blob"
|
|
39
29
|
| "unknown"
|
|
40
30
|
|
|
41
|
-
export type NumberFormat = "timestamp" | "cycle" | "value" | "token" | "normal"
|
|
42
|
-
export type TextFormat =
|
|
43
|
-
| "plain"
|
|
44
|
-
| "timestamp"
|
|
45
|
-
| "uuid"
|
|
46
|
-
| "url"
|
|
47
|
-
| "email"
|
|
48
|
-
| "phone"
|
|
49
|
-
| "btc"
|
|
50
|
-
| "eth"
|
|
51
|
-
| "account-id"
|
|
52
|
-
| "principal"
|
|
53
|
-
|
|
54
31
|
// ════════════════════════════════════════════════════════════════════════════
|
|
55
32
|
// Unified Result Node - Single Structure for Schema & Resolved Data
|
|
56
33
|
// ════════════════════════════════════════════════════════════════════════════
|
package/src/visitor/types.ts
CHANGED
|
@@ -26,3 +26,48 @@ export type AllNumberTypes =
|
|
|
26
26
|
| IDL.FixedNatClass
|
|
27
27
|
| IDL.FixedIntClass
|
|
28
28
|
| IDL.FloatClass
|
|
29
|
+
|
|
30
|
+
// ════════════════════════════════════════════════════════════════════════════
|
|
31
|
+
// Shared Types for Visitors (Arguments & Returns)
|
|
32
|
+
// ════════════════════════════════════════════════════════════════════════════
|
|
33
|
+
|
|
34
|
+
/**
|
|
35
|
+
* The core Candid type category used across visitors.
|
|
36
|
+
*/
|
|
37
|
+
export type VisitorDataType =
|
|
38
|
+
| "record"
|
|
39
|
+
| "variant"
|
|
40
|
+
| "tuple"
|
|
41
|
+
| "optional"
|
|
42
|
+
| "vector"
|
|
43
|
+
| "blob"
|
|
44
|
+
| "recursive"
|
|
45
|
+
| "principal"
|
|
46
|
+
| "number"
|
|
47
|
+
| "text"
|
|
48
|
+
| "boolean"
|
|
49
|
+
| "null"
|
|
50
|
+
| "unknown"
|
|
51
|
+
|
|
52
|
+
/**
|
|
53
|
+
* Detected format for text fields based on label heuristics.
|
|
54
|
+
* Used to provide format-specific validation and display.
|
|
55
|
+
*/
|
|
56
|
+
export type TextFormat =
|
|
57
|
+
| "plain"
|
|
58
|
+
| "timestamp"
|
|
59
|
+
| "uuid"
|
|
60
|
+
| "url"
|
|
61
|
+
| "email"
|
|
62
|
+
| "phone"
|
|
63
|
+
| "btc"
|
|
64
|
+
| "eth"
|
|
65
|
+
| "account-id"
|
|
66
|
+
| "principal"
|
|
67
|
+
| "cycle"
|
|
68
|
+
|
|
69
|
+
/**
|
|
70
|
+
* Detected format for number fields based on label heuristics.
|
|
71
|
+
* Used to provide format-specific validation and display.
|
|
72
|
+
*/
|
|
73
|
+
export type NumberFormat = "timestamp" | "cycle" | "value" | "token" | "normal"
|