/
HelixStreamMarker.ts
46 lines (40 loc) · 1.15 KB
/
HelixStreamMarker.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
import { Enumerable } from '@d-fischer/shared-utils';
import { DataObject, rawDataSymbol, rtfm } from '@twurple/common';
import { type BaseApiClient } from '../../client/BaseApiClient';
import { type HelixStreamMarkerData } from '../../interfaces/endpoints/stream.external';
/**
* A stream marker.
*/
@rtfm<HelixStreamMarker>('api', 'HelixStreamMarker', 'id')
export class HelixStreamMarker extends DataObject<HelixStreamMarkerData> {
/** @internal */ @Enumerable(false) protected readonly _client: BaseApiClient;
/** @internal */
constructor(data: HelixStreamMarkerData, client: BaseApiClient) {
super(data);
this._client = client;
}
/**
* The ID of the marker.
*/
get id(): string {
return this[rawDataSymbol].id;
}
/**
* The date and time when the marker was created.
*/
get creationDate(): Date {
return new Date(this[rawDataSymbol].created_at);
}
/**
* The description of the marker.
*/
get description(): string {
return this[rawDataSymbol].description;
}
/**
* The position in the stream when the marker was created, in seconds.
*/
get positionInSeconds(): number {
return this[rawDataSymbol].position_seconds;
}
}