-
Notifications
You must be signed in to change notification settings - Fork 47
Expand file tree
/
Copy pathtypes.ts
More file actions
97 lines (85 loc) · 2.38 KB
/
types.ts
File metadata and controls
97 lines (85 loc) · 2.38 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
import { Catalog } from "./redux/metadataSlice";
export interface Segment {
id: string,
start: number,
end: number,
deleted: boolean,
text?: string, // For chapters
}
export interface Track {
id: string,
uri: string,
flavor: Flavor,
audio_stream: {available: boolean, enabled: boolean, thumbnail_uri: string},
video_stream: {available: boolean, enabled: boolean, thumbnail_uri: string},
thumbnailUri: string | undefined,
thumbnailPriority: number,
}
export interface Flavor {
type: string,
subtype: string,
}
export interface Workflow {
id: string,
name: string,
description: string,
displayOrder: number,
}
export interface TimelineState {
segments: Segment[]
scrubberPos: number
}
export interface SubtitlesFromOpencast {
id: string,
subtitle: string,
tags: string[],
}
export interface SubtitlesInEditor {
cues: SubtitleCue[],
tags: string[],
deleted: boolean,
}
export interface SubtitleCue {
id?: string, // Actually not useful as an identifier, as it is not guaranteed to exist
idInternal: string, // Identifier for internal use. Has nothing to do with the webvtt parser.
text: string,
startTime: number,
endTime: number,
// Odditiy of the webvtt parser. Changes to text also need to be applied to tree.children[0].value
tree: {children: [{type: string, value: string}]}
// And many more
}
export interface ExtendedSubtitleCue extends SubtitleCue {
alignment : string
direction : string
lineAlign : string
linePosition : string
positionAlign : string
size : number
textPosition : string
}
export interface PostEditArgument {
segments: Segment[]
tracks: Track[]
customizedTrackSelection: boolean
subtitles: SubtitlesFromOpencast[]
chapters: SubtitlesFromOpencast[]
workflow?: [{id: string}]
metadata: Catalog[]
}
// Use respective i18n keys as values
export enum MainMenuStateNames {
cutting = "mainMenu.cutting-button",
metadata = "mainMenu.metadata-button",
trackSelection = "mainMenu.select-tracks-button",
subtitles = "mainMenu.subtitles-button",
chapters = "mainMenu.chapters-button",
thumbnail = "mainMenu.thumbnail-button",
finish = "mainMenu.finish-button",
keyboardControls = "mainMenu.keyboard-controls-button",
}
export interface httpRequestState {
status: "idle" | "loading" | "success" | "failed",
error: string | undefined,
errorReason: "unknown" | "workflowActive"
}