-
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathdomain-types.ts
182 lines (178 loc) · 4.29 KB
/
domain-types.ts
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
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
import boxen from 'boxen'
import { ScreenshotOptions } from './browser-types'
import { ThemePattern } from './enum-types'
import { Optional } from './standard-types'
/**
* Headers
* @desc Type representing headers
*/
export type Headers = Record<string, number | string | string[]>
//--------------------------------------------------------------------------------------------------
/**
* RouteOptions
* @desc Type representing route options
*/
export type RouteOptions = {
/**
* Route base url.
*/
readonly url: string
}
//--------------------------------------------------------------------------------------------------
/**
* ThemeOptions
* @desc Type representing theme options
*/
export type ThemeOptions = {
/**
* Theme pattern.
*/
readonly theme?: Optional<ThemePattern>
/**
* Theme format options.
*/
readonly format?: FormatOptions
}
//--------------------------------------------------------------------------------------------------
/**
* PayloadOptions
* @desc Type representing payload options
*/
export type PayloadOptions = {
/**
* Payload data
*/
readonly data: string
}
//--------------------------------------------------------------------------------------------------
/**
* QueryOptions
* @desc Type representing query options
*/
export type QueryOptions = RouteOptions & ThemeOptions & PayloadOptions
//--------------------------------------------------------------------------------------------------
/**
* CarbonFormatOptions
* @desc Type representing carbon format options
*/
export type CarbonFormatOptions = Record<string, string | boolean>
//--------------------------------------------------------------------------------------------------
/**
* FormatOptions
* @desc Type representing format options
*/
export type FormatOptions = {
/**
* Background color
*/
readonly backgroundColor: string
/**
* Drop shadow
*/
readonly dropShadow: string
/**
* Drop shadow blur
*/
readonly dropShadowBlur: string
/**
* Drop shadow offsetY
*/
readonly dropShadowOffsetY: string
/**
* Image export size
*/
readonly exportSize: string
/**
* Font family
*/
readonly fontFamily: string
/**
* Font size
*/
readonly fontSize: string
/**
* Language
*/
readonly language: string
/**
* Line height
*/
readonly lineHeight: string
/**
* Line number
*/
readonly lineNumber: string
/**
* Horizontal padding
*/
readonly paddingHorizontal: string
/**
* Vertical padding
*/
readonly paddingVertical: string
/**
* Image theme
*/
readonly theme: string
/**
* Image squred size
*/
readonly squaredImage: string
/**
* Image width adjustment
*/
readonly widthAdjustment: string
/**
* Window controls
*/
readonly windowControl: string
/**
* Image watermark
*/
readonly watermark: string
/**
* Window theme
*/
readonly windowTheme: string
}
//--------------------------------------------------------------------------------------------------
/**
* ThemeFormatOptions
* @desc Type representing theme format options
*/
export type ThemeFormatOptions = Record<keyof FormatOptions, keyof CarbonFormatOptions>
//--------------------------------------------------------------------------------------------------
/**
* ProfileOptions
* @desc Type representing profile options
*/
export type ProfileOptions = {
/**
* Route configuration options.
*/
readonly routeOptions: Partial<RouteOptions>
/**
* Screenshot configuration options.
*/
readonly screenshotOptions: Partial<ScreenshotOptions>
/**
* Logging options
*/
readonly outputOptions?: Partial<boxen.Options>
}
//--------------------------------------------------------------------------------------------------
/**
* ParsedRequestData
* @desc Type representing parsed request data
*/
export type ParsedRequestData = {
/**
* Request data
*/
readonly data: string
/**
* Request query
*/
readonly query: Record<string, string | string[]>
}
//--------------------------------------------------------------------------------------------------