@vidispine/vdt-js 23.1.0-pre.5 → 23.2.0-pre.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.d.ts +1279 -1152
- package/dist/index.es.js +173 -626
- package/dist/index.es.js.map +1 -1
- package/dist/index.js +175 -625
- package/dist/index.js.map +1 -1
- package/package.json +23 -20
package/dist/index.d.ts
CHANGED
|
@@ -1,1249 +1,1376 @@
|
|
|
1
1
|
import * as _vidispine_types from '@vidispine/types';
|
|
2
|
-
import { KeyValuePairType, MetadataValueType, MetadataFieldValueType, MetadataGroupValueType, MetadataType, SimpleMetadataType, FacetType, SearchResultEntryTimespanType, AudioComponentType, BinaryComponentType, FileType, TimeCodeType, ContainerComponentType, TimeBaseType, VideoComponentType, ShapeType, ItemType, TranscodePresetType } from '@vidispine/types';
|
|
2
|
+
import { KeyValuePairType, MetadataValueType, MetadataFieldValueType, MetadataGroupValueType, MetadataType, SimpleMetadataType, SearchFacetType, FacetType, SearchResultEntryTimespanType, AudioComponentType, BinaryComponentType, FileType, TimeCodeType, ContainerComponentType, TimeBaseType, VideoComponentType, ShapeType, ItemType, TranscodePresetType, MetadataFieldType } from '@vidispine/types';
|
|
3
3
|
|
|
4
|
-
/**
|
|
5
|
-
*
|
|
6
|
-
* @param keyValuePairTypes
|
|
7
|
-
* @returns
|
|
8
|
-
*
|
|
9
|
-
* @category Other
|
|
10
|
-
*/
|
|
11
|
-
declare const parseKeyValuePairTypes: (keyValuePairTypes: KeyValuePairType[]) => {
|
|
12
|
-
[k: string]: string;
|
|
4
|
+
/**
|
|
5
|
+
*
|
|
6
|
+
* @param keyValuePairTypes
|
|
7
|
+
* @returns
|
|
8
|
+
*
|
|
9
|
+
* @category Other
|
|
10
|
+
*/
|
|
11
|
+
declare const parseKeyValuePairTypes: (keyValuePairTypes: KeyValuePairType[]) => {
|
|
12
|
+
[k: string]: string;
|
|
13
13
|
};
|
|
14
14
|
|
|
15
|
-
/**
|
|
16
|
-
* Const object with VidiCore role names
|
|
17
|
-
*
|
|
18
|
-
* @category Auth
|
|
19
|
-
*/
|
|
20
|
-
declare const ROLE_NAMES: {
|
|
21
|
-
readonly ACCESSCONTROL_READ: "_accesscontrol_read";
|
|
22
|
-
readonly ACCESSCONTROL_WRITE: "_accesscontrol_write";
|
|
23
|
-
readonly ADMINISTRATOR: "_administrator";
|
|
24
|
-
readonly AUTO_PROJECTION_READ: "_auto_projection_read";
|
|
25
|
-
readonly AUTO_PROJECTION_WRITE: "_auto_projection_write";
|
|
26
|
-
readonly COLLECTION_NOTIFICATION_READ: "_collection_notification_read";
|
|
27
|
-
readonly COLLECTION_NOTIFICATION_WRITE: "_collection_notification_write";
|
|
28
|
-
readonly COLLECTION_READ: "_collection_read";
|
|
29
|
-
readonly COLLECTION_WRITE: "_collection_write";
|
|
30
|
-
readonly CONFIGURATION_READ: "_configuration_read";
|
|
31
|
-
readonly DELETION_LOCK_NOTIFICATION_READ: "_deletion_lock_notification_read";
|
|
32
|
-
readonly DELETION_LOCK_NOTIFICATION_WRITE: "_deletion_lock_notification_write";
|
|
33
|
-
readonly DELETION_LOCK_READ: "_deletion_lock_read";
|
|
34
|
-
readonly DELETION_LOCK_WRITE: "_deletion_lock_write";
|
|
35
|
-
readonly DOCUMENT_NOTIFICATION_READ: "_document_notification_read";
|
|
36
|
-
readonly DOCUMENT_NOTIFICATION_WRITE: "_document_notification_write";
|
|
37
|
-
readonly DOCUMENT_READ: "_document_read";
|
|
38
|
-
readonly DOCUMENT_WRITE: "_document_write";
|
|
39
|
-
readonly ERROR_READ: "_error_read";
|
|
40
|
-
readonly ERROR_WRITE: "_error_write";
|
|
41
|
-
readonly EXPORT: "_export";
|
|
42
|
-
readonly EXPORT_TEMPLATE_READ: "_export_template_read";
|
|
43
|
-
readonly EXPORT_TEMPLATE_WRITE: "_export_template_write";
|
|
44
|
-
readonly EXTERNAL_ID_READ: "_external_id_read";
|
|
45
|
-
readonly EXTERNAL_ID_WRITE: "_external_id_write";
|
|
46
|
-
readonly FILE_NOTIFICATION_READ: "_file_notification_read";
|
|
47
|
-
readonly FILE_NOTIFICATION_WRITE: "_file_notification_write";
|
|
48
|
-
readonly FILE_READ: "_file_read";
|
|
49
|
-
readonly FILE_WRITE: "_file_write";
|
|
50
|
-
readonly GROUP_READ: "_group_read";
|
|
51
|
-
readonly GROUP_WRITE: "_group_write";
|
|
52
|
-
readonly IMPORT_WRITE: "_import";
|
|
53
|
-
readonly ITEM_ID_READ: "_item_id_read";
|
|
54
|
-
readonly ITEM_ID_WRITE: "_item_id_write";
|
|
55
|
-
readonly ITEM_NOTIFICATION_READ: "_item_notification_read";
|
|
56
|
-
readonly ITEM_NOTIFICATION_WRITE: "_item_notification_write";
|
|
57
|
-
readonly ITEM_WRITE: "_item_write";
|
|
58
|
-
readonly ITEM_SEARCH: "_item_search";
|
|
59
|
-
readonly ITEM_SHAPE_READ: "_item_shape_read";
|
|
60
|
-
readonly ITEM_SHAPE_WRITE: "_item_shape_write";
|
|
61
|
-
readonly ITEM_TIMELINE_READ: "_item_timeline_read";
|
|
62
|
-
readonly ITEM_TIMELINE_WRITE: "_item_timeline_write";
|
|
63
|
-
readonly ITEM_URI: "_item_uri";
|
|
64
|
-
readonly JOB_NOTIFICATION_READ: "_job_notification_read";
|
|
65
|
-
readonly JOB_NOTIFICATION_WRITE: "_job_notification_write";
|
|
66
|
-
readonly JOB_READ: "_job_read";
|
|
67
|
-
readonly JOB_WRITE: "_job_write";
|
|
68
|
-
readonly LIBRARY_READ: "_library_read";
|
|
69
|
-
readonly LIBRARY_WRITE: "_library_write";
|
|
70
|
-
readonly LOCK_READ: "_lock_read";
|
|
71
|
-
readonly LOCK_WRITE: "_lock_write";
|
|
72
|
-
readonly LOG_READ: "_log_read";
|
|
73
|
-
readonly METADATA_DATASET_READ: "_metadata_dataset_read";
|
|
74
|
-
readonly METADATA_DATASET_WRITE: "_metadata_dataset_write";
|
|
75
|
-
readonly METADATA_FIELD_GROUP_READ: "_metadata_field_group_read";
|
|
76
|
-
readonly METADATA_FIELD_GROUP_WRITE: "_metadata_field_group_write";
|
|
77
|
-
readonly METADATA_FIELD_READ: "_metadata_field_read";
|
|
78
|
-
readonly METADATA_FIELD_WRITE: "_metadata_field_write";
|
|
79
|
-
readonly METADATA_GLOBAL_READ: "_metadata_global_read";
|
|
80
|
-
readonly METADATA_GLOBAL_WRITE: "_metadata_global_write";
|
|
81
|
-
readonly METADATA_LOCK_READ: "_metadata_lock_read";
|
|
82
|
-
readonly METADATA_LOCK_WRITE: "_metadata_lock_write";
|
|
83
|
-
readonly METADATA_READ: "_metadata_read";
|
|
84
|
-
readonly METADATA_SCHEMA_READ: "_metadata_schema_read";
|
|
85
|
-
readonly METADATA_SCHEMA_WRITE: "_metadata_schema_write";
|
|
86
|
-
readonly METADATA_WRITE: "_metadata_write";
|
|
87
|
-
readonly OTIF_ANALYZE: "_otif_analyze";
|
|
88
|
-
readonly OTIF_READ: "_otif_read";
|
|
89
|
-
readonly OTIF_WRITE: "_otif_write";
|
|
90
|
-
readonly PLACEHOLDER_NOTIFICATION_READ: "_placeholder_notification_read";
|
|
91
|
-
readonly PLACEHOLDER_NOTIFICATION_WRITE: "_placeholder_notification_write";
|
|
92
|
-
readonly PROJECTION_READ: "_projection_read";
|
|
93
|
-
readonly PROJECTION_WRITE: "_projection_write";
|
|
94
|
-
readonly QUOTA_NOTIFICATION_READ: "_quota_notification_read";
|
|
95
|
-
readonly QUOTA_NOTIFICATION_WRITE: "_quota_notification_write";
|
|
96
|
-
readonly QUOTA_READ: "_quota_read";
|
|
97
|
-
readonly QUOTA_WRITE: "_quota_write";
|
|
98
|
-
readonly RELATION_READ: "_relation_read";
|
|
99
|
-
readonly RELATION_WRITE: "_relation_write";
|
|
100
|
-
readonly RESOURCE_READ: "_resource_read";
|
|
101
|
-
readonly RESOURCE_WRITE: "_resource_write";
|
|
102
|
-
readonly RUN_AS: "_run_as";
|
|
103
|
-
readonly SEARCH: "_search";
|
|
104
|
-
readonly SEQUENCE_READ: "_sequence_read";
|
|
105
|
-
readonly SEQUENCE_WRITE: "_sequence_write";
|
|
106
|
-
readonly SHAPE_TAG_READ: "_shape_tag_read";
|
|
107
|
-
readonly SHAPE_TAG_WRITE: "_shape_tag_write";
|
|
108
|
-
readonly SITE_MANAGER: "_site_manager";
|
|
109
|
-
readonly SITE_RULE_READ: "_site_rule_read";
|
|
110
|
-
readonly SITE_RULE_WRITE: "_site_rule_write";
|
|
111
|
-
readonly STORAGE_GROUP_READ: "_storage_group_read";
|
|
112
|
-
readonly STORAGE_GROUP_WRITE: "_storage_group_write";
|
|
113
|
-
readonly STORAGE_NOTIFICATION_READ: "_storage_notification_read";
|
|
114
|
-
readonly STORAGE_NOTIFICATION_WRITE: "_storage_notification_write";
|
|
115
|
-
readonly STORAGE_READ: "_storage_read";
|
|
116
|
-
readonly STORAGE_RULE_READ: "_storage_rule_read";
|
|
117
|
-
readonly STORAGE_RULE_WRITE: "_storage_rule_write";
|
|
118
|
-
readonly STORAGE_WRITE: "_storage_write";
|
|
119
|
-
readonly SUPER_ACCESS_USER: "_super_access_user";
|
|
120
|
-
readonly TASKDEFINITION_READ: "_taskdefinition_read";
|
|
121
|
-
readonly TASKDEFINITION_WRITE: "_taskdefinition_write";
|
|
122
|
-
readonly THUMBNAIL_READ: "_thumbnail_read";
|
|
123
|
-
readonly THUMBNAIL_WRITE: "_thumbnail_write";
|
|
124
|
-
readonly TRANSCODER: "_transcoder";
|
|
125
|
-
readonly TRANSFER_READ: "_transfer_read";
|
|
126
|
-
readonly TRANSFER_WRITE: "_transfer_write";
|
|
127
|
-
readonly USER: "_user";
|
|
128
|
-
readonly VXA: "_vxa";
|
|
129
|
-
readonly VXA_READ: "_vxa_read";
|
|
130
|
-
};
|
|
15
|
+
/**
|
|
16
|
+
* Const object with VidiCore role names
|
|
17
|
+
*
|
|
18
|
+
* @category Auth
|
|
19
|
+
*/
|
|
20
|
+
declare const ROLE_NAMES: {
|
|
21
|
+
readonly ACCESSCONTROL_READ: "_accesscontrol_read";
|
|
22
|
+
readonly ACCESSCONTROL_WRITE: "_accesscontrol_write";
|
|
23
|
+
readonly ADMINISTRATOR: "_administrator";
|
|
24
|
+
readonly AUTO_PROJECTION_READ: "_auto_projection_read";
|
|
25
|
+
readonly AUTO_PROJECTION_WRITE: "_auto_projection_write";
|
|
26
|
+
readonly COLLECTION_NOTIFICATION_READ: "_collection_notification_read";
|
|
27
|
+
readonly COLLECTION_NOTIFICATION_WRITE: "_collection_notification_write";
|
|
28
|
+
readonly COLLECTION_READ: "_collection_read";
|
|
29
|
+
readonly COLLECTION_WRITE: "_collection_write";
|
|
30
|
+
readonly CONFIGURATION_READ: "_configuration_read";
|
|
31
|
+
readonly DELETION_LOCK_NOTIFICATION_READ: "_deletion_lock_notification_read";
|
|
32
|
+
readonly DELETION_LOCK_NOTIFICATION_WRITE: "_deletion_lock_notification_write";
|
|
33
|
+
readonly DELETION_LOCK_READ: "_deletion_lock_read";
|
|
34
|
+
readonly DELETION_LOCK_WRITE: "_deletion_lock_write";
|
|
35
|
+
readonly DOCUMENT_NOTIFICATION_READ: "_document_notification_read";
|
|
36
|
+
readonly DOCUMENT_NOTIFICATION_WRITE: "_document_notification_write";
|
|
37
|
+
readonly DOCUMENT_READ: "_document_read";
|
|
38
|
+
readonly DOCUMENT_WRITE: "_document_write";
|
|
39
|
+
readonly ERROR_READ: "_error_read";
|
|
40
|
+
readonly ERROR_WRITE: "_error_write";
|
|
41
|
+
readonly EXPORT: "_export";
|
|
42
|
+
readonly EXPORT_TEMPLATE_READ: "_export_template_read";
|
|
43
|
+
readonly EXPORT_TEMPLATE_WRITE: "_export_template_write";
|
|
44
|
+
readonly EXTERNAL_ID_READ: "_external_id_read";
|
|
45
|
+
readonly EXTERNAL_ID_WRITE: "_external_id_write";
|
|
46
|
+
readonly FILE_NOTIFICATION_READ: "_file_notification_read";
|
|
47
|
+
readonly FILE_NOTIFICATION_WRITE: "_file_notification_write";
|
|
48
|
+
readonly FILE_READ: "_file_read";
|
|
49
|
+
readonly FILE_WRITE: "_file_write";
|
|
50
|
+
readonly GROUP_READ: "_group_read";
|
|
51
|
+
readonly GROUP_WRITE: "_group_write";
|
|
52
|
+
readonly IMPORT_WRITE: "_import";
|
|
53
|
+
readonly ITEM_ID_READ: "_item_id_read";
|
|
54
|
+
readonly ITEM_ID_WRITE: "_item_id_write";
|
|
55
|
+
readonly ITEM_NOTIFICATION_READ: "_item_notification_read";
|
|
56
|
+
readonly ITEM_NOTIFICATION_WRITE: "_item_notification_write";
|
|
57
|
+
readonly ITEM_WRITE: "_item_write";
|
|
58
|
+
readonly ITEM_SEARCH: "_item_search";
|
|
59
|
+
readonly ITEM_SHAPE_READ: "_item_shape_read";
|
|
60
|
+
readonly ITEM_SHAPE_WRITE: "_item_shape_write";
|
|
61
|
+
readonly ITEM_TIMELINE_READ: "_item_timeline_read";
|
|
62
|
+
readonly ITEM_TIMELINE_WRITE: "_item_timeline_write";
|
|
63
|
+
readonly ITEM_URI: "_item_uri";
|
|
64
|
+
readonly JOB_NOTIFICATION_READ: "_job_notification_read";
|
|
65
|
+
readonly JOB_NOTIFICATION_WRITE: "_job_notification_write";
|
|
66
|
+
readonly JOB_READ: "_job_read";
|
|
67
|
+
readonly JOB_WRITE: "_job_write";
|
|
68
|
+
readonly LIBRARY_READ: "_library_read";
|
|
69
|
+
readonly LIBRARY_WRITE: "_library_write";
|
|
70
|
+
readonly LOCK_READ: "_lock_read";
|
|
71
|
+
readonly LOCK_WRITE: "_lock_write";
|
|
72
|
+
readonly LOG_READ: "_log_read";
|
|
73
|
+
readonly METADATA_DATASET_READ: "_metadata_dataset_read";
|
|
74
|
+
readonly METADATA_DATASET_WRITE: "_metadata_dataset_write";
|
|
75
|
+
readonly METADATA_FIELD_GROUP_READ: "_metadata_field_group_read";
|
|
76
|
+
readonly METADATA_FIELD_GROUP_WRITE: "_metadata_field_group_write";
|
|
77
|
+
readonly METADATA_FIELD_READ: "_metadata_field_read";
|
|
78
|
+
readonly METADATA_FIELD_WRITE: "_metadata_field_write";
|
|
79
|
+
readonly METADATA_GLOBAL_READ: "_metadata_global_read";
|
|
80
|
+
readonly METADATA_GLOBAL_WRITE: "_metadata_global_write";
|
|
81
|
+
readonly METADATA_LOCK_READ: "_metadata_lock_read";
|
|
82
|
+
readonly METADATA_LOCK_WRITE: "_metadata_lock_write";
|
|
83
|
+
readonly METADATA_READ: "_metadata_read";
|
|
84
|
+
readonly METADATA_SCHEMA_READ: "_metadata_schema_read";
|
|
85
|
+
readonly METADATA_SCHEMA_WRITE: "_metadata_schema_write";
|
|
86
|
+
readonly METADATA_WRITE: "_metadata_write";
|
|
87
|
+
readonly OTIF_ANALYZE: "_otif_analyze";
|
|
88
|
+
readonly OTIF_READ: "_otif_read";
|
|
89
|
+
readonly OTIF_WRITE: "_otif_write";
|
|
90
|
+
readonly PLACEHOLDER_NOTIFICATION_READ: "_placeholder_notification_read";
|
|
91
|
+
readonly PLACEHOLDER_NOTIFICATION_WRITE: "_placeholder_notification_write";
|
|
92
|
+
readonly PROJECTION_READ: "_projection_read";
|
|
93
|
+
readonly PROJECTION_WRITE: "_projection_write";
|
|
94
|
+
readonly QUOTA_NOTIFICATION_READ: "_quota_notification_read";
|
|
95
|
+
readonly QUOTA_NOTIFICATION_WRITE: "_quota_notification_write";
|
|
96
|
+
readonly QUOTA_READ: "_quota_read";
|
|
97
|
+
readonly QUOTA_WRITE: "_quota_write";
|
|
98
|
+
readonly RELATION_READ: "_relation_read";
|
|
99
|
+
readonly RELATION_WRITE: "_relation_write";
|
|
100
|
+
readonly RESOURCE_READ: "_resource_read";
|
|
101
|
+
readonly RESOURCE_WRITE: "_resource_write";
|
|
102
|
+
readonly RUN_AS: "_run_as";
|
|
103
|
+
readonly SEARCH: "_search";
|
|
104
|
+
readonly SEQUENCE_READ: "_sequence_read";
|
|
105
|
+
readonly SEQUENCE_WRITE: "_sequence_write";
|
|
106
|
+
readonly SHAPE_TAG_READ: "_shape_tag_read";
|
|
107
|
+
readonly SHAPE_TAG_WRITE: "_shape_tag_write";
|
|
108
|
+
readonly SITE_MANAGER: "_site_manager";
|
|
109
|
+
readonly SITE_RULE_READ: "_site_rule_read";
|
|
110
|
+
readonly SITE_RULE_WRITE: "_site_rule_write";
|
|
111
|
+
readonly STORAGE_GROUP_READ: "_storage_group_read";
|
|
112
|
+
readonly STORAGE_GROUP_WRITE: "_storage_group_write";
|
|
113
|
+
readonly STORAGE_NOTIFICATION_READ: "_storage_notification_read";
|
|
114
|
+
readonly STORAGE_NOTIFICATION_WRITE: "_storage_notification_write";
|
|
115
|
+
readonly STORAGE_READ: "_storage_read";
|
|
116
|
+
readonly STORAGE_RULE_READ: "_storage_rule_read";
|
|
117
|
+
readonly STORAGE_RULE_WRITE: "_storage_rule_write";
|
|
118
|
+
readonly STORAGE_WRITE: "_storage_write";
|
|
119
|
+
readonly SUPER_ACCESS_USER: "_super_access_user";
|
|
120
|
+
readonly TASKDEFINITION_READ: "_taskdefinition_read";
|
|
121
|
+
readonly TASKDEFINITION_WRITE: "_taskdefinition_write";
|
|
122
|
+
readonly THUMBNAIL_READ: "_thumbnail_read";
|
|
123
|
+
readonly THUMBNAIL_WRITE: "_thumbnail_write";
|
|
124
|
+
readonly TRANSCODER: "_transcoder";
|
|
125
|
+
readonly TRANSFER_READ: "_transfer_read";
|
|
126
|
+
readonly TRANSFER_WRITE: "_transfer_write";
|
|
127
|
+
readonly USER: "_user";
|
|
128
|
+
readonly VXA: "_vxa";
|
|
129
|
+
readonly VXA_READ: "_vxa_read";
|
|
130
|
+
};
|
|
131
131
|
type RoleNameTypes = keyof typeof ROLE_NAMES;
|
|
132
132
|
|
|
133
|
-
type InputValueTypes = string | boolean | number | Date;
|
|
134
|
-
/** Possible input values for the field value */
|
|
135
|
-
type InputValue = InputValueTypes | InputValueTypes[];
|
|
136
|
-
/** Input value object for the field value */
|
|
137
|
-
type InputValueObject = {
|
|
138
|
-
value: string | InputValue;
|
|
139
|
-
} & Omit<MetadataValueType, 'value'>;
|
|
140
|
-
type InputFieldValue = InputValueObject | InputValue | InputValueObject[] | InputValue[];
|
|
141
|
-
/** Input object to create field of */
|
|
142
|
-
type InputFieldObject = {
|
|
143
|
-
value: InputFieldValue;
|
|
144
|
-
} & MetadataFieldValueType;
|
|
145
|
-
/** Input to create a field of */
|
|
146
|
-
type InputField = InputFieldValue | InputFieldObject;
|
|
147
|
-
/** Input to create one or multiple groups and/or fields of */
|
|
148
|
-
type InputGroupsOrFields = InputGroup | InputGroup[] | InputField | InputField[];
|
|
149
|
-
/** Input object to create group of */
|
|
150
|
-
type InputGroup = {
|
|
151
|
-
[groupOrFieldName: string]: InputGroupsOrFields;
|
|
152
|
-
} & Partial<MetadataGroupValueType>;
|
|
153
|
-
/** Input to create a timespan of */
|
|
154
|
-
type InputTimespan = {
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
/**
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
*
|
|
167
|
-
*
|
|
168
|
-
|
|
133
|
+
type InputValueTypes = string | boolean | number | Date;
|
|
134
|
+
/** Possible input values for the field value */
|
|
135
|
+
type InputValue = InputValueTypes | InputValueTypes[];
|
|
136
|
+
/** Input value object for the field value */
|
|
137
|
+
type InputValueObject = {
|
|
138
|
+
value: string | InputValue;
|
|
139
|
+
} & Omit<MetadataValueType, 'value'>;
|
|
140
|
+
type InputFieldValue = InputValueObject | InputValue | InputValueObject[] | InputValue[];
|
|
141
|
+
/** Input object to create field of */
|
|
142
|
+
type InputFieldObject = {
|
|
143
|
+
value: InputFieldValue;
|
|
144
|
+
} & MetadataFieldValueType;
|
|
145
|
+
/** Input to create a field of */
|
|
146
|
+
type InputField = InputFieldValue | InputFieldObject;
|
|
147
|
+
/** Input to create one or multiple groups and/or fields of */
|
|
148
|
+
type InputGroupsOrFields = InputGroup | InputGroup[] | InputField | InputField[];
|
|
149
|
+
/** Input object to create group of */
|
|
150
|
+
type InputGroup = {
|
|
151
|
+
[groupOrFieldName: string]: InputGroupsOrFields;
|
|
152
|
+
} & Partial<MetadataGroupValueType>;
|
|
153
|
+
/** Input to create a timespan of */
|
|
154
|
+
type InputTimespan = {
|
|
155
|
+
/** Start for timespan */
|
|
156
|
+
start?: string | number;
|
|
157
|
+
/** End for timespan */
|
|
158
|
+
end?: string | number;
|
|
159
|
+
/** Base for timespan (typically undefined) */
|
|
160
|
+
base?: string;
|
|
161
|
+
/** Group or field metadata */
|
|
162
|
+
[groupOrFieldName: string]: InputGroupsOrFields;
|
|
163
|
+
};
|
|
164
|
+
type CreateMetadataTypeInput = InputTimespan | InputTimespan[];
|
|
165
|
+
/**
|
|
166
|
+
* Create a VidiCore metadata object from a more dense/simplified structure
|
|
167
|
+
*
|
|
168
|
+
* @param input To create VidiCore metadata object of
|
|
169
|
+
* @returns A VidiCore metadata object
|
|
170
|
+
*
|
|
171
|
+
* @category Metadata
|
|
172
|
+
*/
|
|
169
173
|
declare const createMetadataType: (input: CreateMetadataTypeInput) => MetadataType;
|
|
170
174
|
|
|
171
|
-
type ParsedValueAttributes = Partial<Omit<MetadataValueType, 'value'>>;
|
|
172
|
-
type ParsedValue<TOptions> = TOptions extends {
|
|
173
|
-
includeValueAttributes?: false;
|
|
174
|
-
} ? string : {
|
|
175
|
-
value: string;
|
|
176
|
-
} & ParsedValueAttributes;
|
|
177
|
-
type ParseValueOptions = {
|
|
178
|
-
|
|
175
|
+
type ParsedValueAttributes = Partial<Omit<MetadataValueType, 'value'>>;
|
|
176
|
+
type ParsedValue<TOptions> = TOptions extends {
|
|
177
|
+
includeValueAttributes?: false;
|
|
178
|
+
} ? string : {
|
|
179
|
+
value: string;
|
|
180
|
+
} & ParsedValueAttributes;
|
|
181
|
+
type ParseValueOptions = {
|
|
182
|
+
/** Include attributes on value (`true` for all) */
|
|
183
|
+
includeValueAttributes?: boolean | (keyof ParsedValueAttributes)[];
|
|
179
184
|
};
|
|
180
185
|
|
|
181
|
-
type ParsedValueList<TOptions> = TOptions extends {
|
|
182
|
-
joinValue?: string;
|
|
183
|
-
includeValueAttributes?: false;
|
|
184
|
-
} ? string : TOptions extends {
|
|
185
|
-
arrayOnSingleValue?: true;
|
|
186
|
-
} ? ParsedValue<TOptions>[] : ParsedValue<TOptions> | ParsedValue<TOptions>[];
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
186
|
+
type ParsedValueList<TOptions> = TOptions extends {
|
|
187
|
+
joinValue?: string;
|
|
188
|
+
includeValueAttributes?: false;
|
|
189
|
+
} ? string : TOptions extends {
|
|
190
|
+
arrayOnSingleValue?: true;
|
|
191
|
+
} ? ParsedValue<TOptions>[] : ParsedValue<TOptions> | ParsedValue<TOptions>[];
|
|
192
|
+
interface ParseValueListOptions extends ParseValueOptions {
|
|
193
|
+
/** String to join the values, (e.g. `,`) */
|
|
194
|
+
joinValue?: string;
|
|
195
|
+
/** Return values as array even if single value */
|
|
196
|
+
arrayOnSingleValue?: boolean;
|
|
197
|
+
}
|
|
191
198
|
|
|
192
|
-
type ParsedFieldAttributes = Partial<Omit<MetadataFieldValueType, 'value'>>;
|
|
193
|
-
type ParsedFieldObject<TOptions> = {
|
|
194
|
-
value: ParsedValueList<TOptions>;
|
|
195
|
-
} & ParsedFieldAttributes;
|
|
196
|
-
type ParsedField<TOptions> = TOptions extends {
|
|
197
|
-
includeFieldAttributes?: false;
|
|
198
|
-
} ? ParsedValueList<TOptions> : ParsedFieldObject<TOptions>;
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
199
|
+
type ParsedFieldAttributes = Partial<Omit<MetadataFieldValueType, 'value'>>;
|
|
200
|
+
type ParsedFieldObject<TOptions> = {
|
|
201
|
+
value: ParsedValueList<TOptions>;
|
|
202
|
+
} & ParsedFieldAttributes;
|
|
203
|
+
type ParsedField<TOptions> = TOptions extends {
|
|
204
|
+
includeFieldAttributes?: false;
|
|
205
|
+
} ? ParsedValueList<TOptions> : ParsedFieldObject<TOptions>;
|
|
206
|
+
interface ParseFieldOptions extends ParseValueListOptions {
|
|
207
|
+
/** Include attributes on field (`true` for all) */
|
|
208
|
+
includeFieldAttributes?: boolean | (keyof ParsedFieldAttributes)[];
|
|
209
|
+
}
|
|
202
210
|
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
}
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
}
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
}
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
*
|
|
232
|
-
*
|
|
233
|
-
*
|
|
234
|
-
*
|
|
235
|
-
* - with
|
|
236
|
-
* - with `
|
|
237
|
-
*
|
|
238
|
-
*
|
|
239
|
-
*
|
|
240
|
-
*
|
|
241
|
-
*
|
|
242
|
-
* @
|
|
243
|
-
|
|
211
|
+
interface ParseFieldListOptions extends ParseFieldOptions {
|
|
212
|
+
/** Return fields as list */
|
|
213
|
+
fieldAsList?: boolean;
|
|
214
|
+
/** Return fields as array even if only one field */
|
|
215
|
+
arrayOnSingleField?: boolean;
|
|
216
|
+
/** Return all fields flattened (Note: keys might be overridden) */
|
|
217
|
+
overrideField?: boolean;
|
|
218
|
+
}
|
|
219
|
+
type ParsedFieldList<TOptions> = TOptions extends {
|
|
220
|
+
fieldAsList?: true;
|
|
221
|
+
} ? ParsedField<TOptions>[] : TOptions extends {
|
|
222
|
+
arrayOnSingle?: true;
|
|
223
|
+
arrayOnSingleField?: undefined | true;
|
|
224
|
+
} | {
|
|
225
|
+
arrayOnSingleField?: true;
|
|
226
|
+
} ? {
|
|
227
|
+
[name: string]: ParsedField<TOptions>[];
|
|
228
|
+
} : TOptions extends {
|
|
229
|
+
flat?: true;
|
|
230
|
+
overrideField?: true | undefined;
|
|
231
|
+
} | {
|
|
232
|
+
overrideField?: true;
|
|
233
|
+
} ? {
|
|
234
|
+
[name: string]: ParsedField<TOptions>;
|
|
235
|
+
} : {
|
|
236
|
+
[name: string]: ParsedField<TOptions> | ParsedField<TOptions>[];
|
|
237
|
+
};
|
|
238
|
+
/**
|
|
239
|
+
* Parse a metadata field list according to selected options
|
|
240
|
+
*
|
|
241
|
+
* @remarks
|
|
242
|
+
* When parsing duplicate fields (same field name in the same field list) it will:
|
|
243
|
+
* - with default options: combine field values to one array within the same field name key
|
|
244
|
+
* - with `joinValue` enabled: join values within each field (returns array with string for each field value)
|
|
245
|
+
* - with `fieldAsList` enabled: separate fields in the list/array (as usual, even if not duplicate)
|
|
246
|
+
* - with `includeFieldAttributes` enabled: return an array of field objects
|
|
247
|
+
* - with `overrideField` enabled: return the latest duplicated field it parses
|
|
248
|
+
*
|
|
249
|
+
* @param fieldList Field list to parse
|
|
250
|
+
* @param [options=defaultOptions] Options for how to parse the field list
|
|
251
|
+
* @returns A parsed field list
|
|
252
|
+
*
|
|
253
|
+
* @category Metadata
|
|
254
|
+
*/
|
|
244
255
|
declare const parseFieldList: <TOptions extends ParseFieldListOptions = ParseFieldListOptions>(fieldList: MetadataFieldValueType[], options?: TOptions) => ParsedFieldList<TOptions>;
|
|
245
256
|
|
|
246
|
-
type ParsedGroupAttributes = Omit<MetadataGroupValueType, 'field' | 'group'>;
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
}
|
|
260
|
-
|
|
261
|
-
}
|
|
262
|
-
|
|
263
|
-
}
|
|
264
|
-
|
|
265
|
-
}
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
}
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
}
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
}
|
|
284
|
-
|
|
285
|
-
}
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
*
|
|
292
|
-
*
|
|
293
|
-
*
|
|
294
|
-
*
|
|
295
|
-
*
|
|
296
|
-
*
|
|
297
|
-
*
|
|
298
|
-
*
|
|
299
|
-
* @
|
|
300
|
-
|
|
257
|
+
type ParsedGroupAttributes = Omit<MetadataGroupValueType, 'field' | 'group'>;
|
|
258
|
+
interface ParseGroupOptions extends ParseFieldListOptions {
|
|
259
|
+
/** Include group attributes (`true` for all) */
|
|
260
|
+
includeGroupAttributes?: boolean | (keyof ParsedGroupAttributes)[];
|
|
261
|
+
/** Return groups as list */
|
|
262
|
+
groupAsList?: boolean;
|
|
263
|
+
/** Return groups as array even if only one group */
|
|
264
|
+
arrayOnSingleGroup?: boolean;
|
|
265
|
+
/** Return all groups flattened (Note: keys might be overridden) */
|
|
266
|
+
overrideGroup?: boolean;
|
|
267
|
+
}
|
|
268
|
+
type ParsedGroup<TOptions> = ((TOptions extends {
|
|
269
|
+
groupAsList?: true;
|
|
270
|
+
} ? {
|
|
271
|
+
group?: ParsedGroupList<TOptions>;
|
|
272
|
+
} : {
|
|
273
|
+
[name: string]: ParsedGroupList<TOptions>;
|
|
274
|
+
}) & (TOptions extends {
|
|
275
|
+
fieldAsList?: true;
|
|
276
|
+
} ? {
|
|
277
|
+
field?: ParsedFieldList<TOptions>;
|
|
278
|
+
} : {
|
|
279
|
+
[name: string]: ParsedFieldList<TOptions>;
|
|
280
|
+
})) & ParsedGroupAttributes;
|
|
281
|
+
type ParseGroupListOptions = ParseGroupOptions;
|
|
282
|
+
type ParsedGroupList<TOptions> = TOptions extends {
|
|
283
|
+
groupAsList?: true;
|
|
284
|
+
} ? ParsedGroup<TOptions>[] : TOptions extends {
|
|
285
|
+
arrayOnSingle?: true;
|
|
286
|
+
arrayOnSingleGroup?: true | undefined;
|
|
287
|
+
} | {
|
|
288
|
+
arrayOnSingleGroup?: true;
|
|
289
|
+
} ? {
|
|
290
|
+
[groupName: string]: ParsedGroup<TOptions>[];
|
|
291
|
+
} : TOptions extends {
|
|
292
|
+
flat?: true;
|
|
293
|
+
overrideGroup?: true | undefined;
|
|
294
|
+
} | {
|
|
295
|
+
overrideGroup?: true;
|
|
296
|
+
} ? {
|
|
297
|
+
[groupName: string]: ParsedGroup<TOptions>;
|
|
298
|
+
} : {
|
|
299
|
+
[groupName: string]: ParsedGroup<TOptions> | ParsedGroup<TOptions>[];
|
|
300
|
+
};
|
|
301
|
+
/**
|
|
302
|
+
* Parse a metadata group list according to selected options
|
|
303
|
+
*
|
|
304
|
+
* @remarks
|
|
305
|
+
* Parsing duplicate groups (same group name in the same group list) it will:
|
|
306
|
+
* - with default options: combine group objects to one array within the same group name key
|
|
307
|
+
* - with `groupAsList` enabled: return separate group objects in a list/array (as usual, even if not duplicate)
|
|
308
|
+
* - with `overrideGroup` enabled: return the latest duplicated group it parses
|
|
309
|
+
*
|
|
310
|
+
* @param groupList Group list to parse
|
|
311
|
+
* @param options options for how to parse list
|
|
312
|
+
* @returns A parsed group list
|
|
313
|
+
*
|
|
314
|
+
* @category Metadata
|
|
315
|
+
*/
|
|
301
316
|
declare const parseGroupList: <TOptions extends ParseGroupOptions = ParseGroupOptions>(groupList: MetadataGroupValueType[], options?: TOptions) => ParsedGroupList<TOptions>;
|
|
302
317
|
|
|
303
|
-
type ParsedTimespanAttributes = Omit<MetadataType['timespan'][number], 'field' | 'group'>;
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
}
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
|
|
328
|
-
|
|
329
|
-
|
|
330
|
-
|
|
331
|
-
|
|
332
|
-
|
|
333
|
-
|
|
334
|
-
|
|
335
|
-
|
|
336
|
-
*
|
|
337
|
-
*
|
|
338
|
-
*
|
|
339
|
-
|
|
340
|
-
* To ensure a flat (no array) representation when using `flat: true`, the parser will also set `overrideGroup` and `overrideField` to true (unless those are explicitly set false)
|
|
341
|
-
*
|
|
342
|
-
* @param timespan - A VidiCore metadata timespan
|
|
343
|
-
* @param options - Options to change how it is parsed
|
|
344
|
-
* @returns Timespan parsed according to options
|
|
345
|
-
*
|
|
346
|
-
* @see {@link parseGroupList} and {@link parseFieldList} for more info
|
|
347
|
-
*
|
|
348
|
-
* @category Metadata
|
|
349
|
-
*/
|
|
318
|
+
type ParsedTimespanAttributes = Omit<MetadataType['timespan'][number], 'field' | 'group'>;
|
|
319
|
+
interface ParseTimespanOptions extends ParseGroupListOptions {
|
|
320
|
+
/** Include attributes on timespan (`true` for all) */
|
|
321
|
+
includeTimespanAttributes?: boolean | (keyof ParsedTimespanAttributes)[];
|
|
322
|
+
/** Return groups, fields, and values as array */
|
|
323
|
+
arrayOnSingle?: boolean;
|
|
324
|
+
/** Flatten timespan, groups and fields (Note: keys might be overridden) */
|
|
325
|
+
flat?: boolean;
|
|
326
|
+
}
|
|
327
|
+
type ParsedTimespan<TOptions> = ((TOptions extends {
|
|
328
|
+
groupAsList?: true;
|
|
329
|
+
} ? {
|
|
330
|
+
group?: ParsedGroupList<TOptions>;
|
|
331
|
+
} : {
|
|
332
|
+
[name: string]: ParsedGroupList<TOptions>;
|
|
333
|
+
}) & (TOptions extends {
|
|
334
|
+
fieldAsList?: true;
|
|
335
|
+
} ? {
|
|
336
|
+
field?: ParsedFieldList<TOptions>;
|
|
337
|
+
} : {
|
|
338
|
+
[name: string]: ParsedFieldList<TOptions>;
|
|
339
|
+
})) & ParsedTimespanAttributes;
|
|
340
|
+
/**
|
|
341
|
+
*
|
|
342
|
+
* Parses timespan according to specified options
|
|
343
|
+
*
|
|
344
|
+
* @remarks
|
|
345
|
+
* To ensure a flat (no array) representation when using `flat: true`, the parser will also set `overrideGroup` and `overrideField` to true (unless those are explicitly set false)
|
|
346
|
+
*
|
|
347
|
+
* @param timespan - A VidiCore metadata timespan
|
|
348
|
+
* @param options - Options to change how it is parsed
|
|
349
|
+
* @returns Timespan parsed according to options
|
|
350
|
+
*
|
|
351
|
+
* @see {@link parseGroupList} and {@link parseFieldList} for more info
|
|
352
|
+
*
|
|
353
|
+
* @category Metadata
|
|
354
|
+
*/
|
|
350
355
|
declare const parseTimespan: <TOptions extends ParseTimespanOptions = ParseTimespanOptions>(timespan: MetadataType['timespan'][number], options?: TOptions) => ParsedTimespan<TOptions>;
|
|
351
356
|
|
|
352
|
-
type ParsedTimespanList<TOptions> = TOptions extends {
|
|
353
|
-
timespanAsList?: true;
|
|
354
|
-
} ? ParsedTimespan<TOptions>[] : TOptions extends {
|
|
355
|
-
flat?: true;
|
|
356
|
-
onlyGeneric?: true | undefined;
|
|
357
|
-
} | {
|
|
358
|
-
onlyGeneric?: true;
|
|
359
|
-
} ? ParsedTimespan<TOptions> : {
|
|
360
|
-
[timespanKey: string]: ParsedTimespan<TOptions>[];
|
|
361
|
-
};
|
|
362
|
-
|
|
363
|
-
|
|
364
|
-
|
|
365
|
-
|
|
366
|
-
|
|
367
|
-
|
|
368
|
-
|
|
369
|
-
/**
|
|
370
|
-
|
|
371
|
-
|
|
372
|
-
|
|
373
|
-
|
|
374
|
-
|
|
375
|
-
*
|
|
376
|
-
*
|
|
377
|
-
*
|
|
378
|
-
*
|
|
379
|
-
* @
|
|
380
|
-
|
|
357
|
+
type ParsedTimespanList<TOptions> = TOptions extends {
|
|
358
|
+
timespanAsList?: true;
|
|
359
|
+
} ? ParsedTimespan<TOptions>[] : TOptions extends {
|
|
360
|
+
flat?: true;
|
|
361
|
+
onlyGeneric?: true | undefined;
|
|
362
|
+
} | {
|
|
363
|
+
onlyGeneric?: true;
|
|
364
|
+
} ? ParsedTimespan<TOptions> : {
|
|
365
|
+
[timespanKey: string]: ParsedTimespan<TOptions>[];
|
|
366
|
+
};
|
|
367
|
+
interface ParseTimespanListOptions extends ParseTimespanOptions {
|
|
368
|
+
/** Return timespans as list */
|
|
369
|
+
timespanAsList?: boolean;
|
|
370
|
+
/** String to join timespans with (defaults to '_') */
|
|
371
|
+
joinTimespan?: string;
|
|
372
|
+
/** Sort timespanList by ascending start then end time */
|
|
373
|
+
sortTimespan?: boolean;
|
|
374
|
+
/** Return a flat representation - only one timespan with groups/fields named the same as single - of the timespan list (Note: timespans/fields/groups can be overridden) */
|
|
375
|
+
flat?: boolean;
|
|
376
|
+
/** Flatten timespans to one object with generic timespan having highest priority (Note: fields/groups might be overridden) */
|
|
377
|
+
flatTimespan?: boolean;
|
|
378
|
+
}
|
|
379
|
+
/**
|
|
380
|
+
* Parses timespanList according to specified options.
|
|
381
|
+
* The attributes can be targeted for each sub-type.
|
|
382
|
+
*
|
|
383
|
+
* @param timespanList - A Vidicore metadata timespan list
|
|
384
|
+
* @param options - Options which change how the metadataType is parsed.
|
|
385
|
+
* @returns Timespan list parsed according to options
|
|
386
|
+
*
|
|
387
|
+
* @see {@link parseTimespan} for more info
|
|
388
|
+
*
|
|
389
|
+
* @category Metadata
|
|
390
|
+
*/
|
|
381
391
|
declare const parseTimespanList: <TOptions extends ParseTimespanListOptions = ParseTimespanListOptions>(timespanList: MetadataType['timespan'], options?: TOptions) => ParsedTimespanList<TOptions>;
|
|
382
392
|
|
|
383
|
-
type ParsedMetadataAttributes = Partial<Omit<MetadataType, 'timespan' | 'revision'> & {
|
|
384
|
-
revision?: string[];
|
|
385
|
-
}>;
|
|
386
|
-
type ParsedMetadataType<TOptions> = (TOptions extends {
|
|
387
|
-
timespanAsList?: true;
|
|
388
|
-
} ? {
|
|
389
|
-
timespan: ParsedTimespanList<TOptions>;
|
|
390
|
-
} : TOptions extends {
|
|
391
|
-
flat?: true;
|
|
392
|
-
} ? ParsedTimespanList<TOptions> : {
|
|
393
|
-
[timespanKey: string]: ParsedTimespanList<TOptions>;
|
|
394
|
-
}) & (TOptions extends {
|
|
395
|
-
includeMetadataAttributes?: true | string[];
|
|
396
|
-
} ? ParsedMetadataAttributes : {});
|
|
397
|
-
|
|
398
|
-
|
|
399
|
-
|
|
400
|
-
|
|
401
|
-
|
|
402
|
-
|
|
403
|
-
|
|
404
|
-
*
|
|
405
|
-
*
|
|
406
|
-
*
|
|
407
|
-
* you
|
|
408
|
-
*
|
|
409
|
-
*
|
|
410
|
-
*
|
|
411
|
-
* @
|
|
412
|
-
*
|
|
413
|
-
* @
|
|
414
|
-
*
|
|
415
|
-
* @
|
|
416
|
-
|
|
393
|
+
type ParsedMetadataAttributes = Partial<Omit<MetadataType, 'timespan' | 'revision'> & {
|
|
394
|
+
revision?: string[];
|
|
395
|
+
}>;
|
|
396
|
+
type ParsedMetadataType<TOptions> = (TOptions extends {
|
|
397
|
+
timespanAsList?: true;
|
|
398
|
+
} ? {
|
|
399
|
+
timespan: ParsedTimespanList<TOptions>;
|
|
400
|
+
} : TOptions extends {
|
|
401
|
+
flat?: true;
|
|
402
|
+
} ? ParsedTimespanList<TOptions> : {
|
|
403
|
+
[timespanKey: string]: ParsedTimespanList<TOptions>;
|
|
404
|
+
}) & (TOptions extends {
|
|
405
|
+
includeMetadataAttributes?: true | string[];
|
|
406
|
+
} ? ParsedMetadataAttributes : {});
|
|
407
|
+
interface ParseMetadataTypeOptions extends ParseTimespanListOptions {
|
|
408
|
+
/** Include metadata attributes (`true` for all) */
|
|
409
|
+
includeMetadataAttributes?: boolean | (keyof ParsedMetadataAttributes)[];
|
|
410
|
+
/** Flatten timespans, groups and fields (Note: keys might be overridden) */
|
|
411
|
+
flat?: boolean;
|
|
412
|
+
}
|
|
413
|
+
/**
|
|
414
|
+
* Parses MetadataType according to specified options
|
|
415
|
+
*
|
|
416
|
+
* @remarks
|
|
417
|
+
* Be aware that you need to take into account that the returned groups and fields can be an array if it has multiple values or groups/fields with same name.
|
|
418
|
+
* If you are certain your metadata type won't return multiple groups/fields/values with same name or don't mind that they _might_ be overridden:
|
|
419
|
+
* you can use the option `flat` along with `joinValue` or `arrayOnSingleValue: false`.
|
|
420
|
+
*
|
|
421
|
+
* @param metadataType - A MetadataType from VidiCore
|
|
422
|
+
* @param options - Options which change how the metadataType is parsed
|
|
423
|
+
* @returns Metadata object parsed according to options
|
|
424
|
+
*
|
|
425
|
+
* @see {@link parseTimespanList} for more info
|
|
426
|
+
*
|
|
427
|
+
* @category Metadata
|
|
428
|
+
*/
|
|
417
429
|
declare function parseMetadataType<TOptions extends ParseMetadataTypeOptions = ParseMetadataTypeOptions>(metadataType: MetadataType, options?: TOptions): ParsedMetadataType<TOptions>;
|
|
418
430
|
|
|
419
|
-
/**
|
|
420
|
-
* Parse simple (key/value) metadata
|
|
421
|
-
*
|
|
422
|
-
* Not indexed metadata, available on almost all entities (storages, library, user, group, etc...)
|
|
423
|
-
*
|
|
424
|
-
* @param simpleMetadataType A VidiCore simple metadata object
|
|
425
|
-
* @returns A parsed simple metadata object
|
|
426
|
-
*
|
|
427
|
-
* @category Metadata
|
|
428
|
-
*/
|
|
429
|
-
declare const parseSimpleMetadataType: (simpleMetadataType: SimpleMetadataType) => {
|
|
430
|
-
[key: string]: string;
|
|
431
|
+
/**
|
|
432
|
+
* Parse simple (key/value) metadata
|
|
433
|
+
*
|
|
434
|
+
* Not indexed metadata, available on almost all entities (storages, library, user, group, etc...)
|
|
435
|
+
*
|
|
436
|
+
* @param simpleMetadataType A VidiCore simple metadata object
|
|
437
|
+
* @returns A parsed simple metadata object
|
|
438
|
+
*
|
|
439
|
+
* @category Metadata
|
|
440
|
+
*/
|
|
441
|
+
declare const parseSimpleMetadataType: (simpleMetadataType: SimpleMetadataType) => {
|
|
442
|
+
[key: string]: string;
|
|
431
443
|
};
|
|
432
444
|
|
|
433
|
-
type MetadataTypeToWebVttOptions = {
|
|
434
|
-
|
|
435
|
-
|
|
436
|
-
|
|
437
|
-
|
|
438
|
-
|
|
439
|
-
|
|
440
|
-
*
|
|
441
|
-
*
|
|
442
|
-
* @
|
|
443
|
-
*
|
|
444
|
-
* @
|
|
445
|
-
|
|
445
|
+
type MetadataTypeToWebVttOptions = {
|
|
446
|
+
/** Name of group containing subtitle field/text */
|
|
447
|
+
subtitleGroup?: string;
|
|
448
|
+
/** Name of field (text) to use for the subtitles */
|
|
449
|
+
subtitleField?: string;
|
|
450
|
+
};
|
|
451
|
+
/**
|
|
452
|
+
* Convert metadata subtitle groups to WebVtt subtitles
|
|
453
|
+
*
|
|
454
|
+
* @param metadataType - Vidicore metadata object (should include subtitleGroup and subtitleField)
|
|
455
|
+
* @param options - options for how to map subtitle group
|
|
456
|
+
* @returns WebVtt subtitles
|
|
457
|
+
*
|
|
458
|
+
* @category Metadata
|
|
459
|
+
*/
|
|
446
460
|
declare const metadataTypeToWebVtt: (metadataType: MetadataType, options?: MetadataTypeToWebVttOptions) => string;
|
|
447
461
|
|
|
448
|
-
/**
|
|
449
|
-
* Array with all available VidiCore system/default field group names
|
|
450
|
-
*
|
|
451
|
-
* @category Metadata
|
|
452
|
-
*/
|
|
462
|
+
/**
|
|
463
|
+
* Array with all available VidiCore system/default field group names
|
|
464
|
+
*
|
|
465
|
+
* @category Metadata
|
|
466
|
+
*/
|
|
453
467
|
declare const SYSTEM_FIELDGROUPS: readonly ["stl_subtitle", "stl_tti", "stl_gsi", "mrk_marker", "pho_validation", "pho_resource", "pho_error", "facedetect_rect", "facedetect_face", "originalTrackFilename", "stl_gsiHeader"];
|
|
454
468
|
|
|
455
|
-
/**
|
|
456
|
-
* Array with all available VidiCore system/default field names (including transient)
|
|
457
|
-
*
|
|
458
|
-
* @category Metadata
|
|
459
|
-
*/
|
|
469
|
+
/**
|
|
470
|
+
* Array with all available VidiCore system/default field names (including transient)
|
|
471
|
+
*
|
|
472
|
+
* @category Metadata
|
|
473
|
+
*/
|
|
460
474
|
declare const SYSTEM_FIELDS: readonly ["title", "user", "shapeTag", "representativeThumbnail", "representativeThumbnailNoAuth", "representativeItems", "itemId", "collectionId", "mediaType", "mimeType", "created", "startTimeCode", "startSeconds", "fieldValidationError", "schemaValidationError", "originalFilename", "originalUri", "originalAudioCodec", "originalVideoCodec", "originalHeight", "originalWidth", "originalFormat", "durationSeconds", "durationTimeCode", "solr-index", "__user", "__collection", "__collection_size", "__ancestor_collection", "__ancestor_collection_size", "__shape", "__shape_size", "__shape_last_added", "__placeholder_shape_size", "__version", "__version_count", "__storage", "__storage_size", "__shapetag_{tag}_hash_{hash}", "__storage_{tag}", "__storage_{tag}_size", "__storagegroup", "__storagegroup_size", "__sequence", "__sequence_size", "__metadata_last_modified", "__external_id", "__deletion_lock_id", "__deletion_lock_expiry", "__child_collection", "__child_collection_size", "__parent_collection", "__parent_collection_size", "__items_size", "stl_text", "stl_justification", "stl_xrelative", "stl_yrelative", "stl_vertical", "stl_verticalbase", "stl_horizontalbase", "stl_sizerelative", "stl_color", "stl_outline", "stl_outlinecolor", "stl_outlinesize", "stl_font", "stl_service", "stl_tti", "stl_gsi", "cct", "tcd", "tcf", "oet", "cd", "mnc", "cpn", "dfc", "tcp", "tcs", "tet", "tnb", "tnd", "en", "co", "tng", "rd", "mnr", "dsc", "opt", "lc", "tpt", "tn", "slr", "tns", "rn", "pub", "dsn", "ecd", "mrk_zerolength", "mrk_text", "mrk_color", "pho_resource_name", "pho_error_level", "pho_error_code", "pho_error_description", "facedetect_rect_width", "facedetect_rect_height", "facedetect_rect_y", "facedetect_rect_x", "facedetect_pid", "facedetect_rect", "trackId", "eidr_actor", "eidr_alternateId", "eidr_countryOfOrigin", "eidr_director", "eidr_id", "eidr_referentType", "eidr_releaseDate", "eidr_resourceName", "eidr_status", "eidr_sync", "ttml_div", "ttml_root", "vxa_collection_id", "vxaId", "vxaLocalPath", "tco", "cs", "ebn", "tf", "cf", "sgn", "tci", "jc", "vp", "sn"];
|
|
461
475
|
|
|
462
|
-
/**
|
|
463
|
-
* Array with all available metadata field value attributes
|
|
464
|
-
*
|
|
465
|
-
* @category Metadata
|
|
466
|
-
*/
|
|
476
|
+
/**
|
|
477
|
+
* Array with all available metadata field value attributes
|
|
478
|
+
*
|
|
479
|
+
* @category Metadata
|
|
480
|
+
*/
|
|
467
481
|
declare const FIELD_VALUE_ATTRIBUTE_KEYS: (keyof MetadataValueType)[];
|
|
468
482
|
|
|
469
|
-
/**
|
|
470
|
-
* Array with all available metadata field attributes
|
|
471
|
-
*
|
|
472
|
-
* @category Metadata
|
|
473
|
-
*/
|
|
483
|
+
/**
|
|
484
|
+
* Array with all available metadata field attributes
|
|
485
|
+
*
|
|
486
|
+
* @category Metadata
|
|
487
|
+
*/
|
|
474
488
|
declare const FIELD_ATTRIBUTE_KEYS: (keyof MetadataFieldValueType)[];
|
|
475
489
|
|
|
476
|
-
/**
|
|
477
|
-
* Array with all available metadata group attributes
|
|
478
|
-
*
|
|
479
|
-
* @category Metadata
|
|
480
|
-
*/
|
|
490
|
+
/**
|
|
491
|
+
* Array with all available metadata group attributes
|
|
492
|
+
*
|
|
493
|
+
* @category Metadata
|
|
494
|
+
*/
|
|
481
495
|
declare const GROUP_ATTRIBUTE_KEYS: (keyof MetadataGroupValueType)[];
|
|
482
496
|
|
|
483
|
-
type
|
|
484
|
-
type
|
|
485
|
-
count
|
|
486
|
-
|
|
487
|
-
|
|
488
|
-
|
|
489
|
-
*
|
|
490
|
-
*
|
|
491
|
-
* @param
|
|
492
|
-
* @
|
|
493
|
-
*
|
|
494
|
-
*
|
|
495
|
-
|
|
496
|
-
|
|
497
|
-
|
|
498
|
-
|
|
499
|
-
|
|
500
|
-
|
|
497
|
+
type CreateSearchFacetListInput = (string | SearchFacetType)[];
|
|
498
|
+
type CreateSearchFacetListOptions = {
|
|
499
|
+
count?: boolean;
|
|
500
|
+
exclude?: boolean;
|
|
501
|
+
};
|
|
502
|
+
/**
|
|
503
|
+
* Create a Vidicore search facet list
|
|
504
|
+
*
|
|
505
|
+
* @param input array of field names or actual search facet objects
|
|
506
|
+
* @param options Options for creating the facet
|
|
507
|
+
* @returns A VidiCore facet list
|
|
508
|
+
*
|
|
509
|
+
* @category Search
|
|
510
|
+
*/
|
|
511
|
+
declare const createSearchFacetList: (input?: CreateSearchFacetListInput, options?: Partial<CreateSearchFacetListOptions>) => SearchFacetType[];
|
|
512
|
+
|
|
513
|
+
type ParsedFacetList = {
|
|
514
|
+
facetName?: string;
|
|
515
|
+
fieldName?: string;
|
|
516
|
+
count?: {
|
|
517
|
+
[fieldValue: string]: number;
|
|
518
|
+
};
|
|
519
|
+
range?: {
|
|
520
|
+
start: number | string;
|
|
521
|
+
end: number | string;
|
|
522
|
+
count: number;
|
|
523
|
+
}[];
|
|
501
524
|
}[];
|
|
525
|
+
/**
|
|
526
|
+
* Parse a VidiCore facet list
|
|
527
|
+
*
|
|
528
|
+
* @param facetType A facet list to parse
|
|
529
|
+
* @returns A parsed facet list
|
|
530
|
+
*
|
|
531
|
+
* @category Search
|
|
532
|
+
*/
|
|
533
|
+
declare const parseFacetList: (facetList?: FacetType[]) => ParsedFacetList;
|
|
502
534
|
|
|
503
|
-
type ParsedFacetTypeCount = {
|
|
504
|
-
[fieldValue: string]: number;
|
|
505
|
-
};
|
|
506
|
-
/** Parsed facet type */
|
|
507
|
-
type ParsedFacetType = {
|
|
508
|
-
[fieldName: string]: ParsedFacetTypeCount;
|
|
509
|
-
};
|
|
510
|
-
/**
|
|
511
|
-
* Parse a VidiCore facet type list
|
|
512
|
-
*
|
|
513
|
-
* @param facetType A facet type list to parse
|
|
514
|
-
* @returns A parsed facet type list
|
|
515
|
-
*
|
|
516
|
-
* @category Search
|
|
517
|
-
*/
|
|
535
|
+
type ParsedFacetTypeCount = {
|
|
536
|
+
[fieldValue: string]: number;
|
|
537
|
+
};
|
|
538
|
+
/** Parsed facet type */
|
|
539
|
+
type ParsedFacetType = {
|
|
540
|
+
[fieldName: string]: ParsedFacetTypeCount;
|
|
541
|
+
};
|
|
542
|
+
/**
|
|
543
|
+
* Parse a VidiCore facet type list
|
|
544
|
+
*
|
|
545
|
+
* @param facetType A facet type list to parse
|
|
546
|
+
* @returns A parsed facet type list
|
|
547
|
+
*
|
|
548
|
+
* @category Search
|
|
549
|
+
*/
|
|
518
550
|
declare const parseFacetType: (facetType?: FacetType[]) => ParsedFacetType;
|
|
519
551
|
|
|
520
|
-
type ParseHighlightTimespanOptions = {
|
|
521
|
-
|
|
522
|
-
|
|
523
|
-
|
|
524
|
-
|
|
525
|
-
|
|
526
|
-
|
|
527
|
-
|
|
528
|
-
|
|
529
|
-
|
|
530
|
-
|
|
531
|
-
|
|
532
|
-
|
|
533
|
-
|
|
534
|
-
*
|
|
535
|
-
*
|
|
536
|
-
* @
|
|
537
|
-
|
|
552
|
+
type ParseHighlightTimespanOptions = {
|
|
553
|
+
/** Return an array if there is a single value */
|
|
554
|
+
arrayOnSingle?: boolean;
|
|
555
|
+
/** Return timespans as list */
|
|
556
|
+
timespanAsList?: boolean;
|
|
557
|
+
/** String to join the values (e.g. `,`) */
|
|
558
|
+
joinValue?: string;
|
|
559
|
+
};
|
|
560
|
+
type ParsedHighlightTimespan = {
|
|
561
|
+
start?: string;
|
|
562
|
+
end?: string;
|
|
563
|
+
[key: string]: string | string[];
|
|
564
|
+
};
|
|
565
|
+
/**
|
|
566
|
+
* Parses highlight timespan in VidiCore into key/value object.
|
|
567
|
+
* The attributes can be targeted for each sub-type.
|
|
568
|
+
* @param timespan - A VidiCore search timespan
|
|
569
|
+
* @param options - Options which change how the timespans are parsed
|
|
570
|
+
*
|
|
571
|
+
* @category Search
|
|
572
|
+
*/
|
|
538
573
|
declare const parseHighlightTimespan: (timespan: SearchResultEntryTimespanType, options: ParseHighlightTimespanOptions) => ParsedHighlightTimespan;
|
|
539
574
|
|
|
540
|
-
|
|
541
|
-
|
|
542
|
-
|
|
543
|
-
|
|
544
|
-
|
|
545
|
-
|
|
546
|
-
|
|
547
|
-
|
|
548
|
-
|
|
549
|
-
|
|
550
|
-
|
|
551
|
-
*
|
|
552
|
-
*
|
|
553
|
-
*
|
|
554
|
-
|
|
575
|
+
interface ParseHighlightTimespanListOptions extends ParseHighlightTimespanOptions {
|
|
576
|
+
/** Return parsed timespan as list (in an array) */
|
|
577
|
+
timespanAsList?: boolean;
|
|
578
|
+
/** Character to join the start/end time codes with */
|
|
579
|
+
joinTimespan?: string;
|
|
580
|
+
/** Flatten to field-name/field-value (Note: field-values may be overwritten) */
|
|
581
|
+
flat?: boolean;
|
|
582
|
+
/** Flatten timespan to object with start/end as key */
|
|
583
|
+
flatTimespan?: boolean;
|
|
584
|
+
}
|
|
585
|
+
/**
|
|
586
|
+
* Parses highlight timespans from VidiCore into key/value object.
|
|
587
|
+
* The attributes can be targeted for each sub-type.
|
|
588
|
+
*
|
|
589
|
+
* @param highlightTimespanList - A list of timespans from VidiCore.
|
|
590
|
+
* @param options - Options to change how the timespans are parsed
|
|
591
|
+
*
|
|
592
|
+
* @category Search
|
|
593
|
+
*/
|
|
555
594
|
declare const parseHighlightTimespanList: (highlightTimespanList?: SearchResultEntryTimespanType[], options?: ParseHighlightTimespanListOptions) => ParsedHighlightTimespan | ParsedHighlightTimespan[];
|
|
556
595
|
|
|
557
|
-
/**
|
|
558
|
-
* Parse Vidicore "NOW" constants to a date object
|
|
559
|
-
*
|
|
560
|
-
* Format: `NOW[+/-][number][HOUR/DAY/MONTH/YEAR(s)]` (e.g. "NOW-2HOURS")
|
|
561
|
-
*
|
|
562
|
-
* @remarks
|
|
563
|
-
* Returns an approximate date since it's created client side
|
|
564
|
-
*
|
|
565
|
-
* @param value A "NOW" constant
|
|
566
|
-
* @returns A date from the NOW constant
|
|
567
|
-
*
|
|
568
|
-
* @category Search
|
|
569
|
-
*/
|
|
596
|
+
/**
|
|
597
|
+
* Parse Vidicore "NOW" constants to a date object
|
|
598
|
+
*
|
|
599
|
+
* Format: `NOW[+/-][number][HOUR/DAY/MONTH/YEAR(s)]` (e.g. "NOW-2HOURS")
|
|
600
|
+
*
|
|
601
|
+
* @remarks
|
|
602
|
+
* Returns an approximate date since it's created client side
|
|
603
|
+
*
|
|
604
|
+
* @param value A "NOW" constant
|
|
605
|
+
* @returns A date from the NOW constant
|
|
606
|
+
*
|
|
607
|
+
* @category Search
|
|
608
|
+
*/
|
|
570
609
|
declare const parseNowDate: (value?: string) => Date;
|
|
571
610
|
|
|
572
|
-
type ParsedBaseMediaInfoType = {
|
|
573
|
-
Bit_rate_mode?: string;
|
|
574
|
-
Source?: string;
|
|
575
|
-
} & {
|
|
576
|
-
[key: string]: string;
|
|
577
|
-
};
|
|
578
|
-
type ParsedAudioMediaInfoType = ParsedBaseMediaInfoType;
|
|
579
|
-
type ParsedBinaryMediaInfoType = ParsedBaseMediaInfoType;
|
|
580
|
-
type ParsedVideoMediaInfoType = ParsedBaseMediaInfoType & {
|
|
581
|
-
Format_Settings_GOP?: string;
|
|
582
|
-
intra_dc_precision?: string;
|
|
611
|
+
type ParsedBaseMediaInfoType = {
|
|
612
|
+
Bit_rate_mode?: string;
|
|
613
|
+
Source?: string;
|
|
614
|
+
} & {
|
|
615
|
+
[key: string]: string;
|
|
616
|
+
};
|
|
617
|
+
type ParsedAudioMediaInfoType = ParsedBaseMediaInfoType;
|
|
618
|
+
type ParsedBinaryMediaInfoType = ParsedBaseMediaInfoType;
|
|
619
|
+
type ParsedVideoMediaInfoType = ParsedBaseMediaInfoType & {
|
|
620
|
+
Format_Settings_GOP?: string;
|
|
621
|
+
intra_dc_precision?: string;
|
|
583
622
|
};
|
|
584
623
|
|
|
585
|
-
type ParsedAudioComponentType = {
|
|
586
|
-
audioFormat?: string;
|
|
587
|
-
audioCodec?: string;
|
|
588
|
-
audioSamplerate?: string;
|
|
589
|
-
audioSamplerateSamples?: number;
|
|
590
|
-
audioBitDepth?: string;
|
|
591
|
-
audioBitrate?: string;
|
|
592
|
-
audioBitrateKbps?: number;
|
|
593
|
-
audioBitRateMode?: string;
|
|
594
|
-
audioChannels?: number;
|
|
595
|
-
audioMetadata?: {
|
|
596
|
-
[key: string]: string;
|
|
597
|
-
};
|
|
598
|
-
audioMediaInfo?: ParsedAudioMediaInfoType;
|
|
599
|
-
};
|
|
600
|
-
/**
|
|
601
|
-
* Parses the technical information of a AudioComponentType.
|
|
602
|
-
* @param audioComponentType - A AudioComponentType from VidiCore.
|
|
603
|
-
* @returns Parsed component object.
|
|
604
|
-
*
|
|
605
|
-
* @category Shape
|
|
606
|
-
*/
|
|
624
|
+
type ParsedAudioComponentType = {
|
|
625
|
+
audioFormat?: string;
|
|
626
|
+
audioCodec?: string;
|
|
627
|
+
audioSamplerate?: string;
|
|
628
|
+
audioSamplerateSamples?: number;
|
|
629
|
+
audioBitDepth?: string;
|
|
630
|
+
audioBitrate?: string;
|
|
631
|
+
audioBitrateKbps?: number;
|
|
632
|
+
audioBitRateMode?: string;
|
|
633
|
+
audioChannels?: number;
|
|
634
|
+
audioMetadata?: {
|
|
635
|
+
[key: string]: string;
|
|
636
|
+
};
|
|
637
|
+
audioMediaInfo?: ParsedAudioMediaInfoType;
|
|
638
|
+
};
|
|
639
|
+
/**
|
|
640
|
+
* Parses the technical information of a AudioComponentType.
|
|
641
|
+
* @param audioComponentType - A AudioComponentType from VidiCore.
|
|
642
|
+
* @returns Parsed component object.
|
|
643
|
+
*
|
|
644
|
+
* @category Shape
|
|
645
|
+
*/
|
|
607
646
|
declare const parseAudioComponent: (audioComponentType: AudioComponentType) => ParsedAudioComponentType;
|
|
608
647
|
|
|
609
|
-
type ParsedBinaryComponentType = {
|
|
610
|
-
binaryMetadata?: {
|
|
611
|
-
[key: string]: string;
|
|
612
|
-
};
|
|
613
|
-
binaryMediaInfo?: ParsedBinaryMediaInfoType;
|
|
614
|
-
};
|
|
615
|
-
/**
|
|
616
|
-
* Parses the technical information of a BinaryComponentType.
|
|
617
|
-
* @param binaryComponentType - A BinaryComponentType from VidiCore.
|
|
618
|
-
* @returns Parsed component object.
|
|
619
|
-
*
|
|
620
|
-
* @category Shape
|
|
621
|
-
*/
|
|
648
|
+
type ParsedBinaryComponentType = {
|
|
649
|
+
binaryMetadata?: {
|
|
650
|
+
[key: string]: string;
|
|
651
|
+
};
|
|
652
|
+
binaryMediaInfo?: ParsedBinaryMediaInfoType;
|
|
653
|
+
};
|
|
654
|
+
/**
|
|
655
|
+
* Parses the technical information of a BinaryComponentType.
|
|
656
|
+
* @param binaryComponentType - A BinaryComponentType from VidiCore.
|
|
657
|
+
* @returns Parsed component object.
|
|
658
|
+
*
|
|
659
|
+
* @category Shape
|
|
660
|
+
*/
|
|
622
661
|
declare const parseBinaryComponent: (binaryComponentType?: BinaryComponentType) => ParsedBinaryComponentType;
|
|
623
662
|
|
|
624
|
-
type ParsedFileType = {
|
|
625
|
-
uri?: string;
|
|
626
|
-
hash?: string;
|
|
627
|
-
fileSize?: string;
|
|
628
|
-
fileSizeBytes?: number;
|
|
629
|
-
path?: string;
|
|
630
|
-
fileName?: string;
|
|
631
|
-
fileId?: string;
|
|
632
|
-
|
|
633
|
-
|
|
634
|
-
|
|
635
|
-
|
|
636
|
-
*
|
|
637
|
-
*
|
|
638
|
-
*
|
|
639
|
-
*
|
|
640
|
-
*
|
|
641
|
-
*
|
|
642
|
-
* @
|
|
643
|
-
|
|
663
|
+
type ParsedFileType = {
|
|
664
|
+
uri?: string;
|
|
665
|
+
hash?: string;
|
|
666
|
+
fileSize?: string;
|
|
667
|
+
fileSizeBytes?: number;
|
|
668
|
+
path?: string;
|
|
669
|
+
fileName?: string;
|
|
670
|
+
fileId?: string;
|
|
671
|
+
storageId?: string;
|
|
672
|
+
folderPath?: string;
|
|
673
|
+
};
|
|
674
|
+
/**
|
|
675
|
+
* Parses a VidiCore file object
|
|
676
|
+
*
|
|
677
|
+
* @remarks
|
|
678
|
+
* File sizes are parsed with JEDEC standard (base 2)
|
|
679
|
+
*
|
|
680
|
+
* @param fileType VidiCore file object
|
|
681
|
+
* @returns A parsed file object
|
|
682
|
+
*
|
|
683
|
+
* @category File
|
|
684
|
+
*/
|
|
644
685
|
declare const parseFileType: (fileType: FileType) => ParsedFileType;
|
|
645
686
|
|
|
646
|
-
/**
|
|
647
|
-
* Parsed container component
|
|
648
|
-
*/
|
|
649
|
-
type ParsedContainerComponentType = {
|
|
650
|
-
containerFormat?: string;
|
|
651
|
-
videoFormat?: string;
|
|
652
|
-
audioFormat?: string;
|
|
653
|
-
textFormat?: string;
|
|
654
|
-
originalFilename?: string;
|
|
655
|
-
durationTimeCode?: TimeCodeType;
|
|
656
|
-
duration?: string;
|
|
657
|
-
startTimestamp?: TimeCodeType;
|
|
658
|
-
startTimecode?: TimeCodeType;
|
|
659
|
-
containerMetadata?: {
|
|
660
|
-
[key: string]: string;
|
|
661
|
-
};
|
|
662
|
-
containerMediaInfo?: ParsedBaseMediaInfoType;
|
|
663
|
-
} & ParsedFileType;
|
|
664
|
-
/**
|
|
665
|
-
* Parses the technical information of a ContainerComponentType.
|
|
666
|
-
* @param containerComponentType - A ContainerComponentType from VidiCore.
|
|
667
|
-
* @returns Parsed component object.
|
|
668
|
-
*
|
|
669
|
-
* @category Shape
|
|
670
|
-
*/
|
|
687
|
+
/**
|
|
688
|
+
* Parsed container component
|
|
689
|
+
*/
|
|
690
|
+
type ParsedContainerComponentType = {
|
|
691
|
+
containerFormat?: string;
|
|
692
|
+
videoFormat?: string;
|
|
693
|
+
audioFormat?: string;
|
|
694
|
+
textFormat?: string;
|
|
695
|
+
originalFilename?: string;
|
|
696
|
+
durationTimeCode?: TimeCodeType;
|
|
697
|
+
duration?: string;
|
|
698
|
+
startTimestamp?: TimeCodeType;
|
|
699
|
+
startTimecode?: TimeCodeType;
|
|
700
|
+
containerMetadata?: {
|
|
701
|
+
[key: string]: string;
|
|
702
|
+
};
|
|
703
|
+
containerMediaInfo?: ParsedBaseMediaInfoType;
|
|
704
|
+
} & ParsedFileType;
|
|
705
|
+
/**
|
|
706
|
+
* Parses the technical information of a ContainerComponentType.
|
|
707
|
+
* @param containerComponentType - A ContainerComponentType from VidiCore.
|
|
708
|
+
* @returns Parsed component object.
|
|
709
|
+
*
|
|
710
|
+
* @category Shape
|
|
711
|
+
*/
|
|
671
712
|
declare const parseContainerComponent: (containerComponentType?: ContainerComponentType) => ParsedContainerComponentType;
|
|
672
713
|
|
|
673
|
-
type TimeBaseInput = {
|
|
674
|
-
numerator
|
|
675
|
-
|
|
676
|
-
|
|
677
|
-
|
|
678
|
-
|
|
679
|
-
|
|
680
|
-
*
|
|
681
|
-
*
|
|
682
|
-
*
|
|
683
|
-
|
|
684
|
-
|
|
685
|
-
|
|
686
|
-
|
|
687
|
-
/**
|
|
688
|
-
|
|
689
|
-
|
|
690
|
-
|
|
691
|
-
|
|
692
|
-
|
|
693
|
-
|
|
694
|
-
*
|
|
695
|
-
|
|
696
|
-
|
|
697
|
-
|
|
698
|
-
|
|
699
|
-
*
|
|
700
|
-
|
|
701
|
-
|
|
702
|
-
|
|
703
|
-
*
|
|
704
|
-
*
|
|
705
|
-
*
|
|
706
|
-
*
|
|
707
|
-
*
|
|
708
|
-
|
|
709
|
-
|
|
710
|
-
|
|
711
|
-
|
|
712
|
-
|
|
713
|
-
|
|
714
|
-
|
|
715
|
-
|
|
716
|
-
|
|
717
|
-
|
|
718
|
-
|
|
719
|
-
|
|
720
|
-
*
|
|
721
|
-
*
|
|
722
|
-
*
|
|
723
|
-
*
|
|
724
|
-
*
|
|
725
|
-
*
|
|
726
|
-
*
|
|
727
|
-
*
|
|
728
|
-
*
|
|
729
|
-
*
|
|
730
|
-
|
|
731
|
-
|
|
732
|
-
|
|
733
|
-
|
|
734
|
-
|
|
735
|
-
|
|
736
|
-
|
|
737
|
-
|
|
738
|
-
|
|
739
|
-
|
|
740
|
-
|
|
741
|
-
|
|
742
|
-
|
|
743
|
-
*
|
|
744
|
-
*
|
|
745
|
-
|
|
746
|
-
|
|
747
|
-
|
|
714
|
+
type TimeBaseInput = {
|
|
715
|
+
/** The numerator for the TimeBase */
|
|
716
|
+
numerator?: number | string;
|
|
717
|
+
/** The denominator for the TimeBase */
|
|
718
|
+
denominator?: number | string;
|
|
719
|
+
};
|
|
720
|
+
/**
|
|
721
|
+
* TimeBase class representing the TimeBaseType in VidiCore
|
|
722
|
+
*
|
|
723
|
+
* For more info, see the [Time bases section in VidiCore API Docs](https://apidoc.vidispine.com/latest/time.html#time-bases)
|
|
724
|
+
*
|
|
725
|
+
* @category Time
|
|
726
|
+
*/
|
|
727
|
+
declare class TimeBase {
|
|
728
|
+
/** The numerator for the TimeBase */
|
|
729
|
+
numerator: number;
|
|
730
|
+
/** The denominator for the TimeBase */
|
|
731
|
+
denominator: number;
|
|
732
|
+
/**
|
|
733
|
+
* Constructor for TimeBase
|
|
734
|
+
*
|
|
735
|
+
* @param timeBaseType A TimeBaseType object
|
|
736
|
+
*/
|
|
737
|
+
constructor(timeBaseType?: TimeBaseInput);
|
|
738
|
+
/**
|
|
739
|
+
* Get TimeBase in a constant representation (e.g. "PAL") if possible, otherwise undefined
|
|
740
|
+
* @returns Constant representation of the TimeBase
|
|
741
|
+
*/
|
|
742
|
+
toConstant(): string;
|
|
743
|
+
/**
|
|
744
|
+
* Get TimeBase as a VidiCore TimeBaseType string
|
|
745
|
+
*
|
|
746
|
+
* @remarks
|
|
747
|
+
* Default format: denominator(:numerator if > 1)
|
|
748
|
+
*
|
|
749
|
+
* `constant` has precedence over `fraction` if both are true (e.g. NTSC > 30000:1001)
|
|
750
|
+
*
|
|
751
|
+
* @param options For how to display it as text
|
|
752
|
+
* @returns Text representation of the TimeBase
|
|
753
|
+
*/
|
|
754
|
+
toText(options?: {
|
|
755
|
+
/** Show time base as constant (e.g. PAL) */
|
|
756
|
+
constant?: boolean;
|
|
757
|
+
/** Show time base as fraction (25:1) even when numerator is 1 */
|
|
758
|
+
fraction?: boolean;
|
|
759
|
+
}): string;
|
|
760
|
+
/**
|
|
761
|
+
* Output TimeBase as frame rate (by default max 16 decimal places)
|
|
762
|
+
*
|
|
763
|
+
* @remarks
|
|
764
|
+
* Default format: rate with two decimals if needed (i.e. decimals are > 0)
|
|
765
|
+
*
|
|
766
|
+
* `rounded` has precedence over `fixed`
|
|
767
|
+
*
|
|
768
|
+
* @param options On how to return the rate
|
|
769
|
+
*
|
|
770
|
+
* @return Rate of the TimeBase
|
|
771
|
+
*/
|
|
772
|
+
toRate(options?: {
|
|
773
|
+
/** Rounded to nearest integer */
|
|
774
|
+
rounded?: boolean;
|
|
775
|
+
/** Amount of decimal places
|
|
776
|
+
* - `true` two decimal places
|
|
777
|
+
* - `false` max amount of decimal places
|
|
778
|
+
* - `number` that amount of decimal places
|
|
779
|
+
*/
|
|
780
|
+
fixed?: boolean | number;
|
|
781
|
+
}): number;
|
|
782
|
+
/**
|
|
783
|
+
* Get TimeBase in a object representation
|
|
784
|
+
*
|
|
785
|
+
* @returns TimeBase as `{denominator, numerator}` object
|
|
786
|
+
*/
|
|
787
|
+
toObject(): TimeBaseType;
|
|
788
|
+
/**
|
|
789
|
+
* @deprecated Use {@link TimeBase#toObject | toObject} instead
|
|
790
|
+
*
|
|
791
|
+
* @returns TimeBase as `{denominator, numerator}` object
|
|
792
|
+
*/
|
|
793
|
+
toJson(): TimeBaseType;
|
|
748
794
|
}
|
|
749
795
|
|
|
750
|
-
/**
|
|
751
|
-
* Create a TimeBase Instance from a number, string or object representation of a time base
|
|
752
|
-
*
|
|
753
|
-
* @param timeBase Input to create time base from
|
|
754
|
-
* @returns A TimeBase instance
|
|
755
|
-
*
|
|
756
|
-
* @category Time
|
|
757
|
-
*/
|
|
796
|
+
/**
|
|
797
|
+
* Create a TimeBase Instance from a number, string or object representation of a time base
|
|
798
|
+
*
|
|
799
|
+
* @param timeBase Input to create time base from
|
|
800
|
+
* @returns A TimeBase instance
|
|
801
|
+
*
|
|
802
|
+
* @category Time
|
|
803
|
+
*/
|
|
758
804
|
declare const createTimeBase: (timeBase: TimeBaseInput | string | number) => TimeBase;
|
|
759
805
|
|
|
760
|
-
/**
|
|
761
|
-
* Format a string representation of a time base to a TimeBase Instance
|
|
762
|
-
*
|
|
763
|
-
* @param timeBaseText The string to format to a TimeBase instance
|
|
764
|
-
* @returns A TimeBase Instance
|
|
765
|
-
*
|
|
766
|
-
* @category Time
|
|
767
|
-
*/
|
|
806
|
+
/**
|
|
807
|
+
* Format a string representation of a time base to a TimeBase Instance
|
|
808
|
+
*
|
|
809
|
+
* @param timeBaseText The string to format to a TimeBase instance
|
|
810
|
+
* @returns A TimeBase Instance
|
|
811
|
+
*
|
|
812
|
+
* @category Time
|
|
813
|
+
*/
|
|
768
814
|
declare const formatTimeBaseText: (timeBaseText?: string | number) => TimeBase;
|
|
769
815
|
|
|
770
|
-
/**
|
|
771
|
-
* Create a TimeBase instance of an object
|
|
772
|
-
*
|
|
773
|
-
* @param timeBase A TimeBase object
|
|
774
|
-
* @returns A TimeBase instance
|
|
775
|
-
*
|
|
776
|
-
* @category Time
|
|
777
|
-
*/
|
|
816
|
+
/**
|
|
817
|
+
* Create a TimeBase instance of an object
|
|
818
|
+
*
|
|
819
|
+
* @param timeBase A TimeBase object
|
|
820
|
+
* @returns A TimeBase instance
|
|
821
|
+
*
|
|
822
|
+
* @category Time
|
|
823
|
+
*/
|
|
778
824
|
declare const formatTimeBaseType: (timeBase: TimeBaseInput) => TimeBase;
|
|
779
825
|
|
|
780
|
-
type TimeCodeInput = {
|
|
781
|
-
samples
|
|
782
|
-
|
|
783
|
-
|
|
784
|
-
|
|
785
|
-
|
|
786
|
-
|
|
787
|
-
|
|
788
|
-
|
|
789
|
-
|
|
790
|
-
|
|
791
|
-
|
|
792
|
-
|
|
793
|
-
*
|
|
794
|
-
|
|
795
|
-
|
|
796
|
-
|
|
797
|
-
|
|
798
|
-
|
|
799
|
-
|
|
800
|
-
/**
|
|
801
|
-
|
|
802
|
-
|
|
803
|
-
|
|
804
|
-
|
|
805
|
-
|
|
806
|
-
|
|
807
|
-
|
|
808
|
-
|
|
809
|
-
*
|
|
810
|
-
*
|
|
811
|
-
*
|
|
812
|
-
*
|
|
813
|
-
|
|
814
|
-
|
|
815
|
-
|
|
816
|
-
*
|
|
817
|
-
*
|
|
818
|
-
|
|
819
|
-
|
|
820
|
-
|
|
821
|
-
*
|
|
822
|
-
*
|
|
823
|
-
*
|
|
824
|
-
*
|
|
825
|
-
*
|
|
826
|
-
*
|
|
827
|
-
*
|
|
828
|
-
*
|
|
829
|
-
|
|
830
|
-
|
|
831
|
-
|
|
832
|
-
|
|
833
|
-
|
|
834
|
-
*
|
|
835
|
-
*
|
|
836
|
-
*
|
|
837
|
-
*
|
|
838
|
-
|
|
839
|
-
*
|
|
840
|
-
* @
|
|
841
|
-
|
|
842
|
-
|
|
843
|
-
|
|
844
|
-
*
|
|
845
|
-
|
|
846
|
-
|
|
847
|
-
|
|
848
|
-
*
|
|
849
|
-
*
|
|
850
|
-
*
|
|
851
|
-
*
|
|
852
|
-
* @
|
|
853
|
-
*
|
|
854
|
-
* @
|
|
855
|
-
|
|
856
|
-
|
|
857
|
-
|
|
858
|
-
|
|
859
|
-
|
|
860
|
-
|
|
861
|
-
|
|
862
|
-
*
|
|
863
|
-
*
|
|
864
|
-
*
|
|
865
|
-
|
|
866
|
-
|
|
867
|
-
|
|
868
|
-
|
|
869
|
-
|
|
870
|
-
|
|
871
|
-
|
|
872
|
-
|
|
873
|
-
|
|
874
|
-
|
|
875
|
-
|
|
876
|
-
|
|
877
|
-
|
|
878
|
-
|
|
879
|
-
|
|
880
|
-
|
|
881
|
-
|
|
882
|
-
|
|
883
|
-
|
|
884
|
-
|
|
885
|
-
|
|
886
|
-
|
|
887
|
-
|
|
888
|
-
|
|
889
|
-
|
|
890
|
-
|
|
891
|
-
|
|
892
|
-
|
|
893
|
-
*
|
|
894
|
-
*
|
|
895
|
-
* - "
|
|
896
|
-
*
|
|
897
|
-
*
|
|
898
|
-
|
|
899
|
-
|
|
900
|
-
|
|
901
|
-
|
|
902
|
-
|
|
903
|
-
|
|
904
|
-
|
|
905
|
-
|
|
906
|
-
|
|
907
|
-
*
|
|
908
|
-
|
|
909
|
-
|
|
910
|
-
|
|
911
|
-
|
|
912
|
-
/**
|
|
913
|
-
* Get TimeCode in a
|
|
914
|
-
*
|
|
915
|
-
*
|
|
916
|
-
|
|
917
|
-
|
|
918
|
-
|
|
919
|
-
*
|
|
920
|
-
*
|
|
921
|
-
*
|
|
922
|
-
|
|
923
|
-
|
|
924
|
-
|
|
925
|
-
|
|
926
|
-
|
|
927
|
-
|
|
928
|
-
* @
|
|
929
|
-
*
|
|
930
|
-
|
|
931
|
-
|
|
932
|
-
|
|
933
|
-
|
|
934
|
-
|
|
935
|
-
|
|
826
|
+
type TimeCodeInput = {
|
|
827
|
+
/** Amount of samples for the time code */
|
|
828
|
+
samples?: number | string;
|
|
829
|
+
/** The time base for the time code */
|
|
830
|
+
timeBase?: string | TimeBaseInput | TimeBase;
|
|
831
|
+
};
|
|
832
|
+
type TimeCodeInputOptions = {
|
|
833
|
+
/** If time code is dropFrame or not (by default checks timeBase) */
|
|
834
|
+
dropFrame?: boolean;
|
|
835
|
+
/** Separator for frame in smpte output (default ":" for non-drop-frame and ";" for dropFrame) */
|
|
836
|
+
frameSeparator?: string;
|
|
837
|
+
};
|
|
838
|
+
/**
|
|
839
|
+
* TimeCode class representing the TimeCodeType in VidiCore
|
|
840
|
+
*
|
|
841
|
+
* For more info, see the [Time Codes section of VidiCore API Docs](https://apidoc.vidispine.com/latest/time.html#time-codes)
|
|
842
|
+
*
|
|
843
|
+
* @category Time
|
|
844
|
+
*/
|
|
845
|
+
declare class TimeCode {
|
|
846
|
+
/** Amount of samples for the time code */
|
|
847
|
+
samples: number;
|
|
848
|
+
/** The time base for the time code */
|
|
849
|
+
timeBase: TimeBase;
|
|
850
|
+
/** If time code is dropFrame or not (by default checks timeBase) */
|
|
851
|
+
dropFrame: boolean;
|
|
852
|
+
/** Separator for frame in smpte output (default ":" for non dropFrame and ";" for dropFrame) */
|
|
853
|
+
frameSeparator: string;
|
|
854
|
+
/**
|
|
855
|
+
* Constructor for TimeCode
|
|
856
|
+
*
|
|
857
|
+
* @param timeCodeType Object to create TimeCode of
|
|
858
|
+
* @param options Options for the timeCode
|
|
859
|
+
*/
|
|
860
|
+
constructor(timeCodeType: TimeCodeInput, options?: TimeCodeInputOptions);
|
|
861
|
+
/**
|
|
862
|
+
* Return this TimeCode added with the supplied timeCodeType
|
|
863
|
+
* - If time bases differ, it will retain the time base of this TimeCode instance
|
|
864
|
+
* - If supplied time code has a more granular time base, it will round down exceeding samples (hasn't reached that sample yet)
|
|
865
|
+
*
|
|
866
|
+
* @remarks
|
|
867
|
+
* If you don't want to "lose" frames in the manner described above, make sure time code you're operating on has higher time base granularity
|
|
868
|
+
*
|
|
869
|
+
* To exemplify:
|
|
870
|
+
* - "51@50".add("25@25") => "101@50"
|
|
871
|
+
* - while "25@25".add("51@50") => "50@25"
|
|
872
|
+
*
|
|
873
|
+
* @param timeCode A TimeCode instance you want to add with
|
|
874
|
+
* @returns A new TimeCode instance with the addition applied
|
|
875
|
+
*/
|
|
876
|
+
add(timeCode: TimeCode): TimeCode;
|
|
877
|
+
/**
|
|
878
|
+
* Return this TimeCode subtracted with the supplied timeCodeType
|
|
879
|
+
* - If time bases differ, it will retain the time base of the instance time code
|
|
880
|
+
* - If supplied time code has a more granular time base, it will round down exceeding samples (hasn't reached that sample yet)
|
|
881
|
+
*
|
|
882
|
+
* @remarks
|
|
883
|
+
* If you don't want to "lose" frames in the manner described above, make sure time code you're operating on has higher time base granularity
|
|
884
|
+
|
|
885
|
+
* To exemplify:
|
|
886
|
+
* - "101@50".subtract("25@25") => "51@50"
|
|
887
|
+
* - while "50@25".subtract("51@50") => "25@25"
|
|
888
|
+
*
|
|
889
|
+
* @param timeCode A TimeCode instance you want to subtract with
|
|
890
|
+
* @returns A new TimeCode instance with the subtraction applied
|
|
891
|
+
*/
|
|
892
|
+
subtract(timeCode: TimeCode): TimeCode;
|
|
893
|
+
/**
|
|
894
|
+
* Creates a new TimeCode instance with specified timeBase and samples adjusted to that.
|
|
895
|
+
*
|
|
896
|
+
* @remarks
|
|
897
|
+
* If it conforms to a less granular time base - it will floor samples (hasn't reached that sample yet)
|
|
898
|
+
* - e.g. "51@50".conformTo("PAL") => "25@PAL" (not "26@PAL")
|
|
899
|
+
*
|
|
900
|
+
* @param timeBase The TimeBase it should conform the TimeCode to
|
|
901
|
+
* @param options Explicitly set TimeCode options, by default these are derived from `timeBase`
|
|
902
|
+
* @returns A new TimeCode instance with the conformTo timeBase applied
|
|
903
|
+
*/
|
|
904
|
+
conformTimeBase(timeBase: TimeCodeInput['timeBase'], options?: TimeCodeInputOptions): TimeCode;
|
|
905
|
+
/**
|
|
906
|
+
* Get TimeCode as a text representation
|
|
907
|
+
*
|
|
908
|
+
* @remarks
|
|
909
|
+
* Default format: `samples@denominator[:numerator (if > 1)])`
|
|
910
|
+
*
|
|
911
|
+
* `constant` has precedence over `fraction` if both are true
|
|
912
|
+
*
|
|
913
|
+
* @param options Options for how to format text
|
|
914
|
+
* @returns Text representation of TimeCode
|
|
915
|
+
*/
|
|
916
|
+
toText(options?: {
|
|
917
|
+
/** Include time base even if seconds (i.e. append @1 or @1:1) */
|
|
918
|
+
includeTimeBaseForSeconds?: boolean;
|
|
919
|
+
/** show as constant (e.g. @PAL) */
|
|
920
|
+
constant?: boolean;
|
|
921
|
+
/** show as fraction (e.g. @25:1) */
|
|
922
|
+
fraction?: boolean;
|
|
923
|
+
}): string;
|
|
924
|
+
/**
|
|
925
|
+
* Get TimeCode in a units object representation
|
|
926
|
+
*
|
|
927
|
+
* @remarks
|
|
928
|
+
* If samples is `Infinity` it also returns `Infinity` for all units
|
|
929
|
+
*
|
|
930
|
+
* @returns Units (time and frames) for the time code
|
|
931
|
+
*/
|
|
932
|
+
toUnits(): {
|
|
933
|
+
hours: number;
|
|
934
|
+
minutes: number;
|
|
935
|
+
seconds: number;
|
|
936
|
+
frames: number;
|
|
937
|
+
};
|
|
938
|
+
/**
|
|
939
|
+
* Get TimeCode in a time object representation
|
|
940
|
+
*
|
|
941
|
+
* Note: "milliseconds" is rounded down - use "partialSeconds" for another representation
|
|
942
|
+
*
|
|
943
|
+
* @returns Time for the time code
|
|
944
|
+
*/
|
|
945
|
+
toTime(): {
|
|
946
|
+
hours: number;
|
|
947
|
+
minutes: number;
|
|
948
|
+
seconds: number;
|
|
949
|
+
milliseconds: number;
|
|
950
|
+
partialSeconds: number;
|
|
951
|
+
};
|
|
952
|
+
/**
|
|
953
|
+
* Get TimeCode in a seconds representation
|
|
954
|
+
*
|
|
955
|
+
* @returns Total seconds for the time code
|
|
956
|
+
*/
|
|
957
|
+
toSeconds(): number;
|
|
958
|
+
/**
|
|
959
|
+
* Get TimeCode in a duration representation
|
|
960
|
+
*
|
|
961
|
+
* The time unit keys for the format string are:
|
|
962
|
+
* - `h` for hour
|
|
963
|
+
* - `m` for minute
|
|
964
|
+
* - `s` for seconds
|
|
965
|
+
* - `S` for milliseconds
|
|
966
|
+
* - Any other char will be kept in the duration output string
|
|
967
|
+
*
|
|
968
|
+
* Note: Add several consecutive chars for zero padding.
|
|
969
|
+
*
|
|
970
|
+
* By default it:
|
|
971
|
+
* - uses colon delimiter (e.g. for format "hhmmss")
|
|
972
|
+
* - shows "m:ss" or "h:mm:ss" if format is undefined
|
|
973
|
+
*
|
|
974
|
+
* @param options Options for how to display duration
|
|
975
|
+
* @returns Duration representation of the TimeCode
|
|
976
|
+
*/
|
|
977
|
+
toDuration(options?: {
|
|
978
|
+
/** Specify format of duration string, (e.g. `hh:mm:ss.S` for "01:23:04.5") */
|
|
979
|
+
format?: string;
|
|
980
|
+
}): string;
|
|
981
|
+
/**
|
|
982
|
+
* Get TimeCode in a smpte representation
|
|
983
|
+
*
|
|
984
|
+
* @returns Smpte representation of the TimeCode
|
|
985
|
+
*/
|
|
986
|
+
toSmpte(): string;
|
|
987
|
+
/**
|
|
988
|
+
* Get TimeCode as a VidiCore TimeCodeType object
|
|
989
|
+
*
|
|
990
|
+
* @returns TimeCode as `{ samples, timeBase }`
|
|
991
|
+
*/
|
|
992
|
+
toObject(): {
|
|
993
|
+
samples: number;
|
|
994
|
+
timeBase: _vidispine_types.RationalType;
|
|
995
|
+
};
|
|
996
|
+
/**
|
|
997
|
+
* @deprecated Use {@link TimeCode#toObject | toObject} instead
|
|
998
|
+
*
|
|
999
|
+
* @returns TimeCode as `{ samples, timeBase }`
|
|
1000
|
+
*/
|
|
1001
|
+
toJson(): {
|
|
1002
|
+
samples: number;
|
|
1003
|
+
timeBase: _vidispine_types.RationalType;
|
|
1004
|
+
};
|
|
936
1005
|
}
|
|
937
1006
|
|
|
938
|
-
|
|
939
|
-
|
|
940
|
-
|
|
941
|
-
|
|
942
|
-
|
|
943
|
-
|
|
944
|
-
|
|
945
|
-
|
|
946
|
-
|
|
947
|
-
|
|
948
|
-
|
|
949
|
-
|
|
950
|
-
|
|
951
|
-
|
|
952
|
-
|
|
953
|
-
*
|
|
954
|
-
*
|
|
955
|
-
* @
|
|
956
|
-
*
|
|
957
|
-
*
|
|
958
|
-
|
|
1007
|
+
interface FormatTimeCodeSecondsOptions extends TimeCodeInputOptions {
|
|
1008
|
+
/**
|
|
1009
|
+
* The TimeBase the output TimeCode should have
|
|
1010
|
+
*
|
|
1011
|
+
* Note: if unset and useGCD=false, denominator will be 10^(amount-of-decimals)
|
|
1012
|
+
*/
|
|
1013
|
+
timeBase?: number | string | TimeBaseInput;
|
|
1014
|
+
/**
|
|
1015
|
+
* Samples and denominator are divided with GCD
|
|
1016
|
+
*
|
|
1017
|
+
* e.g. `1.04 => 104@100 => 26@25` (if no explicit `timeBase` is set)
|
|
1018
|
+
*/
|
|
1019
|
+
useGCD?: boolean;
|
|
1020
|
+
}
|
|
1021
|
+
/**
|
|
1022
|
+
* Format seconds to TimeCode object
|
|
1023
|
+
*
|
|
1024
|
+
* @remarks
|
|
1025
|
+
* Input time base is always considered as 1:1 since it expects seconds as input
|
|
1026
|
+
*
|
|
1027
|
+
* Note: Max 15 digits accuracy (double precision float64), e.g.
|
|
1028
|
+
* - 10^6 seconds can have 10^9 decimals (nanosecond) precision
|
|
1029
|
+
* - 10^9 seconds can have 10^6 decimals (microsecond) precision
|
|
1030
|
+
* - 10^12 seconds can have 10^3 decimals (millisecond) precision
|
|
1031
|
+
*
|
|
1032
|
+
* @param seconds With or without decimals ("." and "," are both interpreted as decimal)
|
|
1033
|
+
* @param options Options for how to format the seconds to a TimeCode
|
|
1034
|
+
* @returns A TimeCode instance
|
|
1035
|
+
*
|
|
1036
|
+
* @category Time
|
|
1037
|
+
*/
|
|
959
1038
|
declare const formatTimeCodeSeconds: (seconds: string | number, options?: FormatTimeCodeSecondsOptions) => TimeCode;
|
|
960
1039
|
|
|
961
|
-
|
|
962
|
-
|
|
963
|
-
|
|
964
|
-
|
|
965
|
-
|
|
966
|
-
}
|
|
967
|
-
/**
|
|
968
|
-
* Format smpte text to a TimeCode Instance
|
|
969
|
-
*
|
|
970
|
-
* exceedingMode
|
|
971
|
-
* -
|
|
972
|
-
* -
|
|
973
|
-
* -
|
|
974
|
-
*
|
|
975
|
-
* @param smpte String representation of smpte
|
|
976
|
-
* @param options Options for creating the time code from smpte
|
|
977
|
-
* @returns TimeCode instance created from smpte string
|
|
978
|
-
*
|
|
979
|
-
* @category Time
|
|
980
|
-
*/
|
|
1040
|
+
interface FormatTimeCodeSmpteOptions extends TimeCodeInputOptions {
|
|
1041
|
+
/** TimeBase of smpte (and consequently TimeBase of output TimeCode) */
|
|
1042
|
+
timeBase?: number | string | TimeBaseInput;
|
|
1043
|
+
/** How to handle exceeding values (default `error`) */
|
|
1044
|
+
exceedingMode?: 'add' | 'ignore' | 'error';
|
|
1045
|
+
}
|
|
1046
|
+
/**
|
|
1047
|
+
* Format smpte text to a TimeCode Instance
|
|
1048
|
+
*
|
|
1049
|
+
* Options for `exceedingMode`:
|
|
1050
|
+
* - `add` will be overflow to higher unit (e.g. PAL and 00:00:00:25 => 00:00:01:00)
|
|
1051
|
+
* - `ignore` will be truncated (e.g. PAL and 00:00:00:25 => 00:00:00:24)
|
|
1052
|
+
* - `error` will throw error (e.g. PAL and 00:00:00:25 => Error)
|
|
1053
|
+
*
|
|
1054
|
+
* @param smpte String representation of smpte
|
|
1055
|
+
* @param options Options for creating the time code from smpte
|
|
1056
|
+
* @returns TimeCode instance created from smpte string
|
|
1057
|
+
*
|
|
1058
|
+
* @category Time
|
|
1059
|
+
*/
|
|
981
1060
|
declare const formatTimeCodeSmpte: (smpte: string, options?: FormatTimeCodeSmpteOptions) => TimeCode;
|
|
982
1061
|
|
|
983
|
-
|
|
984
|
-
|
|
985
|
-
|
|
986
|
-
|
|
987
|
-
|
|
988
|
-
*
|
|
989
|
-
*
|
|
990
|
-
*
|
|
991
|
-
*
|
|
992
|
-
|
|
1062
|
+
interface FormatTimeCodeTextOptions extends TimeCodeInputOptions {
|
|
1063
|
+
/** The time base the returned TimeCode should have */
|
|
1064
|
+
timeBase?: number | string | TimeBaseInput;
|
|
1065
|
+
}
|
|
1066
|
+
/**
|
|
1067
|
+
* Format text to a TimeCode instance
|
|
1068
|
+
*
|
|
1069
|
+
* @returns A TimeCode instance
|
|
1070
|
+
*
|
|
1071
|
+
* @category Time
|
|
1072
|
+
*/
|
|
993
1073
|
declare const formatTimeCodeText: (timeCodeText?: number | string, options?: FormatTimeCodeTextOptions) => TimeCode;
|
|
994
1074
|
|
|
995
|
-
type CreateTimeCodeOptions = TimeCodeInputOptions | FormatTimeCodeSmpteOptions | FormatTimeCodeSecondsOptions | FormatTimeCodeTextOptions;
|
|
996
|
-
/**
|
|
997
|
-
* Create a TimeCode instance from smpte, seconds/samples, timeCode object or string
|
|
998
|
-
*
|
|
999
|
-
* @param timeCode Smpte, seconds/samples, timeCode object or string
|
|
1000
|
-
* @param options For the format functions
|
|
1001
|
-
* @returns A TimeCode instance
|
|
1002
|
-
*
|
|
1003
|
-
* @category Time
|
|
1004
|
-
*/
|
|
1075
|
+
type CreateTimeCodeOptions = TimeCodeInputOptions | FormatTimeCodeSmpteOptions | FormatTimeCodeSecondsOptions | FormatTimeCodeTextOptions;
|
|
1076
|
+
/**
|
|
1077
|
+
* Create a TimeCode instance from smpte, seconds/samples, timeCode object or string
|
|
1078
|
+
*
|
|
1079
|
+
* @param timeCode Smpte, seconds/samples, timeCode object or string
|
|
1080
|
+
* @param options For the format functions
|
|
1081
|
+
* @returns A TimeCode instance
|
|
1082
|
+
*
|
|
1083
|
+
* @category Time
|
|
1084
|
+
*/
|
|
1005
1085
|
declare const createTimeCode: (timeCode: TimeCodeInput | string | number, options?: CreateTimeCodeOptions) => TimeCode;
|
|
1006
1086
|
|
|
1007
|
-
/**
|
|
1008
|
-
* Format an object to a TimeCode instance
|
|
1009
|
-
*
|
|
1010
|
-
* @param timeCode To create TimeCode instance of
|
|
1011
|
-
* @param options For the TimeCode constructor
|
|
1012
|
-
* @returns A TimeCode instance
|
|
1013
|
-
*
|
|
1014
|
-
* @category Time
|
|
1015
|
-
*/
|
|
1087
|
+
/**
|
|
1088
|
+
* Format an object to a TimeCode instance
|
|
1089
|
+
*
|
|
1090
|
+
* @param timeCode To create TimeCode instance of
|
|
1091
|
+
* @param options For the TimeCode constructor
|
|
1092
|
+
* @returns A TimeCode instance
|
|
1093
|
+
*
|
|
1094
|
+
* @category Time
|
|
1095
|
+
*/
|
|
1016
1096
|
declare const formatTimeCodeType: (timeCode: TimeCodeInput, options?: TimeCodeInputOptions) => TimeCode;
|
|
1017
1097
|
|
|
1018
|
-
type ParsedVideoComponentType = {
|
|
1019
|
-
videoFormat?: string;
|
|
1020
|
-
dimension?: string;
|
|
1021
|
-
frameRate?: string | number;
|
|
1022
|
-
height?: number;
|
|
1023
|
-
width?: number;
|
|
1024
|
-
timeBase?: TimeBase;
|
|
1025
|
-
timeCode?: TimeCode;
|
|
1026
|
-
videoCodec?: string;
|
|
1027
|
-
smpte?: string;
|
|
1028
|
-
videoBitrate?: string;
|
|
1029
|
-
videoBitrateMbps?: number;
|
|
1030
|
-
fieldOrder?: string;
|
|
1031
|
-
colorSpace?: string;
|
|
1032
|
-
chromaSubsampling?: string;
|
|
1033
|
-
aspectRatio?: string;
|
|
1034
|
-
colorPrimaries?: string;
|
|
1035
|
-
videoMetadata?: {
|
|
1036
|
-
[key: string]: string;
|
|
1037
|
-
};
|
|
1038
|
-
videoMediaInfo?: ParsedVideoMediaInfoType;
|
|
1039
|
-
};
|
|
1040
|
-
/**
|
|
1041
|
-
* Parses the technical information of a VideoComponentType.
|
|
1042
|
-
* @param {Object} videoComponentType - A VideoComponentType from VidiCore.
|
|
1043
|
-
* @returns {Object} Parsed component object.
|
|
1044
|
-
*
|
|
1045
|
-
* @category Shape
|
|
1046
|
-
*/
|
|
1098
|
+
type ParsedVideoComponentType = {
|
|
1099
|
+
videoFormat?: string;
|
|
1100
|
+
dimension?: string;
|
|
1101
|
+
frameRate?: string | number;
|
|
1102
|
+
height?: number;
|
|
1103
|
+
width?: number;
|
|
1104
|
+
timeBase?: TimeBase;
|
|
1105
|
+
timeCode?: TimeCode;
|
|
1106
|
+
videoCodec?: string;
|
|
1107
|
+
smpte?: string;
|
|
1108
|
+
videoBitrate?: string;
|
|
1109
|
+
videoBitrateMbps?: number;
|
|
1110
|
+
fieldOrder?: string;
|
|
1111
|
+
colorSpace?: string;
|
|
1112
|
+
chromaSubsampling?: string;
|
|
1113
|
+
aspectRatio?: string;
|
|
1114
|
+
colorPrimaries?: string;
|
|
1115
|
+
videoMetadata?: {
|
|
1116
|
+
[key: string]: string;
|
|
1117
|
+
};
|
|
1118
|
+
videoMediaInfo?: ParsedVideoMediaInfoType;
|
|
1119
|
+
};
|
|
1120
|
+
/**
|
|
1121
|
+
* Parses the technical information of a VideoComponentType.
|
|
1122
|
+
* @param {Object} videoComponentType - A VideoComponentType from VidiCore.
|
|
1123
|
+
* @returns {Object} Parsed component object.
|
|
1124
|
+
*
|
|
1125
|
+
* @category Shape
|
|
1126
|
+
*/
|
|
1047
1127
|
declare const parseVideoComponent: (videoComponentType?: VideoComponentType) => ParsedVideoComponentType;
|
|
1048
1128
|
|
|
1049
|
-
type ParsedShapeType = {
|
|
1050
|
-
uri?: string;
|
|
1051
|
-
tag?: string;
|
|
1052
|
-
mimeType?: string;
|
|
1053
|
-
} & ParsedContainerComponentType & ParsedBinaryComponentType & ParsedAudioComponentType & ParsedVideoComponentType;
|
|
1054
|
-
/**
|
|
1055
|
-
* Parses the technical information of a ShapeType and its various components.
|
|
1056
|
-
*
|
|
1057
|
-
* Will only parse the first videoComponent, audioComponent, binaryComponent in the corresponding array.
|
|
1058
|
-
* To parse a selected component see:
|
|
1059
|
-
* - {@link parseContainerComponent}
|
|
1060
|
-
* - {@link parseVideoComponent}
|
|
1061
|
-
* - {@link parseAudioComponent}
|
|
1062
|
-
* - {@link parseBinaryComponent}
|
|
1063
|
-
* @param shapeType - A ShapeType from VidiCore.
|
|
1064
|
-
* @returns Parsed shape object.
|
|
1065
|
-
*
|
|
1066
|
-
* @category Shape
|
|
1067
|
-
*/
|
|
1129
|
+
type ParsedShapeType = {
|
|
1130
|
+
uri?: string;
|
|
1131
|
+
tag?: string;
|
|
1132
|
+
mimeType?: string;
|
|
1133
|
+
} & ParsedContainerComponentType & ParsedBinaryComponentType & ParsedAudioComponentType & ParsedVideoComponentType;
|
|
1134
|
+
/**
|
|
1135
|
+
* Parses the technical information of a ShapeType and its various components.
|
|
1136
|
+
*
|
|
1137
|
+
* Will only parse the first videoComponent, audioComponent, binaryComponent in the corresponding array.
|
|
1138
|
+
* To parse a selected component see:
|
|
1139
|
+
* - {@link parseContainerComponent}
|
|
1140
|
+
* - {@link parseVideoComponent}
|
|
1141
|
+
* - {@link parseAudioComponent}
|
|
1142
|
+
* - {@link parseBinaryComponent}
|
|
1143
|
+
* @param shapeType - A ShapeType from VidiCore.
|
|
1144
|
+
* @returns Parsed shape object.
|
|
1145
|
+
*
|
|
1146
|
+
* @category Shape
|
|
1147
|
+
*/
|
|
1068
1148
|
declare const parseShapeType: (shapeType?: ShapeType) => ParsedShapeType;
|
|
1069
1149
|
|
|
1070
|
-
/**
|
|
1071
|
-
* Const object with document types
|
|
1072
|
-
*
|
|
1073
|
-
* @category Shape
|
|
1074
|
-
*/
|
|
1075
|
-
declare const DOCUMENT_TYPES: {
|
|
1076
|
-
readonly PDF: "PDF";
|
|
1077
|
-
readonly TEXT: "TEXT";
|
|
1078
|
-
readonly MSWORD: "MSWORD";
|
|
1079
|
-
readonly JSON: "JSON";
|
|
1080
|
-
readonly XML: "XML";
|
|
1150
|
+
/**
|
|
1151
|
+
* Const object with document types
|
|
1152
|
+
*
|
|
1153
|
+
* @category Shape
|
|
1154
|
+
*/
|
|
1155
|
+
declare const DOCUMENT_TYPES: {
|
|
1156
|
+
readonly PDF: "PDF";
|
|
1157
|
+
readonly TEXT: "TEXT";
|
|
1158
|
+
readonly MSWORD: "MSWORD";
|
|
1159
|
+
readonly JSON: "JSON";
|
|
1160
|
+
readonly XML: "XML";
|
|
1081
1161
|
};
|
|
1082
1162
|
|
|
1083
|
-
/**
|
|
1084
|
-
* Const object with media types
|
|
1085
|
-
*
|
|
1086
|
-
* @category Shape
|
|
1087
|
-
*/
|
|
1088
|
-
declare const SHAPE_MEDIA_TYPES: {
|
|
1089
|
-
readonly IMAGE: "IMAGE";
|
|
1090
|
-
readonly AUDIO: "AUDIO";
|
|
1091
|
-
readonly VIDEO: "VIDEO";
|
|
1092
|
-
readonly DOCUMENT: "DOCUMENT";
|
|
1093
|
-
readonly BINARY: "BINARY";
|
|
1163
|
+
/**
|
|
1164
|
+
* Const object with media types
|
|
1165
|
+
*
|
|
1166
|
+
* @category Shape
|
|
1167
|
+
*/
|
|
1168
|
+
declare const SHAPE_MEDIA_TYPES: {
|
|
1169
|
+
readonly IMAGE: "IMAGE";
|
|
1170
|
+
readonly AUDIO: "AUDIO";
|
|
1171
|
+
readonly VIDEO: "VIDEO";
|
|
1172
|
+
readonly DOCUMENT: "DOCUMENT";
|
|
1173
|
+
readonly BINARY: "BINARY";
|
|
1094
1174
|
};
|
|
1095
1175
|
|
|
1096
|
-
type DocumentType = keyof typeof DOCUMENT_TYPES;
|
|
1097
|
-
/**
|
|
1098
|
-
* Return a const for the document type of a shape (looks at mimeType)
|
|
1099
|
-
*
|
|
1100
|
-
* @param shape A VidiCore shape
|
|
1101
|
-
* @returns The document type for a shape
|
|
1102
|
-
*
|
|
1103
|
-
* @category Shape
|
|
1104
|
-
*/
|
|
1176
|
+
type DocumentType = keyof typeof DOCUMENT_TYPES;
|
|
1177
|
+
/**
|
|
1178
|
+
* Return a const for the document type of a shape (looks at mimeType)
|
|
1179
|
+
*
|
|
1180
|
+
* @param shape A VidiCore shape
|
|
1181
|
+
* @returns The document type for a shape
|
|
1182
|
+
*
|
|
1183
|
+
* @category Shape
|
|
1184
|
+
*/
|
|
1105
1185
|
declare const getShapeDocumentType: (shape?: ShapeType) => DocumentType;
|
|
1106
1186
|
|
|
1107
|
-
type FilteredShapeListObject = {
|
|
1108
|
-
src: string;
|
|
1109
|
-
type: string;
|
|
1110
|
-
shape: ShapeType;
|
|
1111
|
-
parsedShape: ParsedShapeType;
|
|
1112
|
-
[key: string]: string | ParsedShapeType | ShapeType;
|
|
1113
|
-
};
|
|
1114
|
-
type FilterShapeSourceOption = {
|
|
1115
|
-
sortPriority?: Function;
|
|
1116
|
-
allowedMimeTypes?: string[];
|
|
1117
|
-
allowedMethods?: string[];
|
|
1118
|
-
sourceKey?: string;
|
|
1119
|
-
mimeTypeKey?: string;
|
|
1120
|
-
shapeKey?: string;
|
|
1121
|
-
parsedShapeKey?: string;
|
|
1122
|
-
};
|
|
1123
|
-
/**
|
|
1124
|
-
* Filter a shape type list to get shapes that are playable in a browser
|
|
1125
|
-
*
|
|
1126
|
-
* @param itemType
|
|
1127
|
-
* @param options
|
|
1128
|
-
* @returns
|
|
1129
|
-
*
|
|
1130
|
-
* @category Shape
|
|
1131
|
-
*/
|
|
1132
|
-
declare const filterShapeSource: (itemType: ItemType, options
|
|
1187
|
+
type FilteredShapeListObject = {
|
|
1188
|
+
src: string;
|
|
1189
|
+
type: string;
|
|
1190
|
+
shape: ShapeType;
|
|
1191
|
+
parsedShape: ParsedShapeType;
|
|
1192
|
+
[key: string]: string | ParsedShapeType | ShapeType;
|
|
1193
|
+
};
|
|
1194
|
+
type FilterShapeSourceOption = {
|
|
1195
|
+
sortPriority?: Function;
|
|
1196
|
+
allowedMimeTypes?: string[];
|
|
1197
|
+
allowedMethods?: string[];
|
|
1198
|
+
sourceKey?: string;
|
|
1199
|
+
mimeTypeKey?: string;
|
|
1200
|
+
shapeKey?: string;
|
|
1201
|
+
parsedShapeKey?: string;
|
|
1202
|
+
};
|
|
1203
|
+
/**
|
|
1204
|
+
* Filter a shape type list to get shapes that are playable in a browser
|
|
1205
|
+
*
|
|
1206
|
+
* @param itemType
|
|
1207
|
+
* @param options
|
|
1208
|
+
* @returns
|
|
1209
|
+
*
|
|
1210
|
+
* @category Shape
|
|
1211
|
+
*/
|
|
1212
|
+
declare const filterShapeSource: (itemType: ItemType, options?: FilterShapeSourceOption) => FilteredShapeListObject[];
|
|
1133
1213
|
|
|
1134
|
-
type ShapeMediaType = keyof typeof SHAPE_MEDIA_TYPES;
|
|
1135
|
-
/**
|
|
1136
|
-
* Returns a const for which media type a shape has
|
|
1137
|
-
*
|
|
1138
|
-
* @param shape
|
|
1139
|
-
* @returns
|
|
1140
|
-
*
|
|
1141
|
-
* @category Shape
|
|
1142
|
-
*/
|
|
1214
|
+
type ShapeMediaType = keyof typeof SHAPE_MEDIA_TYPES;
|
|
1215
|
+
/**
|
|
1216
|
+
* Returns a const for which media type a shape has
|
|
1217
|
+
*
|
|
1218
|
+
* @param shape
|
|
1219
|
+
* @returns
|
|
1220
|
+
*
|
|
1221
|
+
* @category Shape
|
|
1222
|
+
*/
|
|
1143
1223
|
declare const getShapeMediaType: (shape: ShapeType) => ShapeMediaType;
|
|
1144
1224
|
|
|
1145
|
-
/**
|
|
1146
|
-
* Const object with all file states in VidiCore
|
|
1147
|
-
* (see https://apidoc.vidispine.com/latest/storage/storage.html#file-states for more info)
|
|
1148
|
-
*
|
|
1149
|
-
* @category File
|
|
1150
|
-
*/
|
|
1151
|
-
declare const FILE_STATES: {
|
|
1152
|
-
/** Just created, not used. */
|
|
1153
|
-
readonly NONE: "NONE";
|
|
1154
|
-
/** Discovered or created, not yet marked as finished. */
|
|
1155
|
-
readonly OPEN: "OPEN";
|
|
1156
|
-
/** File does no longer grow. */
|
|
1157
|
-
readonly CLOSED: "CLOSED";
|
|
1158
|
-
/** The current state is not known. */
|
|
1159
|
-
readonly UNKNOWN: "UNKNOWN";
|
|
1160
|
-
/** File is missing from the file system/storage. */
|
|
1161
|
-
readonly MISSING: "MISSING";
|
|
1162
|
-
/** File has been missing for a longer period. Candidate for restoration from archive. */
|
|
1163
|
-
readonly LOST: "LOST";
|
|
1164
|
-
/** File will appear on file system/storage, transfer subsystem or transcoder will create it. */
|
|
1165
|
-
readonly TO_APPEAR: "TO_APPEAR";
|
|
1166
|
-
/** The file is no longer in use, and will be deleted at the next clean-up sweep. */
|
|
1167
|
-
readonly TO_BE_DELETED: "TO_BE_DELETED";
|
|
1168
|
-
/** File is in use by transfer subsystem or transcoder. */
|
|
1169
|
-
readonly BEING_READ: "BEING_READ";
|
|
1170
|
-
/** File is archived. */
|
|
1171
|
-
readonly ARCHIVED: "ARCHIVED";
|
|
1172
|
-
/** File will be synchronized by multi-site agent. */
|
|
1173
|
-
readonly AWAITING_SYNC: "AWAITING_SYNC";
|
|
1174
|
-
};
|
|
1225
|
+
/**
|
|
1226
|
+
* Const object with all file states in VidiCore
|
|
1227
|
+
* (see https://apidoc.vidispine.com/latest/storage/storage.html#file-states for more info)
|
|
1228
|
+
*
|
|
1229
|
+
* @category File
|
|
1230
|
+
*/
|
|
1231
|
+
declare const FILE_STATES: {
|
|
1232
|
+
/** Just created, not used. */
|
|
1233
|
+
readonly NONE: "NONE";
|
|
1234
|
+
/** Discovered or created, not yet marked as finished. */
|
|
1235
|
+
readonly OPEN: "OPEN";
|
|
1236
|
+
/** File does no longer grow. */
|
|
1237
|
+
readonly CLOSED: "CLOSED";
|
|
1238
|
+
/** The current state is not known. */
|
|
1239
|
+
readonly UNKNOWN: "UNKNOWN";
|
|
1240
|
+
/** File is missing from the file system/storage. */
|
|
1241
|
+
readonly MISSING: "MISSING";
|
|
1242
|
+
/** File has been missing for a longer period. Candidate for restoration from archive. */
|
|
1243
|
+
readonly LOST: "LOST";
|
|
1244
|
+
/** File will appear on file system/storage, transfer subsystem or transcoder will create it. */
|
|
1245
|
+
readonly TO_APPEAR: "TO_APPEAR";
|
|
1246
|
+
/** The file is no longer in use, and will be deleted at the next clean-up sweep. */
|
|
1247
|
+
readonly TO_BE_DELETED: "TO_BE_DELETED";
|
|
1248
|
+
/** File is in use by transfer subsystem or transcoder. */
|
|
1249
|
+
readonly BEING_READ: "BEING_READ";
|
|
1250
|
+
/** File is archived. */
|
|
1251
|
+
readonly ARCHIVED: "ARCHIVED";
|
|
1252
|
+
/** File will be synchronized by multi-site agent. */
|
|
1253
|
+
readonly AWAITING_SYNC: "AWAITING_SYNC";
|
|
1254
|
+
};
|
|
1175
1255
|
type FileStateTypes = keyof typeof FILE_STATES;
|
|
1176
1256
|
|
|
1177
|
-
/**
|
|
1178
|
-
* Find the thumbnail uri in a VidiCore item object that's nearest a timeCode
|
|
1179
|
-
*
|
|
1180
|
-
* @remarks
|
|
1181
|
-
* Time code is included in path of VidiCore thumbnail uris
|
|
1182
|
-
*
|
|
1183
|
-
* @param itemType A VidiCore item object
|
|
1184
|
-
* @param timeCode A timeCode to find nearest thumbnail to
|
|
1185
|
-
* @returns A URI of a thumbnail, `undefined` if item has no thumbnails
|
|
1186
|
-
*
|
|
1187
|
-
* @category Thumbnail
|
|
1188
|
-
*/
|
|
1257
|
+
/**
|
|
1258
|
+
* Find the thumbnail uri in a VidiCore item object that's nearest a timeCode
|
|
1259
|
+
*
|
|
1260
|
+
* @remarks
|
|
1261
|
+
* Time code is included in path of VidiCore thumbnail uris
|
|
1262
|
+
*
|
|
1263
|
+
* @param itemType A VidiCore item object
|
|
1264
|
+
* @param timeCode A timeCode to find nearest thumbnail to
|
|
1265
|
+
* @returns A URI of a thumbnail, `undefined` if item has no thumbnails
|
|
1266
|
+
*
|
|
1267
|
+
* @category Thumbnail
|
|
1268
|
+
*/
|
|
1189
1269
|
declare const findNearestThumbnail: (itemType: ItemType, timeCode: TimeCode | TimeCodeInput) => string;
|
|
1190
1270
|
|
|
1191
|
-
/**
|
|
1192
|
-
* TODO
|
|
1193
|
-
*/
|
|
1194
|
-
type ParsedMediaConvertTranscodePreset = {
|
|
1195
|
-
description?: string;
|
|
1196
|
-
containerFormat?: any;
|
|
1197
|
-
videoFormat?: string;
|
|
1198
|
-
height?: number;
|
|
1199
|
-
width?: number;
|
|
1200
|
-
dimension?: string;
|
|
1201
|
-
aspectRatio?: string;
|
|
1202
|
-
fieldOrder?: string;
|
|
1203
|
-
videoBitrate?: number;
|
|
1204
|
-
timeBase?: TimeBase;
|
|
1205
|
-
frameRate?: string | number;
|
|
1206
|
-
audioFormat?: string;
|
|
1207
|
-
audioSamplerate?: string;
|
|
1208
|
-
audioBitrate?: string;
|
|
1209
|
-
audioBitRateMode?: string;
|
|
1210
|
-
};
|
|
1211
|
-
/**
|
|
1212
|
-
* TODO
|
|
1213
|
-
*
|
|
1214
|
-
* @param mediaconvert
|
|
1215
|
-
* @returns
|
|
1216
|
-
*
|
|
1217
|
-
* @category Transcode
|
|
1218
|
-
*/
|
|
1271
|
+
/**
|
|
1272
|
+
* TODO
|
|
1273
|
+
*/
|
|
1274
|
+
type ParsedMediaConvertTranscodePreset = {
|
|
1275
|
+
description?: string;
|
|
1276
|
+
containerFormat?: any;
|
|
1277
|
+
videoFormat?: string;
|
|
1278
|
+
height?: number;
|
|
1279
|
+
width?: number;
|
|
1280
|
+
dimension?: string;
|
|
1281
|
+
aspectRatio?: string;
|
|
1282
|
+
fieldOrder?: string;
|
|
1283
|
+
videoBitrate?: number;
|
|
1284
|
+
timeBase?: TimeBase;
|
|
1285
|
+
frameRate?: string | number;
|
|
1286
|
+
audioFormat?: string;
|
|
1287
|
+
audioSamplerate?: string;
|
|
1288
|
+
audioBitrate?: string;
|
|
1289
|
+
audioBitRateMode?: string;
|
|
1290
|
+
};
|
|
1291
|
+
/**
|
|
1292
|
+
* TODO
|
|
1293
|
+
*
|
|
1294
|
+
* @param mediaconvert
|
|
1295
|
+
* @returns
|
|
1296
|
+
*
|
|
1297
|
+
* @category Transcode
|
|
1298
|
+
*/
|
|
1219
1299
|
declare const parseMediaConvertPreset: (mediaconvert: TranscodePresetType['mediaconvert']) => ParsedMediaConvertTranscodePreset;
|
|
1220
1300
|
|
|
1221
|
-
type ParsedTranscodePreset = {
|
|
1222
|
-
description?: string;
|
|
1223
|
-
containerFormat?: any;
|
|
1224
|
-
videoFormat?: string;
|
|
1225
|
-
height?: number;
|
|
1226
|
-
width?: number;
|
|
1227
|
-
dimension?: string;
|
|
1228
|
-
aspectRatio?: string;
|
|
1229
|
-
fieldOrder?: string;
|
|
1230
|
-
videoBitrate?: number;
|
|
1231
|
-
timeBase?: TimeBase;
|
|
1232
|
-
frameRate?: string | number;
|
|
1233
|
-
audioFormat?: string;
|
|
1234
|
-
audioSamplerate?: string;
|
|
1235
|
-
audioBitrate?: string;
|
|
1236
|
-
audioBitRateMode?: string;
|
|
1237
|
-
audioChannels?: number;
|
|
1238
|
-
};
|
|
1239
|
-
/**
|
|
1240
|
-
* Parse a VidiCore transcode preset
|
|
1241
|
-
*
|
|
1242
|
-
* @param transcodePresetType a VidiCore transcode preset
|
|
1243
|
-
* @returns A parsed transcode preset
|
|
1244
|
-
*
|
|
1245
|
-
* @category Transcode
|
|
1246
|
-
*/
|
|
1301
|
+
type ParsedTranscodePreset = {
|
|
1302
|
+
description?: string;
|
|
1303
|
+
containerFormat?: any;
|
|
1304
|
+
videoFormat?: string;
|
|
1305
|
+
height?: number;
|
|
1306
|
+
width?: number;
|
|
1307
|
+
dimension?: string;
|
|
1308
|
+
aspectRatio?: string;
|
|
1309
|
+
fieldOrder?: string;
|
|
1310
|
+
videoBitrate?: number;
|
|
1311
|
+
timeBase?: TimeBase;
|
|
1312
|
+
frameRate?: string | number;
|
|
1313
|
+
audioFormat?: string;
|
|
1314
|
+
audioSamplerate?: string;
|
|
1315
|
+
audioBitrate?: string;
|
|
1316
|
+
audioBitRateMode?: string;
|
|
1317
|
+
audioChannels?: number;
|
|
1318
|
+
};
|
|
1319
|
+
/**
|
|
1320
|
+
* Parse a VidiCore transcode preset
|
|
1321
|
+
*
|
|
1322
|
+
* @param transcodePresetType a VidiCore transcode preset
|
|
1323
|
+
* @returns A parsed transcode preset
|
|
1324
|
+
*
|
|
1325
|
+
* @category Transcode
|
|
1326
|
+
*/
|
|
1247
1327
|
declare const parseTranscodePreset: (transcodePresetType: TranscodePresetType) => ParsedTranscodePreset;
|
|
1248
1328
|
|
|
1249
|
-
|
|
1329
|
+
type ParsedFieldDefinition = {
|
|
1330
|
+
name?: string;
|
|
1331
|
+
type?: string;
|
|
1332
|
+
defaultValue?: string;
|
|
1333
|
+
restrictions?: {
|
|
1334
|
+
min?: number;
|
|
1335
|
+
max?: number;
|
|
1336
|
+
minLength?: number;
|
|
1337
|
+
maxLength?: number;
|
|
1338
|
+
pattern?: RegExp;
|
|
1339
|
+
};
|
|
1340
|
+
required?: boolean;
|
|
1341
|
+
data?: {
|
|
1342
|
+
[key: string]: string;
|
|
1343
|
+
};
|
|
1344
|
+
options?: Array<{
|
|
1345
|
+
label: string;
|
|
1346
|
+
value: string;
|
|
1347
|
+
}>;
|
|
1348
|
+
};
|
|
1349
|
+
type ParseFieldDefinitionListOptions = {};
|
|
1350
|
+
type ParsedFieldDefinitionList = ParsedFieldDefinition[];
|
|
1351
|
+
/**
|
|
1352
|
+
* Parse a metadata field definition list
|
|
1353
|
+
*
|
|
1354
|
+
* @remarks
|
|
1355
|
+
* - `values` are parsed to an options array (as `[{ label, value }, ...]`)
|
|
1356
|
+
* - Include values using the `includeValues: true` query parameter
|
|
1357
|
+
* - `restrictions.required` is parsed from restrictions having defined minInclusive or minLength > 0
|
|
1358
|
+
*
|
|
1359
|
+
* @param fieldList Field definition list to parse
|
|
1360
|
+
* @returns A parsed field list
|
|
1361
|
+
*
|
|
1362
|
+
* @category Field
|
|
1363
|
+
*/
|
|
1364
|
+
declare const parseFieldDefinitionList: (fieldList: MetadataFieldType[]) => ParsedFieldDefinitionList;
|
|
1365
|
+
|
|
1366
|
+
/**
|
|
1367
|
+
* Array with all VidiCore system field definition types
|
|
1368
|
+
*
|
|
1369
|
+
* @remarks
|
|
1370
|
+
* The `-noindex` and `-sortable` suffix for types has been replaced with boolean options in field definitions (since 4.1).
|
|
1371
|
+
*
|
|
1372
|
+
* @category Field
|
|
1373
|
+
*/
|
|
1374
|
+
declare const FIELD_DEFINITION_TYPES: readonly ["date", "float", "integer", "long", "string", "string-exact", "boolean", "timeCode"];
|
|
1375
|
+
|
|
1376
|
+
export { CreateMetadataTypeInput, CreateSearchFacetListInput, CreateSearchFacetListOptions, CreateTimeCodeOptions, DOCUMENT_TYPES, DocumentType, FIELD_ATTRIBUTE_KEYS, FIELD_DEFINITION_TYPES, FIELD_VALUE_ATTRIBUTE_KEYS, FILE_STATES, FileStateTypes, FilterShapeSourceOption, FilteredShapeListObject, FormatTimeCodeSecondsOptions, FormatTimeCodeSmpteOptions, FormatTimeCodeTextOptions, GROUP_ATTRIBUTE_KEYS, InputField, InputFieldObject, InputFieldValue, InputGroup, InputGroupsOrFields, InputTimespan, InputValue, InputValueObject, InputValueTypes, MetadataTypeToWebVttOptions, ParseFieldDefinitionListOptions, ParseFieldListOptions, ParseFieldOptions, ParseGroupListOptions, ParseGroupOptions, ParseHighlightTimespanListOptions, ParseHighlightTimespanOptions, ParseMetadataTypeOptions, ParseTimespanListOptions, ParseTimespanOptions, ParseValueListOptions, ParseValueOptions, ParsedAudioComponentType, ParsedAudioMediaInfoType, ParsedBaseMediaInfoType, ParsedBinaryComponentType, ParsedBinaryMediaInfoType, ParsedContainerComponentType, ParsedFacetList, ParsedFacetType, ParsedFacetTypeCount, ParsedField, ParsedFieldAttributes, ParsedFieldDefinitionList, ParsedFieldList, ParsedFieldObject, ParsedFileType, ParsedGroup, ParsedGroupAttributes, ParsedGroupList, ParsedHighlightTimespan, ParsedMediaConvertTranscodePreset, ParsedMetadataAttributes, ParsedMetadataType, ParsedShapeType, ParsedTimespan, ParsedTimespanAttributes, ParsedTimespanList, ParsedTranscodePreset, ParsedValue, ParsedValueAttributes, ParsedValueList, ParsedVideoComponentType, ParsedVideoMediaInfoType, ROLE_NAMES, RoleNameTypes, SHAPE_MEDIA_TYPES, SYSTEM_FIELDGROUPS, SYSTEM_FIELDS, ShapeMediaType, TimeBase, TimeBaseInput, TimeCode, TimeCodeInput, TimeCodeInputOptions, createMetadataType, createSearchFacetList, createTimeBase, createTimeCode, filterShapeSource, findNearestThumbnail, formatTimeBaseText, formatTimeBaseType, formatTimeCodeSeconds, formatTimeCodeSmpte, formatTimeCodeText, formatTimeCodeType, getShapeDocumentType, getShapeMediaType, metadataTypeToWebVtt, parseAudioComponent, parseBinaryComponent, parseContainerComponent, parseFacetList, parseFacetType, parseFieldDefinitionList, parseFieldList, parseFileType, parseGroupList, parseHighlightTimespan, parseHighlightTimespanList, parseKeyValuePairTypes as parseKeyValuePairType, parseMediaConvertPreset, parseMetadataType, parseNowDate, parseShapeType, parseSimpleMetadataType, parseTimespan, parseTimespanList, parseTranscodePreset, parseVideoComponent };
|