@latex-kit/schema 0.0.0-stage → 0.3.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/LICENSE +23 -0
- package/README.md +106 -2
- package/docid.d.ts +19 -0
- package/docid.js +71 -0
- package/esm/docid.d.ts +19 -0
- package/esm/docid.js +65 -0
- package/esm/index.d.ts +7 -0
- package/esm/index.js +7 -0
- package/esm/load.d.ts +15 -0
- package/esm/load.js +66 -0
- package/esm/record.d.ts +25 -0
- package/esm/record.js +31 -0
- package/esm/ref.d.ts +26 -0
- package/esm/ref.js +79 -0
- package/esm/schema.d.ts +36 -0
- package/esm/schema.js +55 -0
- package/esm/types.d.ts +88 -0
- package/esm/types.js +49 -0
- package/index.d.ts +7 -0
- package/index.js +25 -0
- package/load.d.ts +15 -0
- package/load.js +73 -0
- package/package.json +46 -4
- package/record.d.ts +25 -0
- package/record.js +36 -0
- package/ref.d.ts +26 -0
- package/ref.js +87 -0
- package/schema.d.ts +36 -0
- package/schema.js +63 -0
- package/types.d.ts +88 -0
- package/types.js +52 -0
package/types.d.ts
ADDED
|
@@ -0,0 +1,88 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
/** A calendar date, `2026-11-25`. Use with the `date` filter. */
|
|
3
|
+
export declare const ISODate: z.ZodString;
|
|
4
|
+
/** An amount and an ISO 4217 currency code. Use with the `money` filter. */
|
|
5
|
+
export declare const Money: z.ZodObject<{
|
|
6
|
+
amount: z.ZodNumber;
|
|
7
|
+
currency: z.ZodString;
|
|
8
|
+
}, z.core.$strip>;
|
|
9
|
+
export declare const Address: z.ZodObject<{
|
|
10
|
+
line1: z.ZodString;
|
|
11
|
+
line2: z.ZodOptional<z.ZodString>;
|
|
12
|
+
city: z.ZodString;
|
|
13
|
+
region: z.ZodOptional<z.ZodString>;
|
|
14
|
+
postalCode: z.ZodOptional<z.ZodString>;
|
|
15
|
+
country: z.ZodOptional<z.ZodString>;
|
|
16
|
+
}, z.core.$strip>;
|
|
17
|
+
/** Someone who signs: a name and, usually, a title. */
|
|
18
|
+
export declare const Signer: z.ZodObject<{
|
|
19
|
+
name: z.ZodString;
|
|
20
|
+
title: z.ZodOptional<z.ZodString>;
|
|
21
|
+
email: z.ZodOptional<z.ZodString>;
|
|
22
|
+
}, z.core.$strip>;
|
|
23
|
+
export declare const Person: z.ZodObject<{
|
|
24
|
+
name: z.ZodString;
|
|
25
|
+
title: z.ZodOptional<z.ZodString>;
|
|
26
|
+
email: z.ZodOptional<z.ZodString>;
|
|
27
|
+
address: z.ZodOptional<z.ZodObject<{
|
|
28
|
+
line1: z.ZodString;
|
|
29
|
+
line2: z.ZodOptional<z.ZodString>;
|
|
30
|
+
city: z.ZodString;
|
|
31
|
+
region: z.ZodOptional<z.ZodString>;
|
|
32
|
+
postalCode: z.ZodOptional<z.ZodString>;
|
|
33
|
+
country: z.ZodOptional<z.ZodString>;
|
|
34
|
+
}, z.core.$strip>>;
|
|
35
|
+
}, z.core.$strip>;
|
|
36
|
+
export declare const Organization: z.ZodObject<{
|
|
37
|
+
name: z.ZodString;
|
|
38
|
+
entityType: z.ZodOptional<z.ZodString>;
|
|
39
|
+
jurisdiction: z.ZodOptional<z.ZodString>;
|
|
40
|
+
address: z.ZodOptional<z.ZodObject<{
|
|
41
|
+
line1: z.ZodString;
|
|
42
|
+
line2: z.ZodOptional<z.ZodString>;
|
|
43
|
+
city: z.ZodString;
|
|
44
|
+
region: z.ZodOptional<z.ZodString>;
|
|
45
|
+
postalCode: z.ZodOptional<z.ZodString>;
|
|
46
|
+
country: z.ZodOptional<z.ZodString>;
|
|
47
|
+
}, z.core.$strip>>;
|
|
48
|
+
signer: z.ZodOptional<z.ZodObject<{
|
|
49
|
+
name: z.ZodString;
|
|
50
|
+
title: z.ZodOptional<z.ZodString>;
|
|
51
|
+
email: z.ZodOptional<z.ZodString>;
|
|
52
|
+
}, z.core.$strip>>;
|
|
53
|
+
}, z.core.$strip>;
|
|
54
|
+
/** One side of an agreement: a person or an organization. */
|
|
55
|
+
export declare const Party: z.ZodObject<{
|
|
56
|
+
kind: z.ZodOptional<z.ZodEnum<{
|
|
57
|
+
person: "person";
|
|
58
|
+
organization: "organization";
|
|
59
|
+
}>>;
|
|
60
|
+
name: z.ZodString;
|
|
61
|
+
entityType: z.ZodOptional<z.ZodString>;
|
|
62
|
+
jurisdiction: z.ZodOptional<z.ZodString>;
|
|
63
|
+
title: z.ZodOptional<z.ZodString>;
|
|
64
|
+
email: z.ZodOptional<z.ZodString>;
|
|
65
|
+
address: z.ZodOptional<z.ZodObject<{
|
|
66
|
+
line1: z.ZodString;
|
|
67
|
+
line2: z.ZodOptional<z.ZodString>;
|
|
68
|
+
city: z.ZodString;
|
|
69
|
+
region: z.ZodOptional<z.ZodString>;
|
|
70
|
+
postalCode: z.ZodOptional<z.ZodString>;
|
|
71
|
+
country: z.ZodOptional<z.ZodString>;
|
|
72
|
+
}, z.core.$strip>>;
|
|
73
|
+
signer: z.ZodOptional<z.ZodObject<{
|
|
74
|
+
name: z.ZodString;
|
|
75
|
+
title: z.ZodOptional<z.ZodString>;
|
|
76
|
+
email: z.ZodOptional<z.ZodString>;
|
|
77
|
+
}, z.core.$strip>>;
|
|
78
|
+
}, z.core.$strip>;
|
|
79
|
+
/** Text in several languages, keyed by language tag: `{ en: "…", ja: "…" }`. */
|
|
80
|
+
export declare const Localized: z.ZodRecord<z.ZodString, z.ZodString>;
|
|
81
|
+
export type ISODate = z.infer<typeof ISODate>;
|
|
82
|
+
export type Money = z.infer<typeof Money>;
|
|
83
|
+
export type Address = z.infer<typeof Address>;
|
|
84
|
+
export type Signer = z.infer<typeof Signer>;
|
|
85
|
+
export type Person = z.infer<typeof Person>;
|
|
86
|
+
export type Organization = z.infer<typeof Organization>;
|
|
87
|
+
export type Party = z.infer<typeof Party>;
|
|
88
|
+
export type Localized = z.infer<typeof Localized>;
|
package/types.js
ADDED
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.Localized = exports.Party = exports.Organization = exports.Person = exports.Signer = exports.Address = exports.Money = exports.ISODate = void 0;
|
|
4
|
+
const zod_1 = require("zod");
|
|
5
|
+
/** A calendar date, `2026-11-25`. Use with the `date` filter. */
|
|
6
|
+
exports.ISODate = zod_1.z.string().regex(/^\d{4}-\d{2}-\d{2}$/, 'expected a date like 2026-11-25');
|
|
7
|
+
/** An amount and an ISO 4217 currency code. Use with the `money` filter. */
|
|
8
|
+
exports.Money = zod_1.z.object({
|
|
9
|
+
amount: zod_1.z.number(),
|
|
10
|
+
currency: zod_1.z.string().regex(/^[A-Z]{3}$/, 'expected a currency code like USD'),
|
|
11
|
+
});
|
|
12
|
+
exports.Address = zod_1.z.object({
|
|
13
|
+
line1: zod_1.z.string(),
|
|
14
|
+
line2: zod_1.z.string().optional(),
|
|
15
|
+
city: zod_1.z.string(),
|
|
16
|
+
region: zod_1.z.string().optional(),
|
|
17
|
+
postalCode: zod_1.z.string().optional(),
|
|
18
|
+
country: zod_1.z.string().optional(),
|
|
19
|
+
});
|
|
20
|
+
/** Someone who signs: a name and, usually, a title. */
|
|
21
|
+
exports.Signer = zod_1.z.object({
|
|
22
|
+
name: zod_1.z.string(),
|
|
23
|
+
title: zod_1.z.string().optional(),
|
|
24
|
+
email: zod_1.z.string().optional(),
|
|
25
|
+
});
|
|
26
|
+
exports.Person = zod_1.z.object({
|
|
27
|
+
name: zod_1.z.string(),
|
|
28
|
+
title: zod_1.z.string().optional(),
|
|
29
|
+
email: zod_1.z.string().optional(),
|
|
30
|
+
address: exports.Address.optional(),
|
|
31
|
+
});
|
|
32
|
+
exports.Organization = zod_1.z.object({
|
|
33
|
+
name: zod_1.z.string(),
|
|
34
|
+
/** e.g. "Delaware corporation", "Kabushiki Kaisha" */
|
|
35
|
+
entityType: zod_1.z.string().optional(),
|
|
36
|
+
jurisdiction: zod_1.z.string().optional(),
|
|
37
|
+
address: exports.Address.optional(),
|
|
38
|
+
signer: exports.Signer.optional(),
|
|
39
|
+
});
|
|
40
|
+
/** One side of an agreement: a person or an organization. */
|
|
41
|
+
exports.Party = zod_1.z.object({
|
|
42
|
+
kind: zod_1.z.enum(['person', 'organization']).optional(),
|
|
43
|
+
name: zod_1.z.string(),
|
|
44
|
+
entityType: zod_1.z.string().optional(),
|
|
45
|
+
jurisdiction: zod_1.z.string().optional(),
|
|
46
|
+
title: zod_1.z.string().optional(),
|
|
47
|
+
email: zod_1.z.string().optional(),
|
|
48
|
+
address: exports.Address.optional(),
|
|
49
|
+
signer: exports.Signer.optional(),
|
|
50
|
+
});
|
|
51
|
+
/** Text in several languages, keyed by language tag: `{ en: "…", ja: "…" }`. */
|
|
52
|
+
exports.Localized = zod_1.z.record(zod_1.z.string(), zod_1.z.string());
|