@nativemason/contracts 0.2.0 → 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.
@@ -1,74 +1,37 @@
1
1
  import { z } from 'zod';
2
- export declare const ContrastEvidenceSchema: z.ZodEffects<z.ZodObject<{
3
- status: z.ZodEnum<["measured", "unavailable"]>;
2
+ export declare const ContrastEvidenceSchema: z.ZodObject<{
3
+ status: z.ZodEnum<{
4
+ measured: "measured";
5
+ unavailable: "unavailable";
6
+ }>;
4
7
  ratio: z.ZodOptional<z.ZodNumber>;
5
8
  requiredRatio: z.ZodOptional<z.ZodNumber>;
6
9
  reason: z.ZodOptional<z.ZodString>;
7
- }, "strict", z.ZodTypeAny, {
8
- status: "measured" | "unavailable";
9
- ratio?: number | undefined;
10
- requiredRatio?: number | undefined;
11
- reason?: string | undefined;
12
- }, {
13
- status: "measured" | "unavailable";
14
- ratio?: number | undefined;
15
- requiredRatio?: number | undefined;
16
- reason?: string | undefined;
17
- }>, {
18
- status: "measured" | "unavailable";
19
- ratio?: number | undefined;
20
- requiredRatio?: number | undefined;
21
- reason?: string | undefined;
22
- }, {
23
- status: "measured" | "unavailable";
24
- ratio?: number | undefined;
25
- requiredRatio?: number | undefined;
26
- reason?: string | undefined;
27
- }>;
10
+ }, z.core.$strict>;
28
11
  export declare const BrowserAccessibilitySampleSchema: z.ZodObject<{
29
- direction: z.ZodEnum<["ltr", "rtl", "unknown"]>;
12
+ direction: z.ZodEnum<{
13
+ unknown: "unknown";
14
+ ltr: "ltr";
15
+ rtl: "rtl";
16
+ }>;
30
17
  focusOrder: z.ZodNullable<z.ZodNumber>;
31
18
  foreground: z.ZodNullable<z.ZodTuple<[z.ZodNumber, z.ZodNumber, z.ZodNumber], null>>;
32
19
  background: z.ZodNullable<z.ZodTuple<[z.ZodNumber, z.ZodNumber, z.ZodNumber], null>>;
33
20
  requiredRatio: z.ZodNumber;
34
21
  contrastReason: z.ZodNullable<z.ZodString>;
35
- }, "strict", z.ZodTypeAny, {
36
- requiredRatio: number;
37
- direction: "unknown" | "ltr" | "rtl";
38
- focusOrder: number | null;
39
- foreground: [number, number, number] | null;
40
- background: [number, number, number] | null;
41
- contrastReason: string | null;
42
- }, {
43
- requiredRatio: number;
44
- direction: "unknown" | "ltr" | "rtl";
45
- focusOrder: number | null;
46
- foreground: [number, number, number] | null;
47
- background: [number, number, number] | null;
48
- contrastReason: string | null;
49
- }>;
22
+ }, z.core.$strict>;
50
23
  export declare const BrowserAccessibilitySamplesSchema: z.ZodRecord<z.ZodString, z.ZodObject<{
51
- direction: z.ZodEnum<["ltr", "rtl", "unknown"]>;
24
+ direction: z.ZodEnum<{
25
+ unknown: "unknown";
26
+ ltr: "ltr";
27
+ rtl: "rtl";
28
+ }>;
52
29
  focusOrder: z.ZodNullable<z.ZodNumber>;
53
30
  foreground: z.ZodNullable<z.ZodTuple<[z.ZodNumber, z.ZodNumber, z.ZodNumber], null>>;
54
31
  background: z.ZodNullable<z.ZodTuple<[z.ZodNumber, z.ZodNumber, z.ZodNumber], null>>;
55
32
  requiredRatio: z.ZodNumber;
56
33
  contrastReason: z.ZodNullable<z.ZodString>;
57
- }, "strict", z.ZodTypeAny, {
58
- requiredRatio: number;
59
- direction: "unknown" | "ltr" | "rtl";
60
- focusOrder: number | null;
61
- foreground: [number, number, number] | null;
62
- background: [number, number, number] | null;
63
- contrastReason: string | null;
64
- }, {
65
- requiredRatio: number;
66
- direction: "unknown" | "ltr" | "rtl";
67
- focusOrder: number | null;
68
- foreground: [number, number, number] | null;
69
- background: [number, number, number] | null;
70
- contrastReason: string | null;
71
- }>>;
34
+ }, z.core.$strict>>;
72
35
  export type BrowserAccessibilitySample = z.infer<typeof BrowserAccessibilitySampleSchema>;
73
36
  export declare const AccessibilityEvidenceSchema: z.ZodObject<{
74
37
  authoredLabel: z.ZodOptional<z.ZodString>;
@@ -77,118 +40,53 @@ export declare const AccessibilityEvidenceSchema: z.ZodObject<{
77
40
  focusable: z.ZodOptional<z.ZodBoolean>;
78
41
  hidden: z.ZodOptional<z.ZodBoolean>;
79
42
  disabled: z.ZodOptional<z.ZodBoolean>;
80
- direction: z.ZodEnum<["ltr", "rtl", "unknown"]>;
81
- directionSource: z.ZodOptional<z.ZodEnum<["authored", "native-global", "browser-computed", "unknown"]>>;
43
+ direction: z.ZodEnum<{
44
+ unknown: "unknown";
45
+ ltr: "ltr";
46
+ rtl: "rtl";
47
+ }>;
48
+ directionSource: z.ZodOptional<z.ZodEnum<{
49
+ unknown: "unknown";
50
+ authored: "authored";
51
+ "native-global": "native-global";
52
+ "browser-computed": "browser-computed";
53
+ }>>;
82
54
  browser: z.ZodOptional<z.ZodObject<{
83
55
  name: z.ZodNullable<z.ZodString>;
84
56
  focusOrder: z.ZodNullable<z.ZodNumber>;
85
57
  focusOrderSource: z.ZodLiteral<"dom-sequential-estimate">;
86
- contrast: z.ZodEffects<z.ZodObject<{
87
- status: z.ZodEnum<["measured", "unavailable"]>;
58
+ contrast: z.ZodObject<{
59
+ status: z.ZodEnum<{
60
+ measured: "measured";
61
+ unavailable: "unavailable";
62
+ }>;
88
63
  ratio: z.ZodOptional<z.ZodNumber>;
89
64
  requiredRatio: z.ZodOptional<z.ZodNumber>;
90
65
  reason: z.ZodOptional<z.ZodString>;
91
- }, "strict", z.ZodTypeAny, {
92
- status: "measured" | "unavailable";
93
- ratio?: number | undefined;
94
- requiredRatio?: number | undefined;
95
- reason?: string | undefined;
96
- }, {
97
- status: "measured" | "unavailable";
98
- ratio?: number | undefined;
99
- requiredRatio?: number | undefined;
100
- reason?: string | undefined;
101
- }>, {
102
- status: "measured" | "unavailable";
103
- ratio?: number | undefined;
104
- requiredRatio?: number | undefined;
105
- reason?: string | undefined;
106
- }, {
107
- status: "measured" | "unavailable";
108
- ratio?: number | undefined;
109
- requiredRatio?: number | undefined;
110
- reason?: string | undefined;
111
- }>;
112
- }, "strict", z.ZodTypeAny, {
113
- focusOrder: number | null;
114
- name: string | null;
115
- focusOrderSource: "dom-sequential-estimate";
116
- contrast: {
117
- status: "measured" | "unavailable";
118
- ratio?: number | undefined;
119
- requiredRatio?: number | undefined;
120
- reason?: string | undefined;
121
- };
122
- }, {
123
- focusOrder: number | null;
124
- name: string | null;
125
- focusOrderSource: "dom-sequential-estimate";
126
- contrast: {
127
- status: "measured" | "unavailable";
128
- ratio?: number | undefined;
129
- requiredRatio?: number | undefined;
130
- reason?: string | undefined;
131
- };
132
- }>>;
133
- }, "strict", z.ZodTypeAny, {
134
- direction: "unknown" | "ltr" | "rtl";
135
- authoredLabel?: string | undefined;
136
- authoredHint?: string | undefined;
137
- accessible?: boolean | undefined;
138
- focusable?: boolean | undefined;
139
- hidden?: boolean | undefined;
140
- disabled?: boolean | undefined;
141
- directionSource?: "unknown" | "authored" | "native-global" | "browser-computed" | undefined;
142
- browser?: {
143
- focusOrder: number | null;
144
- name: string | null;
145
- focusOrderSource: "dom-sequential-estimate";
146
- contrast: {
147
- status: "measured" | "unavailable";
148
- ratio?: number | undefined;
149
- requiredRatio?: number | undefined;
150
- reason?: string | undefined;
151
- };
152
- } | undefined;
153
- }, {
154
- direction: "unknown" | "ltr" | "rtl";
155
- authoredLabel?: string | undefined;
156
- authoredHint?: string | undefined;
157
- accessible?: boolean | undefined;
158
- focusable?: boolean | undefined;
159
- hidden?: boolean | undefined;
160
- disabled?: boolean | undefined;
161
- directionSource?: "unknown" | "authored" | "native-global" | "browser-computed" | undefined;
162
- browser?: {
163
- focusOrder: number | null;
164
- name: string | null;
165
- focusOrderSource: "dom-sequential-estimate";
166
- contrast: {
167
- status: "measured" | "unavailable";
168
- ratio?: number | undefined;
169
- requiredRatio?: number | undefined;
170
- reason?: string | undefined;
171
- };
172
- } | undefined;
173
- }>;
66
+ }, z.core.$strict>;
67
+ }, z.core.$strict>>;
68
+ }, z.core.$strict>;
174
69
  export type AccessibilityEvidence = z.infer<typeof AccessibilityEvidenceSchema>;
175
70
  export declare const AccessibilityFindingSchema: z.ZodObject<{
176
- code: z.ZodEnum<["ACCESSIBLE_NAME", "FOCUS_ORDER", "TEXT_CONTRAST", "RTL_PHYSICAL_SPACING", "RTL_EVIDENCE"]>;
177
- status: z.ZodEnum<["pass", "fail", "advisory", "unavailable"]>;
178
- elementIds: z.ZodArray<z.ZodString, "many">;
71
+ code: z.ZodEnum<{
72
+ ACCESSIBLE_NAME: "ACCESSIBLE_NAME";
73
+ FOCUS_ORDER: "FOCUS_ORDER";
74
+ TEXT_CONTRAST: "TEXT_CONTRAST";
75
+ RTL_PHYSICAL_SPACING: "RTL_PHYSICAL_SPACING";
76
+ RTL_EVIDENCE: "RTL_EVIDENCE";
77
+ }>;
78
+ status: z.ZodEnum<{
79
+ unavailable: "unavailable";
80
+ pass: "pass";
81
+ fail: "fail";
82
+ advisory: "advisory";
83
+ }>;
84
+ elementIds: z.ZodArray<z.ZodString>;
179
85
  message: z.ZodString;
180
- platform: z.ZodEnum<["web", "android", "ios"]>;
181
- }, "strict", z.ZodTypeAny, {
182
- status: "unavailable" | "pass" | "fail" | "advisory";
183
- code: "ACCESSIBLE_NAME" | "FOCUS_ORDER" | "TEXT_CONTRAST" | "RTL_PHYSICAL_SPACING" | "RTL_EVIDENCE";
184
- message: string;
185
- elementIds: string[];
186
- platform: "web" | "android" | "ios";
187
- }, {
188
- status: "unavailable" | "pass" | "fail" | "advisory";
189
- code: "ACCESSIBLE_NAME" | "FOCUS_ORDER" | "TEXT_CONTRAST" | "RTL_PHYSICAL_SPACING" | "RTL_EVIDENCE";
190
- message: string;
191
- elementIds: string[];
192
- platform: "web" | "android" | "ios";
193
- }>;
86
+ platform: z.ZodEnum<{
87
+ web: "web";
88
+ android: "android";
89
+ ios: "ios";
90
+ }>;
91
+ }, z.core.$strict>;
194
92
  export type AccessibilityFinding = z.infer<typeof AccessibilityFindingSchema>;
@@ -5,7 +5,7 @@ export const ContrastEvidenceSchema = z.object({
5
5
  }).strict().refine(value => value.status !== 'measured' || (value.ratio !== undefined && value.ratio >= 1 && value.ratio <= 21 && value.requiredRatio !== undefined), 'Measured contrast requires a valid ratio and threshold');
6
6
  const rgb = z.tuple([z.number().min(0).max(255), z.number().min(0).max(255), z.number().min(0).max(255)]);
7
7
  export const BrowserAccessibilitySampleSchema = z.object({ direction: z.enum(['ltr', 'rtl', 'unknown']), focusOrder: z.number().int().nonnegative().nullable(), foreground: rgb.nullable(), background: rgb.nullable(), requiredRatio: z.number().finite().positive(), contrastReason: z.string().nullable() }).strict();
8
- export const BrowserAccessibilitySamplesSchema = z.record(BrowserAccessibilitySampleSchema);
8
+ export const BrowserAccessibilitySamplesSchema = z.record(z.string(), BrowserAccessibilitySampleSchema);
9
9
  export const AccessibilityEvidenceSchema = z.object({
10
10
  authoredLabel: z.string().optional(), authoredHint: z.string().optional(),
11
11
  accessible: z.boolean().optional(), focusable: z.boolean().optional(), hidden: z.boolean().optional(), disabled: z.boolean().optional(),