This repository has been archived by the owner on Jul 25, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.d.ts
110 lines (105 loc) · 2.76 KB
/
index.d.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
// This file is autogenerated. Do not modify.
import { Response } from './response'
export type SortType = 'time' | 'cost'
export type Duration = number
type Numeral = '0' | '1' | '2' | '3' | '4' | '5' | '6' | '7' | '8' | '9'
type NumberSegment = `${Numeral}${Numeral}`
export type DateString = `${NumberSegment}-${NumberSegment}`
export type Instant = `${NumberSegment}:${NumberSegment}`
interface AddUserOptions {
currentUser: string
username: string
password: string
name: string
email: string
privilege: number
}
interface LoginOptions {
username: string
password: string
}
interface LogoutOptions {
username: string
}
interface QueryProfileOptions {
currentUser: string
username: string
}
interface ModifyProfileOptions {
currentUser: string
username: string
password?: string
name?: string
email?: string
privilege?: number
}
interface AddTrainOptions {
id: string
stops: number
seats: number
stations: string[]
prices: number[]
departure: Instant
durations: Duration[]
stopoverTimes: Duration[]
dates: DateString[]
type: string
}
interface DeleteTrainOptions {
id: string
}
interface ReleaseTrainOptions {
id: string
}
interface QueryTrainOptions {
id: string
date: DateString
}
interface QueryTicketOptions {
from: string
to: string
date: DateString
sort?: SortType
}
interface QueryTransferOptions {
from: string
to: string
date: DateString
sort?: SortType
}
interface BuyTicketOptions {
currentUser: string
train: string
date: DateString
seats: number
from: string
to: string
queue?: boolean
}
interface QueryOrderOptions {
currentUser: string
}
interface RefundTicketOptions {
currentUser: string
index?: number
}
interface RollbackOptions {
timestamp: number
}
export function addUser (options: AddUserOptions): Response
export function login (options: LoginOptions): Response
export function logout (options: LogoutOptions): Response
export function queryProfile (options: QueryProfileOptions): Response
export function modifyProfile (options: ModifyProfileOptions): Response
export function addTrain (options: AddTrainOptions): Response
export function deleteTrain (options: DeleteTrainOptions): Response
export function releaseTrain (options: ReleaseTrainOptions): Response
export function queryTrain (options: QueryTrainOptions): Response
export function queryTicket (options: QueryTicketOptions): Response
export function queryTransfer (options: QueryTransferOptions): Response
export function buyTicket (options: BuyTicketOptions): Response
export function queryOrder (options: QueryOrderOptions): Response
export function refundTicket (options: RefundTicketOptions): Response
export function rollback (options: RollbackOptions): Response
export function clean (): Response
export function exit (): Response