@vidispine/vdt-js 23.1.0 → 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 CHANGED
@@ -1,1306 +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
- /** 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
- */
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
+ */
173
173
  declare const createMetadataType: (input: CreateMetadataTypeInput) => MetadataType;
174
174
 
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)[];
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)[];
184
184
  };
185
185
 
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;
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
197
  }
198
198
 
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)[];
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
209
  }
210
210
 
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
- */
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
+ */
255
255
  declare const parseFieldList: <TOptions extends ParseFieldListOptions = ParseFieldListOptions>(fieldList: MetadataFieldValueType[], options?: TOptions) => ParsedFieldList<TOptions>;
256
256
 
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
- */
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
+ */
316
316
  declare const parseGroupList: <TOptions extends ParseGroupOptions = ParseGroupOptions>(groupList: MetadataGroupValueType[], options?: TOptions) => ParsedGroupList<TOptions>;
317
317
 
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
- */
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
+ */
355
355
  declare const parseTimespan: <TOptions extends ParseTimespanOptions = ParseTimespanOptions>(timespan: MetadataType['timespan'][number], options?: TOptions) => ParsedTimespan<TOptions>;
356
356
 
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
- */
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
+ */
391
391
  declare const parseTimespanList: <TOptions extends ParseTimespanListOptions = ParseTimespanListOptions>(timespanList: MetadataType['timespan'], options?: TOptions) => ParsedTimespanList<TOptions>;
392
392
 
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
- */
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
+ */
429
429
  declare function parseMetadataType<TOptions extends ParseMetadataTypeOptions = ParseMetadataTypeOptions>(metadataType: MetadataType, options?: TOptions): ParsedMetadataType<TOptions>;
430
430
 
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
+ /**
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;
443
443
  };
444
444
 
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
- */
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
+ */
460
460
  declare const metadataTypeToWebVtt: (metadataType: MetadataType, options?: MetadataTypeToWebVttOptions) => string;
461
461
 
462
- /**
463
- * Array with all available VidiCore system/default field group names
464
- *
465
- * @category Metadata
466
- */
462
+ /**
463
+ * Array with all available VidiCore system/default field group names
464
+ *
465
+ * @category Metadata
466
+ */
467
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"];
468
468
 
469
- /**
470
- * Array with all available VidiCore system/default field names (including transient)
471
- *
472
- * @category Metadata
473
- */
469
+ /**
470
+ * Array with all available VidiCore system/default field names (including transient)
471
+ *
472
+ * @category Metadata
473
+ */
474
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"];
475
475
 
476
- /**
477
- * Array with all available metadata field value attributes
478
- *
479
- * @category Metadata
480
- */
476
+ /**
477
+ * Array with all available metadata field value attributes
478
+ *
479
+ * @category Metadata
480
+ */
481
481
  declare const FIELD_VALUE_ATTRIBUTE_KEYS: (keyof MetadataValueType)[];
482
482
 
483
- /**
484
- * Array with all available metadata field attributes
485
- *
486
- * @category Metadata
487
- */
483
+ /**
484
+ * Array with all available metadata field attributes
485
+ *
486
+ * @category Metadata
487
+ */
488
488
  declare const FIELD_ATTRIBUTE_KEYS: (keyof MetadataFieldValueType)[];
489
489
 
490
- /**
491
- * Array with all available metadata group attributes
492
- *
493
- * @category Metadata
494
- */
490
+ /**
491
+ * Array with all available metadata group attributes
492
+ *
493
+ * @category Metadata
494
+ */
495
495
  declare const GROUP_ATTRIBUTE_KEYS: (keyof MetadataGroupValueType)[];
496
496
 
497
- type CreateFacetTypeFieldList = string[];
498
- type CreateFacetTypeOptions = {
499
- count: boolean;
500
- };
501
- /**
502
- * Create a Vidicore facet list
503
- *
504
- * @param fieldList Input to create facet of
505
- * @param options Options for creating the facet
506
- * @returns A VidiCore facet list
507
- *
508
- * @category Search
509
- */
510
- declare const createFacetType: (fieldList?: CreateFacetTypeFieldList, options?: Partial<CreateFacetTypeOptions>) => {
511
- field: string;
512
- name: string;
513
- count: boolean;
514
- exclude: CreateFacetTypeFieldList;
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
+ }[];
515
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;
516
534
 
517
- type ParsedFacetTypeCount = {
518
- [fieldValue: string]: number;
519
- };
520
- /** Parsed facet type */
521
- type ParsedFacetType = {
522
- [fieldName: string]: ParsedFacetTypeCount;
523
- };
524
- /**
525
- * Parse a VidiCore facet type list
526
- *
527
- * @param facetType A facet type list to parse
528
- * @returns A parsed facet type list
529
- *
530
- * @category Search
531
- */
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
+ */
532
550
  declare const parseFacetType: (facetType?: FacetType[]) => ParsedFacetType;
533
551
 
534
- type ParseHighlightTimespanOptions = {
535
- /** Return an array if there is a single value */
536
- arrayOnSingle?: boolean;
537
- /** Return timespans as list */
538
- timespanAsList?: boolean;
539
- /** String to join the values (e.g. `,`) */
540
- joinValue?: string;
541
- };
542
- type ParsedHighlightTimespan = {
543
- start?: string;
544
- end?: string;
545
- [key: string]: string | string[];
546
- };
547
- /**
548
- * Parses highlight timespan in VidiCore into key/value object.
549
- * The attributes can be targeted for each sub-type.
550
- * @param timespan - A VidiCore search timespan
551
- * @param options - Options which change how the timespans are parsed
552
- *
553
- * @category Search
554
- */
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
+ */
555
573
  declare const parseHighlightTimespan: (timespan: SearchResultEntryTimespanType, options: ParseHighlightTimespanOptions) => ParsedHighlightTimespan;
556
574
 
557
- interface ParseHighlightTimespanListOptions extends ParseHighlightTimespanOptions {
558
- /** Return parsed timespan as list (in an array) */
559
- timespanAsList?: boolean;
560
- /** Character to join the start/end time codes with */
561
- joinTimespan?: string;
562
- /** Flatten to field-name/field-value (Note: field-values may be overwritten) */
563
- flat?: boolean;
564
- /** Flatten timespan to object with start/end as key */
565
- flatTimespan?: boolean;
566
- }
567
- /**
568
- * Parses highlight timespans from VidiCore into key/value object.
569
- * The attributes can be targeted for each sub-type.
570
- *
571
- * @param highlightTimespanList - A list of timespans from VidiCore.
572
- * @param options - Options to change how the timespans are parsed
573
- *
574
- * @category Search
575
- */
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
+ */
576
594
  declare const parseHighlightTimespanList: (highlightTimespanList?: SearchResultEntryTimespanType[], options?: ParseHighlightTimespanListOptions) => ParsedHighlightTimespan | ParsedHighlightTimespan[];
577
595
 
578
- /**
579
- * Parse Vidicore "NOW" constants to a date object
580
- *
581
- * Format: `NOW[+/-][number][HOUR/DAY/MONTH/YEAR(s)]` (e.g. "NOW-2HOURS")
582
- *
583
- * @remarks
584
- * Returns an approximate date since it's created client side
585
- *
586
- * @param value A "NOW" constant
587
- * @returns A date from the NOW constant
588
- *
589
- * @category Search
590
- */
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
+ */
591
609
  declare const parseNowDate: (value?: string) => Date;
592
610
 
593
- type ParsedBaseMediaInfoType = {
594
- Bit_rate_mode?: string;
595
- Source?: string;
596
- } & {
597
- [key: string]: string;
598
- };
599
- type ParsedAudioMediaInfoType = ParsedBaseMediaInfoType;
600
- type ParsedBinaryMediaInfoType = ParsedBaseMediaInfoType;
601
- type ParsedVideoMediaInfoType = ParsedBaseMediaInfoType & {
602
- Format_Settings_GOP?: string;
603
- 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;
604
622
  };
605
623
 
606
- type ParsedAudioComponentType = {
607
- audioFormat?: string;
608
- audioCodec?: string;
609
- audioSamplerate?: string;
610
- audioSamplerateSamples?: number;
611
- audioBitDepth?: string;
612
- audioBitrate?: string;
613
- audioBitrateKbps?: number;
614
- audioBitRateMode?: string;
615
- audioChannels?: number;
616
- audioMetadata?: {
617
- [key: string]: string;
618
- };
619
- audioMediaInfo?: ParsedAudioMediaInfoType;
620
- };
621
- /**
622
- * Parses the technical information of a AudioComponentType.
623
- * @param audioComponentType - A AudioComponentType from VidiCore.
624
- * @returns Parsed component object.
625
- *
626
- * @category Shape
627
- */
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
+ */
628
646
  declare const parseAudioComponent: (audioComponentType: AudioComponentType) => ParsedAudioComponentType;
629
647
 
630
- type ParsedBinaryComponentType = {
631
- binaryMetadata?: {
632
- [key: string]: string;
633
- };
634
- binaryMediaInfo?: ParsedBinaryMediaInfoType;
635
- };
636
- /**
637
- * Parses the technical information of a BinaryComponentType.
638
- * @param binaryComponentType - A BinaryComponentType from VidiCore.
639
- * @returns Parsed component object.
640
- *
641
- * @category Shape
642
- */
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
+ */
643
661
  declare const parseBinaryComponent: (binaryComponentType?: BinaryComponentType) => ParsedBinaryComponentType;
644
662
 
645
- type ParsedFileType = {
646
- uri?: string;
647
- hash?: string;
648
- fileSize?: string;
649
- fileSizeBytes?: number;
650
- path?: string;
651
- fileName?: string;
652
- fileId?: string;
653
- };
654
- /**
655
- * Parses a VidiCore file object
656
- *
657
- * @remarks
658
- * File sizes are parsed with JEDEC standard (base 2)
659
- *
660
- * @param fileType VidiCore file object
661
- * @returns A parsed file object
662
- *
663
- * @category File
664
- */
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
+ */
665
685
  declare const parseFileType: (fileType: FileType) => ParsedFileType;
666
686
 
667
- /**
668
- * Parsed container component
669
- */
670
- type ParsedContainerComponentType = {
671
- containerFormat?: string;
672
- videoFormat?: string;
673
- audioFormat?: string;
674
- textFormat?: string;
675
- originalFilename?: string;
676
- durationTimeCode?: TimeCodeType;
677
- duration?: string;
678
- startTimestamp?: TimeCodeType;
679
- startTimecode?: TimeCodeType;
680
- containerMetadata?: {
681
- [key: string]: string;
682
- };
683
- containerMediaInfo?: ParsedBaseMediaInfoType;
684
- } & ParsedFileType;
685
- /**
686
- * Parses the technical information of a ContainerComponentType.
687
- * @param containerComponentType - A ContainerComponentType from VidiCore.
688
- * @returns Parsed component object.
689
- *
690
- * @category Shape
691
- */
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
+ */
692
712
  declare const parseContainerComponent: (containerComponentType?: ContainerComponentType) => ParsedContainerComponentType;
693
713
 
694
- type TimeBaseInput = {
695
- /** The numerator for the TimeBase */
696
- numerator?: number | string;
697
- /** The denominator for the TimeBase */
698
- denominator?: number | string;
699
- };
700
- /**
701
- * TimeBase class representing the TimeBaseType in VidiCore
702
- *
703
- * For more info, see the [Time bases section in VidiCore API Docs](https://apidoc.vidispine.com/latest/time.html#time-bases)
704
- *
705
- * @category Time
706
- */
707
- declare class TimeBase {
708
- /** The numerator for the TimeBase */
709
- numerator: number;
710
- /** The denominator for the TimeBase */
711
- denominator: number;
712
- /**
713
- * Constructor for TimeBase
714
- *
715
- * @param timeBaseType A TimeBaseType object
716
- */
717
- constructor(timeBaseType?: TimeBaseInput);
718
- /**
719
- * Get TimeBase in a constant representation (e.g. "PAL") if possible, otherwise undefined
720
- * @returns Constant representation of the TimeBase
721
- */
722
- toConstant(): string;
723
- /**
724
- * Get TimeBase as a VidiCore TimeBaseType string
725
- *
726
- * @remarks
727
- * Default format: denominator(:numerator if > 1)
728
- *
729
- * `constant` has precedence over `fraction` if both are true (e.g. NTSC > 30000:1001)
730
- *
731
- * @param options For how to display it as text
732
- * @returns Text representation of the TimeBase
733
- */
734
- toText(options?: {
735
- /** Show time base as constant (e.g. PAL) */
736
- constant?: boolean;
737
- /** Show time base as fraction (25:1) even when numerator is 1 */
738
- fraction?: boolean;
739
- }): string;
740
- /**
741
- * Output TimeBase as frame rate (by default max 16 decimal places)
742
- *
743
- * @remarks
744
- * Default format: rate with two decimals if needed (i.e. decimals are > 0)
745
- *
746
- * `rounded` has precedence over `fixed`
747
- *
748
- * @param options On how to return the rate
749
- *
750
- * @return Rate of the TimeBase
751
- */
752
- toRate(options?: {
753
- /** Rounded to nearest integer */
754
- rounded?: boolean;
755
- /** Amount of decimal places
756
- * - `true` two decimal places
757
- * - `false` max amount of decimal places
758
- * - `number` that amount of decimal places
759
- */
760
- fixed?: boolean | number;
761
- }): number;
762
- /**
763
- * Get TimeBase in a object representation
764
- *
765
- * @returns TimeBase as `{denominator, numerator}` object
766
- */
767
- toObject(): TimeBaseType;
768
- /**
769
- * @deprecated Use {@link TimeBase#toObject | toObject} instead
770
- *
771
- * @returns TimeBase as `{denominator, numerator}` object
772
- */
773
- toJson(): TimeBaseType;
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;
774
794
  }
775
795
 
776
- /**
777
- * Create a TimeBase Instance from a number, string or object representation of a time base
778
- *
779
- * @param timeBase Input to create time base from
780
- * @returns A TimeBase instance
781
- *
782
- * @category Time
783
- */
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
+ */
784
804
  declare const createTimeBase: (timeBase: TimeBaseInput | string | number) => TimeBase;
785
805
 
786
- /**
787
- * Format a string representation of a time base to a TimeBase Instance
788
- *
789
- * @param timeBaseText The string to format to a TimeBase instance
790
- * @returns A TimeBase Instance
791
- *
792
- * @category Time
793
- */
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
+ */
794
814
  declare const formatTimeBaseText: (timeBaseText?: string | number) => TimeBase;
795
815
 
796
- /**
797
- * Create a TimeBase instance of an object
798
- *
799
- * @param timeBase A TimeBase object
800
- * @returns A TimeBase instance
801
- *
802
- * @category Time
803
- */
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
+ */
804
824
  declare const formatTimeBaseType: (timeBase: TimeBaseInput) => TimeBase;
805
825
 
806
- type TimeCodeInput = {
807
- /** Amount of samples for the time code */
808
- samples?: number | string;
809
- /** The time base for the time code */
810
- timeBase?: string | TimeBaseInput | TimeBase;
811
- };
812
- type TimeCodeInputOptions = {
813
- /** If time code is dropFrame or not (by default checks timeBase) */
814
- dropFrame?: boolean;
815
- /** Separator for frame in smpte output (default ":" for non-drop-frame and ";" for dropFrame) */
816
- frameSeparator?: string;
817
- };
818
- /**
819
- * TimeCode class representing the TimeCodeType in VidiCore
820
- *
821
- * For more info, see the [Time Codes section of VidiCore API Docs](https://apidoc.vidispine.com/latest/time.html#time-codes)
822
- *
823
- * @category Time
824
- */
825
- declare class TimeCode {
826
- /** Amount of samples for the time code */
827
- samples: number;
828
- /** The time base for the time code */
829
- timeBase: TimeBase;
830
- /** If time code is dropFrame or not (by default checks timeBase) */
831
- dropFrame?: boolean;
832
- /** Separator for frame in smpte output (default ":" for non-drop-frame and ";" for dropFrame) */
833
- frameSeparator?: string;
834
- /**
835
- * Constructor for TimeCode
836
- *
837
- * @param timeCodeType Object to create TimeCode of
838
- * @param options Options for the timeCode
839
- */
840
- constructor(timeCodeType: TimeCodeInput, options?: TimeCodeInputOptions);
841
- /**
842
- * Return this TimeCode added with the supplied timeCodeType
843
- * - If time bases differ, it will retain the time base of this TimeCode instance
844
- * - If supplied time code has a more granular time base, it will round down exceeding samples (hasn't reached that sample yet)
845
- *
846
- * @remarks
847
- * 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
848
- *
849
- * To exemplify:
850
- * - "51@50".add("25@25") => "101@50"
851
- * - while "25@25".add("51@50") => "50@25"
852
- *
853
- * @param timeCode A TimeCode instance you want to add with
854
- * @returns A new TimeCode instance with the addition applied
855
- */
856
- add(timeCode: TimeCode): TimeCode;
857
- /**
858
- * Return this TimeCode subtracted with the supplied timeCodeType
859
- * - If time bases differ, it will retain the time base of the instance time code
860
- * - If supplied time code has a more granular time base, it will round down exceeding samples (hasn't reached that sample yet)
861
- *
862
- * @remarks
863
- * 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
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
864
884
 
865
- * To exemplify:
866
- * - "101@50".subtract("25@25") => "51@50"
867
- * - while "50@25".subtract("51@50") => "25@25"
868
- *
869
- * @param timeCode A TimeCode instance you want to subtract with
870
- * @returns A new TimeCode instance with the subtraction applied
871
- */
872
- subtract(timeCode: TimeCode): TimeCode;
873
- /**
874
- * Creates a new TimeCode instance with specified timeBase and samples adjusted to that.
875
- *
876
- * @remarks
877
- * If it conforms to a less granular time base - it will floor samples (hasn't reached that sample yet)
878
- * - e.g. "51@50".conformTo("PAL") => "25@PAL" (not "26@PAL")
879
- *
880
- * @param timeBase The TimeBase it should conform the TimeCode to
881
- * @param options Explicitly set TimeCode options, by default these are derived from `timeBase`
882
- * @returns A new TimeCode instance with the conformTo timeBase applied
883
- */
884
- conformTimeBase(timeBase: TimeCodeInput['timeBase'], options?: TimeCodeInputOptions): TimeCode;
885
- /**
886
- * Get TimeCode as a text representation
887
- *
888
- * @remarks
889
- * Default format: `samples@denominator[:numerator (if > 1)])`
890
- *
891
- * `constant` has precedence over `fraction` if both are true
892
- *
893
- * @param options Options for how to format text
894
- * @returns Text representation of TimeCode
895
- */
896
- toText(options?: {
897
- /** Include time base even if seconds (i.e. append @1 or @1:1) */
898
- includeTimeBaseForSeconds?: boolean;
899
- /** show as constant (e.g. @PAL) */
900
- constant?: boolean;
901
- /** show as fraction (e.g. @25:1) */
902
- fraction?: boolean;
903
- }): string;
904
- /**
905
- * Get TimeCode in a units object representation
906
- *
907
- * @returns Units (time and frames) for the time code
908
- */
909
- toUnits(): {
910
- hours: number;
911
- minutes: number;
912
- seconds: number;
913
- frames: number;
914
- };
915
- /**
916
- * Get TimeCode in a time object representation
917
- *
918
- * Note: "milliseconds" is rounded down - use "partialSeconds" for another representation
919
- *
920
- * @returns Time for the time code
921
- */
922
- toTime(): {
923
- hours: number;
924
- minutes: number;
925
- seconds: number;
926
- milliseconds: number;
927
- partialSeconds: number;
928
- };
929
- /**
930
- * Get TimeCode in a seconds representation
931
- *
932
- * @returns Total seconds for the time code
933
- */
934
- toSeconds(): number;
935
- /**
936
- * Get TimeCode in a duration representation
937
- *
938
- * The time unit keys for the format string are:
939
- * - `h` for hour
940
- * - `m` for minute
941
- * - `s` for seconds
942
- * - `S` for milliseconds
943
- * - Any other char will be kept in the duration output string
944
- *
945
- * Note: Add several consecutive chars for zero padding.
946
- *
947
- * By default it:
948
- * - uses colon delimiter (e.g. for format "hhmmss")
949
- * - shows "m:ss" or "h:mm:ss" if format is undefined
950
- *
951
- * @param options Options for how to display duration
952
- * @returns Duration representation of the TimeCode
953
- */
954
- toDuration(options?: {
955
- /** Specify format of duration string, (e.g. `hh:mm:ss.S` for "01:23:04.5") */
956
- format?: string;
957
- }): string;
958
- /**
959
- * Get TimeCode in a smpte representation
960
- *
961
- * @returns Smpte representation of the TimeCode
962
- */
963
- toSmpte(): string;
964
- /**
965
- * Get TimeCode as a VidiCore TimeCodeType object
966
- *
967
- * @returns TimeCode as `{ samples, timeBase }`
968
- */
969
- toObject(): {
970
- samples: number;
971
- timeBase: _vidispine_types.RationalType;
972
- };
973
- /**
974
- * @deprecated Use {@link TimeCode#toObject | toObject} instead
975
- *
976
- * @returns TimeCode as `{ samples, timeBase }`
977
- */
978
- toJson(): {
979
- samples: number;
980
- timeBase: _vidispine_types.RationalType;
981
- };
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
+ };
982
1005
  }
983
1006
 
984
- interface FormatTimeCodeSecondsOptions extends TimeCodeInputOptions {
985
- /**
986
- * The TimeBase the output TimeCode should have
987
- *
988
- * Note: if unset and useGCD=false, denominator will be 10^(amount-of-decimals)
989
- */
990
- timeBase?: number | string | TimeBaseInput;
991
- /**
992
- * Samples and denominator are divided with GCD
993
- *
994
- * e.g. `1.04 => 104@100 => 26@25` (if no explicit `timeBase` is set)
995
- */
996
- useGCD?: boolean;
997
- }
998
- /**
999
- * Format seconds to TimeCode object
1000
- *
1001
- * @remarks
1002
- * Input time base is always considered as 1:1 since it expects seconds as input
1003
- *
1004
- * Note: Max 15 digits accuracy (double precision float64), e.g.
1005
- * - 10^6 seconds can have 10^9 decimals (nanosecond) precision
1006
- * - 10^9 seconds can have 10^6 decimals (microsecond) precision
1007
- * - 10^12 seconds can have 10^3 decimals (millisecond) precision
1008
- *
1009
- * @param seconds With or without decimals ("." and "," are both interpreted as decimal)
1010
- * @param options Options for how to format the seconds to a TimeCode
1011
- * @returns A TimeCode instance
1012
- *
1013
- * @category Time
1014
- */
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
+ */
1015
1038
  declare const formatTimeCodeSeconds: (seconds: string | number, options?: FormatTimeCodeSecondsOptions) => TimeCode;
1016
1039
 
1017
- interface FormatTimeCodeSmpteOptions extends TimeCodeInputOptions {
1018
- /** TimeBase of smpte (and consequently TimeBase of output TimeCode) */
1019
- timeBase?: number | string | TimeBaseInput;
1020
- /** How to handle exceeding values (default `error`) */
1021
- exceedingMode?: 'add' | 'ignore' | 'error';
1022
- }
1023
- /**
1024
- * Format smpte text to a TimeCode Instance
1025
- *
1026
- * Options for `exceedingMode`:
1027
- * - `add` will be overflow to higher unit (e.g. PAL and 00:00:00:25 => 00:00:01:00)
1028
- * - `ignore` will be truncated (e.g. PAL and 00:00:00:25 => 00:00:00:24)
1029
- * - `error` will throw error (e.g. PAL and 00:00:00:25 => Error)
1030
- *
1031
- * @param smpte String representation of smpte
1032
- * @param options Options for creating the time code from smpte
1033
- * @returns TimeCode instance created from smpte string
1034
- *
1035
- * @category Time
1036
- */
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
+ */
1037
1060
  declare const formatTimeCodeSmpte: (smpte: string, options?: FormatTimeCodeSmpteOptions) => TimeCode;
1038
1061
 
1039
- interface FormatTimeCodeTextOptions extends TimeCodeInputOptions {
1040
- /** The time base the returned TimeCode should have */
1041
- timeBase?: number | string | TimeBaseInput;
1042
- }
1043
- /**
1044
- * Format text to a TimeCode instance
1045
- *
1046
- * @returns A TimeCode instance
1047
- *
1048
- * @category Time
1049
- */
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
+ */
1050
1073
  declare const formatTimeCodeText: (timeCodeText?: number | string, options?: FormatTimeCodeTextOptions) => TimeCode;
1051
1074
 
1052
- type CreateTimeCodeOptions = TimeCodeInputOptions | FormatTimeCodeSmpteOptions | FormatTimeCodeSecondsOptions | FormatTimeCodeTextOptions;
1053
- /**
1054
- * Create a TimeCode instance from smpte, seconds/samples, timeCode object or string
1055
- *
1056
- * @param timeCode Smpte, seconds/samples, timeCode object or string
1057
- * @param options For the format functions
1058
- * @returns A TimeCode instance
1059
- *
1060
- * @category Time
1061
- */
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
+ */
1062
1085
  declare const createTimeCode: (timeCode: TimeCodeInput | string | number, options?: CreateTimeCodeOptions) => TimeCode;
1063
1086
 
1064
- /**
1065
- * Format an object to a TimeCode instance
1066
- *
1067
- * @param timeCode To create TimeCode instance of
1068
- * @param options For the TimeCode constructor
1069
- * @returns A TimeCode instance
1070
- *
1071
- * @category Time
1072
- */
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
+ */
1073
1096
  declare const formatTimeCodeType: (timeCode: TimeCodeInput, options?: TimeCodeInputOptions) => TimeCode;
1074
1097
 
1075
- type ParsedVideoComponentType = {
1076
- videoFormat?: string;
1077
- dimension?: string;
1078
- frameRate?: string | number;
1079
- height?: number;
1080
- width?: number;
1081
- timeBase?: TimeBase;
1082
- timeCode?: TimeCode;
1083
- videoCodec?: string;
1084
- smpte?: string;
1085
- videoBitrate?: string;
1086
- videoBitrateMbps?: number;
1087
- fieldOrder?: string;
1088
- colorSpace?: string;
1089
- chromaSubsampling?: string;
1090
- aspectRatio?: string;
1091
- colorPrimaries?: string;
1092
- videoMetadata?: {
1093
- [key: string]: string;
1094
- };
1095
- videoMediaInfo?: ParsedVideoMediaInfoType;
1096
- };
1097
- /**
1098
- * Parses the technical information of a VideoComponentType.
1099
- * @param {Object} videoComponentType - A VideoComponentType from VidiCore.
1100
- * @returns {Object} Parsed component object.
1101
- *
1102
- * @category Shape
1103
- */
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
+ */
1104
1127
  declare const parseVideoComponent: (videoComponentType?: VideoComponentType) => ParsedVideoComponentType;
1105
1128
 
1106
- type ParsedShapeType = {
1107
- uri?: string;
1108
- tag?: string;
1109
- mimeType?: string;
1110
- } & ParsedContainerComponentType & ParsedBinaryComponentType & ParsedAudioComponentType & ParsedVideoComponentType;
1111
- /**
1112
- * Parses the technical information of a ShapeType and its various components.
1113
- *
1114
- * Will only parse the first videoComponent, audioComponent, binaryComponent in the corresponding array.
1115
- * To parse a selected component see:
1116
- * - {@link parseContainerComponent}
1117
- * - {@link parseVideoComponent}
1118
- * - {@link parseAudioComponent}
1119
- * - {@link parseBinaryComponent}
1120
- * @param shapeType - A ShapeType from VidiCore.
1121
- * @returns Parsed shape object.
1122
- *
1123
- * @category Shape
1124
- */
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
+ */
1125
1148
  declare const parseShapeType: (shapeType?: ShapeType) => ParsedShapeType;
1126
1149
 
1127
- /**
1128
- * Const object with document types
1129
- *
1130
- * @category Shape
1131
- */
1132
- declare const DOCUMENT_TYPES: {
1133
- readonly PDF: "PDF";
1134
- readonly TEXT: "TEXT";
1135
- readonly MSWORD: "MSWORD";
1136
- readonly JSON: "JSON";
1137
- 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";
1138
1161
  };
1139
1162
 
1140
- /**
1141
- * Const object with media types
1142
- *
1143
- * @category Shape
1144
- */
1145
- declare const SHAPE_MEDIA_TYPES: {
1146
- readonly IMAGE: "IMAGE";
1147
- readonly AUDIO: "AUDIO";
1148
- readonly VIDEO: "VIDEO";
1149
- readonly DOCUMENT: "DOCUMENT";
1150
- 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";
1151
1174
  };
1152
1175
 
1153
- type DocumentType = keyof typeof DOCUMENT_TYPES;
1154
- /**
1155
- * Return a const for the document type of a shape (looks at mimeType)
1156
- *
1157
- * @param shape A VidiCore shape
1158
- * @returns The document type for a shape
1159
- *
1160
- * @category Shape
1161
- */
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
+ */
1162
1185
  declare const getShapeDocumentType: (shape?: ShapeType) => DocumentType;
1163
1186
 
1164
- type FilteredShapeListObject = {
1165
- src: string;
1166
- type: string;
1167
- shape: ShapeType;
1168
- parsedShape: ParsedShapeType;
1169
- [key: string]: string | ParsedShapeType | ShapeType;
1170
- };
1171
- type FilterShapeSourceOption = {
1172
- sortPriority?: Function;
1173
- allowedMimeTypes?: string[];
1174
- allowedMethods?: string[];
1175
- sourceKey?: string;
1176
- mimeTypeKey?: string;
1177
- shapeKey?: string;
1178
- parsedShapeKey?: string;
1179
- };
1180
- /**
1181
- * Filter a shape type list to get shapes that are playable in a browser
1182
- *
1183
- * @param itemType
1184
- * @param options
1185
- * @returns
1186
- *
1187
- * @category Shape
1188
- */
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
+ */
1189
1212
  declare const filterShapeSource: (itemType: ItemType, options?: FilterShapeSourceOption) => FilteredShapeListObject[];
1190
1213
 
1191
- type ShapeMediaType = keyof typeof SHAPE_MEDIA_TYPES;
1192
- /**
1193
- * Returns a const for which media type a shape has
1194
- *
1195
- * @param shape
1196
- * @returns
1197
- *
1198
- * @category Shape
1199
- */
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
+ */
1200
1223
  declare const getShapeMediaType: (shape: ShapeType) => ShapeMediaType;
1201
1224
 
1202
- /**
1203
- * Const object with all file states in VidiCore
1204
- * (see https://apidoc.vidispine.com/latest/storage/storage.html#file-states for more info)
1205
- *
1206
- * @category File
1207
- */
1208
- declare const FILE_STATES: {
1209
- /** Just created, not used. */
1210
- readonly NONE: "NONE";
1211
- /** Discovered or created, not yet marked as finished. */
1212
- readonly OPEN: "OPEN";
1213
- /** File does no longer grow. */
1214
- readonly CLOSED: "CLOSED";
1215
- /** The current state is not known. */
1216
- readonly UNKNOWN: "UNKNOWN";
1217
- /** File is missing from the file system/storage. */
1218
- readonly MISSING: "MISSING";
1219
- /** File has been missing for a longer period. Candidate for restoration from archive. */
1220
- readonly LOST: "LOST";
1221
- /** File will appear on file system/storage, transfer subsystem or transcoder will create it. */
1222
- readonly TO_APPEAR: "TO_APPEAR";
1223
- /** The file is no longer in use, and will be deleted at the next clean-up sweep. */
1224
- readonly TO_BE_DELETED: "TO_BE_DELETED";
1225
- /** File is in use by transfer subsystem or transcoder. */
1226
- readonly BEING_READ: "BEING_READ";
1227
- /** File is archived. */
1228
- readonly ARCHIVED: "ARCHIVED";
1229
- /** File will be synchronized by multi-site agent. */
1230
- readonly AWAITING_SYNC: "AWAITING_SYNC";
1231
- };
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
+ };
1232
1255
  type FileStateTypes = keyof typeof FILE_STATES;
1233
1256
 
1234
- /**
1235
- * Find the thumbnail uri in a VidiCore item object that's nearest a timeCode
1236
- *
1237
- * @remarks
1238
- * Time code is included in path of VidiCore thumbnail uris
1239
- *
1240
- * @param itemType A VidiCore item object
1241
- * @param timeCode A timeCode to find nearest thumbnail to
1242
- * @returns A URI of a thumbnail, `undefined` if item has no thumbnails
1243
- *
1244
- * @category Thumbnail
1245
- */
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
+ */
1246
1269
  declare const findNearestThumbnail: (itemType: ItemType, timeCode: TimeCode | TimeCodeInput) => string;
1247
1270
 
1248
- /**
1249
- * TODO
1250
- */
1251
- type ParsedMediaConvertTranscodePreset = {
1252
- description?: string;
1253
- containerFormat?: any;
1254
- videoFormat?: string;
1255
- height?: number;
1256
- width?: number;
1257
- dimension?: string;
1258
- aspectRatio?: string;
1259
- fieldOrder?: string;
1260
- videoBitrate?: number;
1261
- timeBase?: TimeBase;
1262
- frameRate?: string | number;
1263
- audioFormat?: string;
1264
- audioSamplerate?: string;
1265
- audioBitrate?: string;
1266
- audioBitRateMode?: string;
1267
- };
1268
- /**
1269
- * TODO
1270
- *
1271
- * @param mediaconvert
1272
- * @returns
1273
- *
1274
- * @category Transcode
1275
- */
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
+ */
1276
1299
  declare const parseMediaConvertPreset: (mediaconvert: TranscodePresetType['mediaconvert']) => ParsedMediaConvertTranscodePreset;
1277
1300
 
1278
- type ParsedTranscodePreset = {
1279
- description?: string;
1280
- containerFormat?: any;
1281
- videoFormat?: string;
1282
- height?: number;
1283
- width?: number;
1284
- dimension?: string;
1285
- aspectRatio?: string;
1286
- fieldOrder?: string;
1287
- videoBitrate?: number;
1288
- timeBase?: TimeBase;
1289
- frameRate?: string | number;
1290
- audioFormat?: string;
1291
- audioSamplerate?: string;
1292
- audioBitrate?: string;
1293
- audioBitRateMode?: string;
1294
- audioChannels?: number;
1295
- };
1296
- /**
1297
- * Parse a VidiCore transcode preset
1298
- *
1299
- * @param transcodePresetType a VidiCore transcode preset
1300
- * @returns A parsed transcode preset
1301
- *
1302
- * @category Transcode
1303
- */
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
+ */
1304
1327
  declare const parseTranscodePreset: (transcodePresetType: TranscodePresetType) => ParsedTranscodePreset;
1305
1328
 
1306
- export { CreateFacetTypeFieldList, CreateFacetTypeOptions, CreateMetadataTypeInput, CreateTimeCodeOptions, DOCUMENT_TYPES, DocumentType, FIELD_ATTRIBUTE_KEYS, 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, ParseFieldListOptions, ParseFieldOptions, ParseGroupListOptions, ParseGroupOptions, ParseHighlightTimespanListOptions, ParseHighlightTimespanOptions, ParseMetadataTypeOptions, ParseTimespanListOptions, ParseTimespanOptions, ParseValueListOptions, ParseValueOptions, ParsedAudioComponentType, ParsedAudioMediaInfoType, ParsedBaseMediaInfoType, ParsedBinaryComponentType, ParsedBinaryMediaInfoType, ParsedContainerComponentType, ParsedFacetType, ParsedFacetTypeCount, ParsedField, ParsedFieldAttributes, 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, createFacetType, createMetadataType, createTimeBase, createTimeCode, filterShapeSource, findNearestThumbnail, formatTimeBaseText, formatTimeBaseType, formatTimeCodeSeconds, formatTimeCodeSmpte, formatTimeCodeText, formatTimeCodeType, getShapeDocumentType, getShapeMediaType, metadataTypeToWebVtt, parseAudioComponent, parseBinaryComponent, parseContainerComponent, parseFacetType, parseFieldList, parseFileType, parseGroupList, parseHighlightTimespan, parseHighlightTimespanList, parseKeyValuePairTypes as parseKeyValuePairType, parseMediaConvertPreset, parseMetadataType, parseNowDate, parseShapeType, parseSimpleMetadataType, parseTimespan, parseTimespanList, parseTranscodePreset, parseVideoComponent };
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 };