@astryxdesign/cli 0.7.2-canary.411cbed → 0.7.2-canary.4787e3f

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.
@@ -0,0 +1,165 @@
1
+ // @generated by scripts/sync-api-types.mjs from the JSDoc in foundation/**/*.mjs.
2
+ // DO NOT EDIT — run `pnpm sync:api-types` to regenerate.
3
+
4
+ /**
5
+ * Compare each documented prop table with the TypeScript props of the export
6
+ * it describes.
7
+ * @param {PropDriftTable[]} tables
8
+ * @param {{packageDir: string, resolveFrom: Array<string | null | undefined>}} options
9
+ * @returns {PropDriftReport}
10
+ */
11
+ export function comparePropTables(tables: PropDriftTable[], options: {
12
+ packageDir: string;
13
+ resolveFrom: Array<string | null | undefined>;
14
+ }): PropDriftReport;
15
+ /**
16
+ * @typedef {'not_in_code' | 'not_in_doc' | 'required_mismatch'} PropDriftKind
17
+ */
18
+ /**
19
+ * @typedef {object} PropDriftFinding
20
+ * @property {string} component the documented component (export) name
21
+ * @property {string} prop
22
+ * @property {PropDriftKind} kind
23
+ * @property {'warning'} severity
24
+ * @property {string} message
25
+ * @property {string} doc the doc file, relative to the package root
26
+ * @property {string} source the source file, relative to the package root
27
+ */
28
+ /**
29
+ * @typedef {object} PropDriftUnchecked
30
+ * @property {string} component
31
+ * @property {string} doc the doc file, relative to the package root
32
+ * @property {string} reason why its props could not be read
33
+ */
34
+ /**
35
+ * @typedef {object} PropDriftReport
36
+ * @property {'checked' | 'skipped'} status `skipped` means nothing was
37
+ * compared, and `reason` says why
38
+ * @property {string} [reason]
39
+ * @property {string} [typescript] the version of the compiler that read the props
40
+ * @property {number} components how many documented prop tables were compared
41
+ * @property {PropDriftFinding[]} findings
42
+ * @property {PropDriftUnchecked[]} unchecked documented components whose props
43
+ * could not be read from the source
44
+ * @property {Array<PropDriftUnchecked & {props: string[]}>} [propsNotChecked]
45
+ * props a mapped type builds from keys the check can't trace, which a doc
46
+ * leaving out draws no warning for
47
+ */
48
+ /**
49
+ * @typedef {object} PropDriftTable
50
+ * @property {string} doc the doc file, relative to the package root
51
+ * @property {string} name the export the table documents
52
+ * @property {any[]} props the table's entries
53
+ * @property {string[]} sources the files that may hold the export, in order
54
+ */
55
+ /**
56
+ * Props a doc never needs to list: the internal and styling props the
57
+ * `ComponentPropDoc` authoring guidance says to skip, `ref`, which Core's
58
+ * docs also leave out, and `key`, which React keeps for itself.
59
+ */
60
+ export const PROPS_NOT_DOCUMENTED: readonly string[];
61
+ /** The line both surfaces print when the compiler is missing. */
62
+ export const TYPESCRIPT_MISSING_REASON: "TypeScript is not installed in this project, so documented props were not compared with the code. Install typescript and run this check again.";
63
+ export type CodeProp = {
64
+ name: string;
65
+ /**
66
+ * whether every caller must pass it: false
67
+ * when a member of the props type, an overload, or the package's
68
+ * `defaultProps` lets a caller leave it out
69
+ */
70
+ required: boolean;
71
+ /**
72
+ * declared in the package's own source, or built
73
+ * from keys it writes
74
+ */
75
+ own: boolean;
76
+ /**
77
+ * built from keys the check can't trace
78
+ */
79
+ untraced?: boolean | undefined;
80
+ /**
81
+ * its declaration carries an internal JSDoc tag
82
+ */
83
+ skipTagged: boolean;
84
+ /**
85
+ * the prop's type in each member of the props type
86
+ */
87
+ types: () => any[];
88
+ };
89
+ export type PropDriftKind = "not_in_code" | "not_in_doc" | "required_mismatch";
90
+ export type PropDriftFinding = {
91
+ /**
92
+ * the documented component (export) name
93
+ */
94
+ component: string;
95
+ prop: string;
96
+ kind: PropDriftKind;
97
+ severity: "warning";
98
+ message: string;
99
+ /**
100
+ * the doc file, relative to the package root
101
+ */
102
+ doc: string;
103
+ /**
104
+ * the source file, relative to the package root
105
+ */
106
+ source: string;
107
+ };
108
+ export type PropDriftUnchecked = {
109
+ component: string;
110
+ /**
111
+ * the doc file, relative to the package root
112
+ */
113
+ doc: string;
114
+ /**
115
+ * why its props could not be read
116
+ */
117
+ reason: string;
118
+ };
119
+ export type PropDriftReport = {
120
+ /**
121
+ * `skipped` means nothing was
122
+ * compared, and `reason` says why
123
+ */
124
+ status: "checked" | "skipped";
125
+ reason?: string | undefined;
126
+ /**
127
+ * the version of the compiler that read the props
128
+ */
129
+ typescript?: string | undefined;
130
+ /**
131
+ * how many documented prop tables were compared
132
+ */
133
+ components: number;
134
+ findings: PropDriftFinding[];
135
+ /**
136
+ * documented components whose props
137
+ * could not be read from the source
138
+ */
139
+ unchecked: PropDriftUnchecked[];
140
+ /**
141
+ * props a mapped type builds from keys the check can't trace, which a doc
142
+ * leaving out draws no warning for
143
+ */
144
+ propsNotChecked?: (PropDriftUnchecked & {
145
+ props: string[];
146
+ })[] | undefined;
147
+ };
148
+ export type PropDriftTable = {
149
+ /**
150
+ * the doc file, relative to the package root
151
+ */
152
+ doc: string;
153
+ /**
154
+ * the export the table documents
155
+ */
156
+ name: string;
157
+ /**
158
+ * the table's entries
159
+ */
160
+ props: any[];
161
+ /**
162
+ * the files that may hold the export, in order
163
+ */
164
+ sources: string[];
165
+ };