-
Notifications
You must be signed in to change notification settings - Fork 3.8k
Expand file tree
/
Copy pathtypes.ts
More file actions
141 lines (140 loc) · 3.4 KB
/
Copy pathtypes.ts
File metadata and controls
141 lines (140 loc) · 3.4 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
export type Data = null | boolean | number | string | Data[] | { [key: string]: Data }
export type Decision = 'flag' | 'exempt'
export type Category =
| 'colour'
| 'dimensions'
| 'typography'
| 'shape-effects'
| 'layout'
| 'visibility'
| 'content'
| 'motion'
| 'movement'
| 'infrastructure'
| 'unresolved'
| 'nonvisual'
export interface Location {
file: string
line: number
column: number
}
export interface Evidence {
value: Data
unresolved: string[]
dependencies: string[]
}
export interface Definition extends Evidence {
appearance?: { media?: boolean; shared?: boolean; element?: string }
key: string
kind:
| 'class'
| 'style'
| 'markup'
| 'content'
| 'attribute'
| 'css'
| 'native'
| 'asset'
| 'review'
property: string
location: Location
symbol: string
conditions: Data[]
}
export interface Change {
id: string
decision: Decision
category: Category
reason: string
before: { value: Data; location: Location; conditions: Data[]; property: string } | null
after: { value: Data; location: Location; conditions: Data[]; property: string } | null
symbol: string
consumers: string[]
dependencies: string[]
limitations: string[]
}
export interface Finding extends Change {
source: {
before: { file: string; blob: string } | null
after: { file: string; blob: string } | null
}
categories: Category[]
changes: Change[]
example: { basis: 'changed-definition' | 'potential-consumer'; change: Change } | null
impact: {
basis: 'resolved-static-references'
before: UsageCount
after: UsageCount
}
}
export interface UsageCount {
coverage: 'partial'
referenceCount: number
fileCount: number
references: {
location: Location
symbol: string
kind: 'jsx' | 'call' | 'reference'
}[]
}
export interface Config {
sourceRoots: string[]
mediaModules?: string[]
mediaSources?: string[]
mediaSymbols?: { file: string; names: string[] }[]
exclude: string[]
renderedMarkdown: string[]
aliases: { from: string; prefix: string; target: string }[]
themes: { roots: string[]; path: string }[]
classModules: string[]
variantModules: string[]
mergeFontSizes: string[]
nativeRendering: string[]
classFunctions: string[]
variantFunctions: string[]
nativeAppearance: string[]
infrastructure: string[]
documentationContent?: {
components: { module: string; names: string[]; contentProps: string[] }[]
}
fileInputs?: {
list: string
export: string
root: string
renderer: string
}[]
environmentAdapters?: {
module: string
export: string
environmentModule: string
environmentExport: string
implementationModule: string
implementationExport: string
}[]
renderingDependencies: string
limits: {
fileBytes: number
totalBytes: number
resolutionDepth: number
resolutionSteps: number
}
}
export interface Report {
schemaVersion: '3.0.0'
engineVersion: '0.6.0'
policyVersion: '5.0.0'
commits: { base: string; head: string; mergeBase: string } | null
status: 'completed' | 'failed'
flagged: boolean | null
findings: Finding[]
limitations: string[]
truncation?: {
valuePreviewBytes: number
reportLimitBytes: number
findingsTotal: number
omittedFindings: number
lists: { path: string; total: number; omitted: number }[]
}
error?: string
context?: { pullRequest: number; headSha: string; engineSha: string }
}