-
Notifications
You must be signed in to change notification settings - Fork 0
/
types.ts
99 lines (82 loc) · 1.94 KB
/
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
export interface User {
user_id: number,
user_name: string,
user_hash: string,
user_status: Status
}
export type Status = "admin" | "user";
export interface NewUser extends Omit<User, "user_id" | "user_hash"> {
password: string,
}
export type LoginCredentials = Omit<NewUser, "user_status">;
export interface NewUserFields {
user_name: unknown,
user_status: unknown,
password: unknown
}
export interface LoggedInUser extends User {
token: string
}
export interface TextForTTS {
name: string,
text: string,
link: string,
year?: number | null
}
export interface TextFields {
name: unknown,
text: unknown,
link: unknown,
year?: unknown
}
export interface Voice {
voice_id: string,
link: string,
voice_length: string,
voice_name: string,
added: Date,
last_play: Date,
from_text?: string,
to_text?: string,
year?: number
}
export interface VoiceWithTime extends Voice {
play_time: string
}
export type Metadata = Omit<Voice, "link" | "voice_name" | "added" | "last_play">;
export type MetadataToLS = {
voice_id: string,
voice_length: string,
from_text: string,
to_text: string,
year: string
};
export type MetadataFromLS = {
unparsed: string
};
export interface Playlist {
playlist_id: string,
play_date: string,
voices: VoiceWithTime[]
}
export type NewVoice = Omit<Voice, "voice_id" | "added" | "last_play">;
export type NodeState = {
id: number,
chars: number,
current_list: number,
last_updated: string
};
export type TTSRequest = {
input: {
text: string,
},
voice: {
languageCode: string,
ssmlGender: "FEMALE" | "SSML_VOICE_GENDER_UNSPECIFIED" | "MALE" | "NEUTRAL" | null | undefined
},
audioConfig: {
audioEncoding: "MP3" | "AUDIO_ENCODING_UNSPECIFIED" | "LINEAR16" | "OGG_OPUS" | null | undefined
pitch: number,
speakingRate: number
}
};