You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
50 lines
742 B
TypeScript
50 lines
742 B
TypeScript
import { z } from 'zod'
|
|
|
|
export type Category = 'spot' | 'linear' | 'inverse'
|
|
|
|
export const categories: Category[] = ['linear', 'spot', 'inverse']
|
|
|
|
export type Interval =
|
|
| '1'
|
|
| '3'
|
|
| '5'
|
|
| '15'
|
|
| '30'
|
|
| '60'
|
|
| '120'
|
|
| '240'
|
|
| '360'
|
|
| '720'
|
|
| 'D'
|
|
| 'M'
|
|
| 'W'
|
|
|
|
export const intervals: Interval[] = [
|
|
'1',
|
|
'3',
|
|
'5',
|
|
'15',
|
|
'30',
|
|
'60',
|
|
'120',
|
|
'240',
|
|
'360',
|
|
'720',
|
|
'D',
|
|
'M',
|
|
'W',
|
|
]
|
|
|
|
export const formSchema = z.object({
|
|
category: z.custom<Category>(),
|
|
symbol: z.string(),
|
|
interval: z.custom<Interval>(),
|
|
start: z.string().min(1),
|
|
startTime: z.string().min(1),
|
|
end: z.string().min(1),
|
|
endTime: z.string().min(1),
|
|
limit: z.number().int().min(1).max(1000).optional(),
|
|
})
|
|
|
|
export type FormSchema = typeof formSchema
|