@zh-xx/antu 0.10.0 → 0.11.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 +8 -0
- package/assets/viewer.html +55 -55
- package/bin/antu-mcp.mjs +58 -58
- package/bin/antu.mjs +55 -55
- package/embed/antu-embed.d.ts +84 -0
- package/embed/antu-embed.js +80836 -0
- package/examples/fact/gym-membership-face-scan.en.json +14 -14
- package/examples/fact/gym-membership-face-scan.zh-CN.json +14 -14
- package/examples/raw//357/274/2102031/357/274/211/347/244/272/346/260/221/345/210/2352/345/217/267-/345/201/245/350/272/253/346/210/277/345/210/267/350/204/270/345/205/245/345/234/272/346/241/210-/344/270/200/345/256/241.md +1 -1
- package/lib/chunks/report-BV3j2cS_.mjs +1462 -0
- package/lib/html.d.ts +9 -0
- package/lib/html.mjs +1425 -0
- package/lib/validate.d.ts +29 -0
- package/lib/validate.mjs +1425 -0
- package/package.json +17 -2
- package/server.json +2 -2
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
// Declarations of `@zh-xx/antu/validate` (tools/api/validate.mjs). The contract is in spec/embed.md;
|
|
2
|
+
// test/embed.test.mjs checks that every function the module exports is declared here and nothing else.
|
|
3
|
+
|
|
4
|
+
export interface ValidateResult {
|
|
5
|
+
ok: boolean
|
|
6
|
+
/** Each names its field, e.g. `nodes[2] (n-3): \`kind\` is "bogus", …` */
|
|
7
|
+
errors: string[]
|
|
8
|
+
/** Not errors, but the author should see them; only when there are no errors */
|
|
9
|
+
notes: string[]
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
export type LayoutResult =
|
|
13
|
+
| ({ ok: true; type: string; kind: string; text: string } & Record<string, unknown>)
|
|
14
|
+
| { ok: false; reason: string; errors?: string[] }
|
|
15
|
+
|
|
16
|
+
export interface VersionsReport {
|
|
17
|
+
release: string
|
|
18
|
+
types: Array<{
|
|
19
|
+
type: string
|
|
20
|
+
specVersion: number
|
|
21
|
+
diagrams: Array<{ kind: string; version: number; status: 'experimental' | 'stable' | 'deprecated'; since: string }>
|
|
22
|
+
}>
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
export function validate(spec: unknown): ValidateResult
|
|
26
|
+
export function layout(spec: unknown, options?: { kind?: string; orientation?: 'vertical' | 'horizontal' }): LayoutResult
|
|
27
|
+
/** Each type and its kinds, the first kind being the one a diagram opens in */
|
|
28
|
+
export function kinds(): Record<string, string[]>
|
|
29
|
+
export function versions(): VersionsReport
|