@vidispine/vdt-js 22.4.0-pre.4 → 22.4.0-pre.6

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.
@@ -0,0 +1,1182 @@
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';
3
+
4
+ /**
5
+ *
6
+ * @param keyValuePairTypes
7
+ * @returns
8
+ *
9
+ * @category Other
10
+ */
11
+ declare const parseKeyValuePairTypes: (keyValuePairTypes: KeyValuePairType[]) => {
12
+ [k: string]: string;
13
+ };
14
+
15
+ /**
16
+ * Object with all name of roles in VidiCore
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
+
132
+ declare type InputValueTypes = string | boolean | number | Date;
133
+ /** Possible input values for the field value */
134
+ declare type InputValue = InputValueTypes | InputValueTypes[];
135
+ /** Input value object for the field value */
136
+ declare type InputValueObject = {
137
+ value: string | InputValue;
138
+ } & Omit<MetadataValueType, 'value'>;
139
+ declare type InputFieldValue = InputValueObject | InputValue | InputValueObject[] | InputValue[];
140
+ /** Input object to create field of */
141
+ declare type InputFieldObject = {
142
+ value: InputFieldValue;
143
+ } & MetadataFieldValueType;
144
+ /** Input to create a field of */
145
+ declare type InputField = InputFieldValue | InputFieldObject;
146
+ /** Input to create one or multiple groups and/or fields of */
147
+ declare type InputGroupsOrFields = InputGroup | InputGroup[] | InputField | InputField[];
148
+ /** Input object to create group of */
149
+ declare type InputGroup = {
150
+ [groupOrFieldName: string]: InputGroupsOrFields;
151
+ } & Partial<MetadataGroupValueType>;
152
+ /** Input to create a timespan of */
153
+ declare type InputTimespan = {
154
+ start?: string | number;
155
+ end?: string | number;
156
+ base?: string;
157
+ [groupOrFieldName: string]: InputGroupsOrFields;
158
+ };
159
+ declare type CreateMetadataTypeInput = InputTimespan | InputTimespan[];
160
+ /**
161
+ * Create a VidiCore metadata object from a more dense/simplified structure
162
+ *
163
+ * @param input To create VidiCore metadata object of
164
+ * @returns A VidiCore metadata object
165
+ *
166
+ * @category Metadata
167
+ */
168
+ declare const createMetadataType: (input: CreateMetadataTypeInput) => MetadataType;
169
+
170
+ declare type ParsedValueAttributes = Partial<Omit<MetadataValueType, 'value'>>;
171
+ declare type ParsedValue<TOptions> = TOptions extends {
172
+ includeValueAttributes?: false;
173
+ } ? string : {
174
+ value: string;
175
+ } & ParsedValueAttributes;
176
+ declare type ParseValueOptions = {
177
+ includeValueAttributes?: boolean | (keyof ParsedValueAttributes)[];
178
+ };
179
+
180
+ declare type ParsedValueList<TOptions> = TOptions extends {
181
+ joinValue?: string;
182
+ includeValueAttributes?: false;
183
+ } ? string : TOptions extends {
184
+ arrayOnSingleValue?: true;
185
+ } ? ParsedValue<TOptions>[] : ParsedValue<TOptions> | ParsedValue<TOptions>[];
186
+ declare type ParseValueListOptions = {
187
+ joinValue?: string;
188
+ arrayOnSingleValue?: boolean;
189
+ } & ParseValueOptions;
190
+
191
+ declare type ParsedFieldAttributes = Partial<Omit<MetadataFieldValueType, 'value'>>;
192
+ declare type ParsedFieldObject<TOptions> = {
193
+ value: ParsedValueList<TOptions>;
194
+ } & ParsedFieldAttributes;
195
+ declare type ParsedField<TOptions> = TOptions extends {
196
+ includeFieldAttributes?: false;
197
+ } ? ParsedValueList<TOptions> : ParsedFieldObject<TOptions>;
198
+ declare type ParseFieldOptions = {
199
+ includeFieldAttributes?: boolean | (keyof ParsedFieldAttributes)[];
200
+ } & ParseValueListOptions;
201
+
202
+ declare type ParseFieldListOptions = {
203
+ fieldAsList?: boolean;
204
+ arrayOnSingleField?: boolean;
205
+ overrideField?: boolean;
206
+ } & ParseFieldOptions;
207
+ declare type ParsedFieldList<TOptions> = TOptions extends {
208
+ fieldAsList?: true;
209
+ } ? ParsedField<TOptions>[] : TOptions extends {
210
+ arrayOnSingle?: true;
211
+ arrayOnSingleField?: undefined | true;
212
+ } | {
213
+ arrayOnSingleField?: true;
214
+ } ? {
215
+ [name: string]: ParsedField<TOptions>[];
216
+ } : TOptions extends {
217
+ flat?: true;
218
+ overrideField?: true | undefined;
219
+ } | {
220
+ overrideField?: true;
221
+ } ? {
222
+ [name: string]: ParsedField<TOptions>;
223
+ } : {
224
+ [name: string]: ParsedField<TOptions> | ParsedField<TOptions>[];
225
+ };
226
+ /**
227
+ * Parse a metadata field list according to selected options
228
+ *
229
+ * @remarks
230
+ * Duplicate fields (same field name in the same field list) are usually not the data model we'd advise using.
231
+ * Since VidiCore supports multiple values in one fields, it's typically advised to store them as such.
232
+ * But, given duplicated fields when parsing it will:
233
+ * - with default options, merge duplicated field values to one field value array
234
+ * - with `fieldAsList` enabled, separate fields in the list/array (as usual, even if not duplicate)
235
+ * - with `includeFieldAttributes` enabled, return an array of field objects
236
+ * - with `overrideField` enabled - Override so it returns the latest "duplicated" field it parses
237
+ *
238
+ * @param fieldList Field list to parse
239
+ * @param [options=defaultOptions] Options for how to parse the field list
240
+ * @returns A parsed field list
241
+ *
242
+ * @category Metadata
243
+ */
244
+ declare const parseFieldList: <TOptions extends ParseFieldListOptions = ParseFieldListOptions>(fieldList: MetadataFieldValueType[], options?: TOptions) => ParsedFieldList<TOptions>;
245
+
246
+ declare type ParsedGroupAttributes = Omit<MetadataGroupValueType, 'field' | 'group'>;
247
+ declare type ParseGroupOptions = {
248
+ includeGroupAttributes?: boolean | (keyof ParsedGroupAttributes)[];
249
+ groupAsList?: boolean;
250
+ arrayOnSingleGroup?: boolean;
251
+ overrideGroup?: boolean;
252
+ } & ParseFieldListOptions;
253
+ declare type ParsedGroup<TOptions> = ((TOptions extends {
254
+ groupAsList?: true;
255
+ } ? {
256
+ group?: ParsedGroupList<TOptions>;
257
+ } : {
258
+ [name: string]: ParsedGroupList<TOptions>;
259
+ }) & (TOptions extends {
260
+ fieldAsList?: true;
261
+ } ? {
262
+ field?: ParsedFieldList<TOptions>;
263
+ } : {
264
+ [name: string]: ParsedFieldList<TOptions>;
265
+ })) & ParsedGroupAttributes;
266
+ declare type ParseGroupListOptions = ParseGroupOptions;
267
+ declare type ParsedGroupList<TOptions> = TOptions extends {
268
+ groupAsList?: true;
269
+ } ? ParsedGroup<TOptions>[] : TOptions extends {
270
+ arrayOnSingle?: true;
271
+ arrayOnSingleGroup?: true | undefined;
272
+ } | {
273
+ arrayOnSingleGroup?: true;
274
+ } ? {
275
+ [groupName: string]: ParsedGroup<TOptions>[];
276
+ } : TOptions extends {
277
+ flat?: true;
278
+ overrideGroup?: true | undefined;
279
+ } | {
280
+ overrideGroup?: true;
281
+ } ? {
282
+ [groupName: string]: ParsedGroup<TOptions>;
283
+ } : {
284
+ [groupName: string]: ParsedGroup<TOptions> | ParsedGroup<TOptions>[];
285
+ };
286
+ /**
287
+ * Parse a metadata group list according to selected options
288
+ *
289
+ * @remarks
290
+ * Parsing duplicate groups (with identical name) in the same group list will return:
291
+ * - with default options, an array of group objects
292
+ * - with `groupAsList` enabled, separate group objects in the list/array (as usual, even if not duplicate)
293
+ * - with `overrideGroup` enabled, return the latest duplicated group it parses
294
+ *
295
+ * @param groupList Group list to parse
296
+ * @param options options for how to parse list
297
+ * @returns A parsed group list
298
+ *
299
+ * @category Metadata
300
+ */
301
+ declare const parseGroupList: <TOptions extends ParseGroupOptions = ParseGroupOptions>(groupList: MetadataGroupValueType[], options?: TOptions) => ParsedGroupList<TOptions>;
302
+
303
+ declare type ParsedTimespanAttributes = Omit<MetadataType['timespan'][number], 'field' | 'group'>;
304
+ /**
305
+ * __includeTimespanAttributes__:
306
+ * Include attributes on timespan
307
+ * (Set `true` or "array of attribute keys" to include specific attributes)
308
+ *
309
+ * __arrayOnSingle__:
310
+ * Return groups, fields and values as array if single
311
+ *
312
+ * __flat__:
313
+ * Return a flat (no array) representation of the timespan (Note: fields/groups might be overridden)
314
+ *
315
+ * @defaultValue `{ includeTimespanAttributes: false, arrayOnSingle: true, flat: false }`
316
+ */
317
+ declare type ParseTimespanOptions = {
318
+ includeTimespanAttributes?: boolean | (keyof ParsedTimespanAttributes)[];
319
+ arrayOnSingle?: boolean;
320
+ flat?: boolean;
321
+ } & ParseGroupListOptions;
322
+ declare type ParsedTimespan<TOptions> = ((TOptions extends {
323
+ groupAsList?: true;
324
+ } ? {
325
+ group?: ParsedGroupList<TOptions>;
326
+ } : {
327
+ [name: string]: ParsedGroupList<TOptions>;
328
+ }) & (TOptions extends {
329
+ fieldAsList?: true;
330
+ } ? {
331
+ field?: ParsedFieldList<TOptions>;
332
+ } : {
333
+ [name: string]: ParsedFieldList<TOptions>;
334
+ })) & ParsedTimespanAttributes;
335
+ /**
336
+ *
337
+ * Parses timespan according to specified options
338
+ *
339
+ * @remarks
340
+ * To ensure a flat (no array) representation when using `flat: true`, the parser will also set `overrideGroup` and `overrideField` to true (unless those are explicitly set false)
341
+ *
342
+ * @param timespan - A VidiCore metadata timespan
343
+ * @param options - Options to change how it is parsed
344
+ * @returns Timespan parsed according to options
345
+ *
346
+ * @see {@link parseGroupList} and {@link parseFieldList} for more info
347
+ *
348
+ * @category Metadata
349
+ */
350
+ declare const parseTimespan: <TOptions extends ParseTimespanOptions = ParseTimespanOptions>(timespan: MetadataType['timespan'][number], options?: TOptions) => ParsedTimespan<TOptions>;
351
+
352
+ declare type ParsedTimespanList<TOptions> = TOptions extends {
353
+ timespanAsList?: true;
354
+ } ? ParsedTimespan<TOptions>[] : TOptions extends {
355
+ flat?: true;
356
+ onlyGeneric?: true | undefined;
357
+ } | {
358
+ onlyGeneric?: true;
359
+ } ? ParsedTimespan<TOptions> : {
360
+ [timespanKey: string]: ParsedTimespan<TOptions>[];
361
+ };
362
+ declare type ParseTimespanListOptions = {
363
+ timespanAsList?: boolean;
364
+ joinTimespan?: string;
365
+ sortTimespan?: boolean;
366
+ flat?: boolean;
367
+ flatTimespan?: boolean;
368
+ } & ParseTimespanOptions;
369
+ /**
370
+ * Parses timespanList according to specified options.
371
+ * The attributes can be targeted for each sub-type.
372
+ *
373
+ * @param timespanList - A Vidicore metadata timespan list
374
+ * @param options - Options which change how the metadataType is parsed.
375
+ * @returns Timespan list parsed according to options
376
+ *
377
+ * @see {@link parseTimespan} for more info
378
+ *
379
+ * @category Metadata
380
+ */
381
+ declare const parseTimespanList: <TOptions extends ParseTimespanListOptions = ParseTimespanListOptions>(timespanList: MetadataType['timespan'], options?: TOptions) => ParsedTimespanList<TOptions>;
382
+
383
+ declare type ParsedMetadataAttributes = Partial<Omit<MetadataType, 'timespan' | 'revision'> & {
384
+ revision?: string[];
385
+ }>;
386
+ declare type ParsedMetadataType<TOptions> = (TOptions extends {
387
+ timespanAsList?: true;
388
+ } ? {
389
+ timespan: ParsedTimespanList<TOptions>;
390
+ } : TOptions extends {
391
+ flat?: true;
392
+ } ? ParsedTimespanList<TOptions> : {
393
+ [timespanKey: string]: ParsedTimespanList<TOptions>;
394
+ }) & (TOptions extends {
395
+ includeMetadataAttributes?: true | string[];
396
+ } ? ParsedMetadataAttributes : {});
397
+ declare type ParseMetadataTypeOptions = {
398
+ includeMetadataAttributes?: boolean | (keyof ParsedMetadataAttributes)[];
399
+ flat?: boolean;
400
+ } & ParseTimespanListOptions;
401
+ /**
402
+ * Parses MetadataType according to specified options
403
+ *
404
+ * @remarks
405
+ * 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.
406
+ * 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:
407
+ * you can use the option `flat` along with `joinValue` or `arrayOnSingleValue: false`.
408
+ *
409
+ * @param metadataType - A MetadataType from VidiCore
410
+ * @param options - Options which change how the metadataType is parsed
411
+ * @returns Metadata object parsed according to options
412
+ *
413
+ * @see {@link parseTimespanList} for more info
414
+ *
415
+ * @category Metadata
416
+ */
417
+ declare function parseMetadataType<TOptions extends ParseMetadataTypeOptions = ParseMetadataTypeOptions>(metadataType: MetadataType, options?: TOptions): ParsedMetadataType<TOptions>;
418
+
419
+ /**
420
+ * Parse simple (key/value) metadata
421
+ *
422
+ * Not indexed metadata, available on almost all entities (storages, library, user, group, etc...)
423
+ *
424
+ * @param simpleMetadataType A VidiCore simple metadata object
425
+ * @returns A parsed simple metadata object
426
+ *
427
+ * @category Metadata
428
+ */
429
+ declare const parseSimpleMetadataType: (simpleMetadataType: SimpleMetadataType) => {
430
+ [key: string]: string;
431
+ };
432
+
433
+ declare type MetadataTypeToWebVttOptions = {
434
+ subtitleGroup?: string;
435
+ subtitleField?: string;
436
+ };
437
+ /**
438
+ * Convert metadata subtitle groups to WebVtt subtitles
439
+ *
440
+ * @param metadataType - Vidicore metadata object (should include subtitleGroup and subtitleField)
441
+ * @param options - options for how to map subtitle group
442
+ * @returns WebVtt subtitles
443
+ *
444
+ * @category Metadata
445
+ */
446
+ declare const metadataTypeToWebVtt: (metadataType: MetadataType, options?: MetadataTypeToWebVttOptions) => string;
447
+
448
+ /**
449
+ * Array with all available metadata group attributes
450
+ *
451
+ * @category Metadata
452
+ */
453
+ declare const GROUP_ATTRIBUTE_KEYS: (keyof MetadataGroupValueType)[];
454
+ /**
455
+ * Array with all available metadata group attributes
456
+ *
457
+ * @category Metadata
458
+ */
459
+ declare const FIELD_ATTRIBUTE_KEYS: (keyof MetadataFieldValueType)[];
460
+ /**
461
+ * Array with all available metadata field value attributes
462
+ *
463
+ * @category Metadata
464
+ */
465
+ declare const FIELD_VALUE_ATTRIBUTE_KEYS: (keyof MetadataValueType)[];
466
+
467
+ /**
468
+ * Array with all available VidiCore system/default field group names
469
+ *
470
+ * @category Metadata
471
+ */
472
+ 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"];
473
+ /**
474
+ * Array with all available VidiCore system/default field group names
475
+ *
476
+ * @category Metadata
477
+ */
478
+ 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"];
479
+
480
+ declare type CreateFacetTypeFieldList = string[];
481
+ declare type CreateFacetTypeOptions = {
482
+ count: boolean;
483
+ };
484
+ /**
485
+ * Create a Vidicore facet list
486
+ *
487
+ * @param fieldList Input to create facet of
488
+ * @param options Options for creating the facet
489
+ * @returns A VidiCore facet list
490
+ *
491
+ * @category Search
492
+ */
493
+ declare const createFacetType: (fieldList?: CreateFacetTypeFieldList, options?: Partial<CreateFacetTypeOptions>) => {
494
+ field: string;
495
+ name: string;
496
+ count: boolean;
497
+ exclude: CreateFacetTypeFieldList;
498
+ }[];
499
+
500
+ declare type ParsedFacetTypeCount = {
501
+ [fieldValue: string]: number;
502
+ };
503
+ /** Parsed facet type */
504
+ declare type ParsedFacetType = {
505
+ [fieldName: string]: ParsedFacetTypeCount;
506
+ };
507
+ /**
508
+ * Parse a VidiCore facet type list
509
+ *
510
+ * @param facetType A facet type list to parse
511
+ * @returns A parsed facet type list
512
+ *
513
+ * @category Search
514
+ */
515
+ declare const parseFacetType: (facetType?: FacetType[]) => ParsedFacetType;
516
+
517
+ declare type ParseHighlightTimespanOptions = {
518
+ arrayOnSingle?: boolean;
519
+ timespanAsList?: boolean;
520
+ joinValue?: string;
521
+ };
522
+ declare type ParsedHighlightTimespan = {
523
+ start?: string;
524
+ end?: string;
525
+ [key: string]: string | string[];
526
+ };
527
+ /**
528
+ * Parses highlight timespan in VidiCore into key/value object.
529
+ * The attributes can be targeted for each sub-type.
530
+ * @param timespan - A VidiCore search timespan
531
+ * @param options - Options which change how the timespans are parsed
532
+ *
533
+ * @category Search
534
+ */
535
+ declare const parseHighlightTimespan: (timespan: SearchResultEntryTimespanType, options: ParseHighlightTimespanOptions) => ParsedHighlightTimespan;
536
+
537
+ declare type ParseHighlightTimespanListOptions = {
538
+ timespanAsList?: boolean;
539
+ joinTimespan?: string;
540
+ flat?: boolean;
541
+ flatTimespan?: boolean;
542
+ } & ParseHighlightTimespanOptions;
543
+ /**
544
+ * Parses highlight timespans from VidiCore into key/value object.
545
+ * The attributes can be targeted for each sub-type.
546
+ *
547
+ * @param highlightTimespanList - A list of timespans from VidiCore.
548
+ * @param options - Options to change how the timespans are parsed
549
+ *
550
+ * @category Search
551
+ */
552
+ declare const parseHighlightTimespanList: (highlightTimespanList?: SearchResultEntryTimespanType[], options?: ParseHighlightTimespanListOptions) => ParsedHighlightTimespan | ParsedHighlightTimespan[];
553
+
554
+ declare const parseNowDate: (value?: string) => Date;
555
+
556
+ declare type ParsedBaseMediaInfoType = {
557
+ Bit_rate_mode?: string;
558
+ Source?: string;
559
+ } & {
560
+ [key: string]: string;
561
+ };
562
+ declare type ParsedAudioMediaInfoType = ParsedBaseMediaInfoType;
563
+ declare type ParsedBinaryMediaInfoType = ParsedBaseMediaInfoType;
564
+ declare type ParsedVideoMediaInfoType = ParsedBaseMediaInfoType & {
565
+ Format_Settings_GOP?: string;
566
+ intra_dc_precision?: string;
567
+ };
568
+
569
+ declare type ParsedAudioComponentType = {
570
+ audioFormat?: string;
571
+ audioCodec?: string;
572
+ audioSamplerate?: string;
573
+ audioSamplerateSamples?: number;
574
+ audioBitDepth?: string;
575
+ audioBitrate?: string;
576
+ audioBitRateMode?: string;
577
+ audioChannels?: number;
578
+ audioMetadata?: {
579
+ [key: string]: string;
580
+ };
581
+ audioMediaInfo?: ParsedAudioMediaInfoType;
582
+ };
583
+ /**
584
+ * Parses the technical information of a AudioComponentType.
585
+ * @param audioComponentType - A AudioComponentType from VidiCore.
586
+ * @returns Parsed component object.
587
+ *
588
+ * @category Shape
589
+ */
590
+ declare const parseAudioComponent: (audioComponentType: AudioComponentType) => ParsedAudioComponentType;
591
+
592
+ declare type ParsedBinaryComponentType = {
593
+ binaryMetadata?: {
594
+ [key: string]: string;
595
+ };
596
+ binaryMediaInfo?: ParsedBinaryMediaInfoType;
597
+ };
598
+ /**
599
+ * Parses the technical information of a BinaryComponentType.
600
+ * @param binaryComponentType - A BinaryComponentType from VidiCore.
601
+ * @returns Parsed component object.
602
+ *
603
+ * @category Shape
604
+ */
605
+ declare const parseBinaryComponent: (binaryComponentType?: BinaryComponentType) => ParsedBinaryComponentType;
606
+
607
+ declare type ParsedFileType = {
608
+ uri?: string;
609
+ hash?: string;
610
+ fileSize?: string;
611
+ fileSizeBytes?: number;
612
+ path?: string;
613
+ fileName?: string;
614
+ fileId?: string;
615
+ };
616
+ /**
617
+ * Parses a VidiCore file object
618
+ *
619
+ * @param fileType VidiCore file object
620
+ * @returns A parsed file object
621
+ *
622
+ * @category File
623
+ */
624
+ declare const parseFileType: (fileType: FileType) => ParsedFileType;
625
+
626
+ /**
627
+ * Parsed container component
628
+ */
629
+ declare type ParsedContainerComponentType = {
630
+ containerFormat?: string;
631
+ videoFormat?: string;
632
+ audioFormat?: string;
633
+ textFormat?: string;
634
+ originalFilename?: string;
635
+ durationTimeCode?: TimeCodeType;
636
+ duration?: string;
637
+ startTimestamp?: TimeCodeType;
638
+ startTimecode?: TimeCodeType;
639
+ containerMetadata?: {
640
+ [key: string]: string;
641
+ };
642
+ containerMediaInfo?: ParsedBaseMediaInfoType;
643
+ } & ParsedFileType;
644
+ /**
645
+ * Parses the technical information of a ContainerComponentType.
646
+ * @param containerComponentType - A ContainerComponentType from VidiCore.
647
+ * @returns Parsed component object.
648
+ *
649
+ * @category Shape
650
+ */
651
+ declare const parseContainerComponent: (containerComponentType?: ContainerComponentType) => ParsedContainerComponentType;
652
+
653
+ declare type TimeBaseInput = {
654
+ numerator?: number | string;
655
+ denominator?: number | string;
656
+ };
657
+ /**
658
+ * TimeBase class representing the TimeBaseType in VidiCore
659
+ *
660
+ * For more info, see the [Time bases section in VidiCore API Docs](https://apidoc.vidispine.com/latest/time.html#time-bases)
661
+ *
662
+ * @category Time
663
+ */
664
+ declare class TimeBase {
665
+ numerator: number;
666
+ denominator: number;
667
+ /**
668
+ * Constructor for TimeBase
669
+ *
670
+ * @param timeBaseType A TimeBaseType object
671
+ */
672
+ constructor(timeBaseType?: TimeBaseInput);
673
+ /**
674
+ * Get TimeBase in a constant representation (e.g. "PAL") if possible, otherwise undefined
675
+ * @returns Constant representation of the TimeBase
676
+ */
677
+ toConstant(): string;
678
+ /**
679
+ * Get TimeBase as a VidiCore TimeBaseType string
680
+ *
681
+ * @remarks
682
+ * Default format: denominator(:numerator if > 1)
683
+ * `constant` has precedence over `fraction` if both are true (e.g. NTSC > 30000:1001)
684
+ *
685
+ * @param options For how to display it as text
686
+ * @returns Text representation of the TimeBase
687
+ */
688
+ toText(options?: {
689
+ constant?: boolean;
690
+ fraction?: boolean;
691
+ }): string;
692
+ /**
693
+ * Output TimeBase as frame rate (by default max 16 decimal places)
694
+ *
695
+ * @remarks
696
+ * For `options.fixed`:
697
+ * - `true` gives two decimal places
698
+ * - `false` gives max amount of decimal places
699
+ * - `number` gives that amount of decimal places
700
+ *
701
+ * Default format: rate with two decimals if needed (i.e. decimals are > 0)
702
+ * Option precedence (when all true): `constant` > `rounded` > `fixed`
703
+ *
704
+ * @param options For how to display it as rate
705
+ *
706
+ * @return Rate of the TimeBase
707
+ *
708
+ * @category Time
709
+ */
710
+ toRate(options?: {
711
+ fixed?: boolean | number;
712
+ rounded?: boolean;
713
+ }): number;
714
+ /**
715
+ * Get TimeBase in a object representation
716
+ *
717
+ * @returns TimeBase as `{denominator, numerator}` object
718
+ */
719
+ toObject(): TimeBaseType;
720
+ /**
721
+ * @deprecated Use {@link TimeBase#toObject | toObject} instead
722
+ *
723
+ * @returns TimeBase as `{denominator, numerator}` object
724
+ */
725
+ toJson(): TimeBaseType;
726
+ }
727
+
728
+ /**
729
+ * Create a TimeBase Instance from a number, string or object representation of a time base
730
+ *
731
+ * @param timeBase Input to create time base from
732
+ * @returns A TimeBase instance
733
+ *
734
+ * @category Time
735
+ */
736
+ declare const createTimeBase: (timeBase: TimeBaseInput | string | number) => TimeBase;
737
+
738
+ /**
739
+ * Format a string representation of a time base to a TimeBase Instance
740
+ *
741
+ * @param timeBaseText The string to format to a TimeBase instance
742
+ * @returns A TimeBase Instance
743
+ *
744
+ * @category Time
745
+ */
746
+ declare const formatTimeBaseText: (timeBaseText?: string | number) => TimeBase;
747
+
748
+ /**
749
+ * Create a TimeBase instance of an object
750
+ *
751
+ * @param timeBase A TimeBase object
752
+ * @returns A TimeBase instance
753
+ *
754
+ * @category Time
755
+ */
756
+ declare const formatTimeBaseType: (timeBase: TimeBaseInput) => TimeBase;
757
+
758
+ declare type TimeCodeInput = {
759
+ samples?: number | string;
760
+ timeBase?: string | TimeBaseInput | TimeBase;
761
+ };
762
+ declare type TimeCodeInputOptions = {
763
+ dropFrame?: boolean;
764
+ frameSeparator?: string;
765
+ };
766
+ /**
767
+ * TimeCode class representing the TimeCodeType in VidiCore
768
+ *
769
+ * For more info, see the [Time Codes section of VidiCore API Docs](https://apidoc.vidispine.com/latest/time.html#time-codes)
770
+ *
771
+ * @category Time
772
+ */
773
+ declare class TimeCode {
774
+ samples: number;
775
+ timeBase: TimeBase;
776
+ dropFrame?: boolean;
777
+ frameSeparator?: string;
778
+ /**
779
+ * Constructor for TimeCode
780
+ *
781
+ * @param timeCodeType Object to create TimeCode of
782
+ * @param options Options for the timeCode
783
+ */
784
+ constructor(timeCodeType: TimeCodeInput, options?: TimeCodeInputOptions);
785
+ /**
786
+ * Return this TimeCode added with the supplied timeCodeType
787
+ * If time bases differ, it will retain the time base of this TimeCode instance
788
+ * If supplied time code has a more granular time base - it will round down exceeding samples (hasn't reached that sample yet)
789
+ *
790
+ * Note: This might make you "lose" frames depending on granularity of time bases, e.g.
791
+ * "51@50".add("25@25") => "101@50"
792
+ * while "25@25".add("51@50") => "50@25" (not "101@50")
793
+ *
794
+ * @param timeCode A TimeCode instance you want to add with
795
+ * @returns A new TimeCode instance with the addition applied
796
+ */
797
+ add(timeCode: TimeCode): TimeCode;
798
+ /**
799
+ * Return this TimeCode subtracted with the supplied timeCodeType
800
+ * If time bases differ, it will retain the time base of the instance time code
801
+ * If supplied time code has a more granular time base - it will round down exceeding samples (hasn't reached that sample yet)
802
+ *
803
+ * Note: This might make you "lose" frames depending on granularity of time bases, e.g.
804
+ * "101@50".subtract("25@25") => "51@50"
805
+ * while "50@25".subtract("51@50") => "25@25" (not "49@50")
806
+ *
807
+ * @param timeCode A TimeCode instance you want to subtract with
808
+ * @returns A new TimeCode instance with the subtraction applied
809
+ */
810
+ subtract(timeCode: TimeCode): TimeCode;
811
+ /**
812
+ * Creates a new TimeCode instance with specified timeBase and samples adjusted to that.
813
+ *
814
+ * If it conforms to a less granular time base - it will floor samples (hasn't reached that sample yet)
815
+ * - e.g. "51@50".conformTo("PAL") => "25@PAL" (not "26@PAL")
816
+ *
817
+ * @param timeBase The TimeBase it should conform the TimeCode to
818
+ * @returns A new TimeCode instance with the conformTo timeBase applied
819
+ */
820
+ conformTimeBase(timeBase: TimeCodeInput['timeBase']): TimeCode;
821
+ /**
822
+ * Get TimeCode as a text representation
823
+ *
824
+ * @remarks
825
+ * Default format: samples@denominator(:numerator if > 1)
826
+ * `constant` has precedence over `fraction` if both are true
827
+ *
828
+ * @param options Options for how to format text
829
+ * @returns Text representation of TimeCode
830
+ *
831
+ * @category Time
832
+ */
833
+ toText(options?: {
834
+ includeTimeBaseForSeconds?: boolean;
835
+ constant?: boolean;
836
+ fraction?: boolean;
837
+ }): string;
838
+ /**
839
+ * Get TimeCode in a units object representation
840
+ *
841
+ * @returns Units (time and frames) for the time code
842
+ */
843
+ toUnits(): {
844
+ hours: number;
845
+ minutes: number;
846
+ seconds: number;
847
+ frames: number;
848
+ };
849
+ /**
850
+ * Get TimeCode in a time object representation
851
+ * "milliseconds" is rounded down, if you want another representation use "partialSeconds"
852
+ *
853
+ * @returns Time for the time code
854
+ */
855
+ toTime(): {
856
+ hours: number;
857
+ minutes: number;
858
+ seconds: number;
859
+ milliseconds: number;
860
+ partialSeconds: number;
861
+ };
862
+ /**
863
+ * Get TimeCode in a seconds representation
864
+ *
865
+ * @returns Total seconds for the time code
866
+ */
867
+ toSeconds(): number;
868
+ /**
869
+ * Get TimeCode in a duration representation
870
+ * The time unit char keys for the format string are:
871
+ * - "h" for hour
872
+ * - "m" for minute
873
+ * - "s" for seconds
874
+ * - "S" for milliseconds
875
+ * Any other char will be kept in the duration output string.
876
+ *
877
+ * Add consecutive chars for zero padding.
878
+ *
879
+ * By default it:
880
+ * - uses colon delimiter (e.g. for format "hhmmss")
881
+ * - shows "m:ss" or "h:mm:ss" if format is undefined
882
+ *
883
+ * @param options Options for how to display duration
884
+ * @returns Duration representation of the TimeCode
885
+ */
886
+ toDuration(options?: {
887
+ format?: string;
888
+ }): string;
889
+ /**
890
+ * Get TimeCode in a smpte representation
891
+ *
892
+ * @returns Smpte representation of the TimeCode
893
+ */
894
+ toSmpte(): string;
895
+ /**
896
+ * Get TimeCode as a VidiCore TimeCodeType object
897
+ *
898
+ * @returns TimeCode as `{ samples, timeBase }`
899
+ */
900
+ toObject(): {
901
+ samples: number;
902
+ timeBase: _vidispine_types.RationalType;
903
+ };
904
+ /**
905
+ * @deprecated Use {@link TimeCode#toObject | toObject} instead
906
+ *
907
+ * @returns TimeCode as `{ samples, timeBase }`
908
+ */
909
+ toJson(): {
910
+ samples: number;
911
+ timeBase: _vidispine_types.RationalType;
912
+ };
913
+ }
914
+
915
+ declare type FormatTimeCodeSecondsOptions = {
916
+ timeBase?: number | string | TimeBaseInput;
917
+ useGCD?: boolean;
918
+ } & TimeCodeInputOptions;
919
+ /**
920
+ * Format seconds to TimeCode object
921
+ * Input time base is always 1:1 since it expects seconds as input
922
+ *
923
+ * Note: Max 15 digits accuracy (double precision float64), e.g.
924
+ * - 10^6 seconds can have 10^9 decimals (nanosecond) precision
925
+ * - 10^9 seconds can have 10^6 decimals (microsecond) precision
926
+ * - 10^12 seconds can have 10^3 decimals (millisecond) precision
927
+ *
928
+ * @param seconds With or without decimals ("." and "," are both interpreted as decimal)
929
+ * @param options Options for how to format the seconds to a TimeCode
930
+ * @returns A TimeCode instance
931
+ *
932
+ * @category Time
933
+ */
934
+ declare const formatTimeCodeSeconds: (seconds: string | number, options?: FormatTimeCodeSecondsOptions) => TimeCode;
935
+
936
+ declare type FormatTimeCodeSmpteOptions = {
937
+ timeBase?: number | string | TimeBaseInput;
938
+ exceedingMode?: 'add' | 'ignore' | 'error';
939
+ dropFrame?: boolean;
940
+ frameSeparator?: string;
941
+ } & Omit<TimeCodeInputOptions, 'dropFrame' | ' frameSeparator'>;
942
+ /**
943
+ * Format smpte text to a TimeCode Instance
944
+ *
945
+ * exceedingMode:
946
+ * - "overflow" exceeding values will be kept (e.g. PAL and 00:00:00:25 => 00:00:01:00)
947
+ * - "truncate" exceeding values will be truncated (e.g. PAL and 00:00:00:25 => 00:00:00:24)
948
+ * - "error" exceeding values will throw error (e.g. PAL and 00:00:00:25 => Error)
949
+ *
950
+ * @param smpte String representation of smpte
951
+ * @param options Options for creating the time code from smpte
952
+ * @returns TimeCode instance created from smpte string
953
+ *
954
+ * @category Time
955
+ */
956
+ declare const formatTimeCodeSmpte: (smpte: string, options?: FormatTimeCodeSmpteOptions) => TimeCode;
957
+
958
+ declare type FormatTimeCodeTextOptions = {
959
+ timeBase?: number | string | TimeBaseInput;
960
+ } & TimeCodeInputOptions;
961
+ /**
962
+ * Format text to a TimeCode instance
963
+ *
964
+ * @returns A TimeCode instance
965
+ *
966
+ * @category Time
967
+ */
968
+ declare const formatTimeCodeText: (timeCodeText?: number | string, options?: FormatTimeCodeTextOptions) => TimeCode;
969
+
970
+ declare type CreateTimeCodeOptions = TimeCodeInputOptions | FormatTimeCodeSmpteOptions | FormatTimeCodeSecondsOptions | FormatTimeCodeTextOptions;
971
+ /**
972
+ * Create a TimeCode instance from smpte, seconds/samples, timeCode object or string
973
+ *
974
+ * @param timeCode Smpte, seconds/samples, timeCode object or string
975
+ * @param options For the format functions
976
+ * @returns A TimeCode instance
977
+ *
978
+ * @category Time
979
+ */
980
+ declare const createTimeCode: (timeCode: TimeCodeInput | string | number, options?: CreateTimeCodeOptions) => TimeCode;
981
+
982
+ /**
983
+ * Format an object to a TimeCode instance
984
+ *
985
+ * @param timeCode To create TimeCode instance of
986
+ * @param options For the TimeCode constructor
987
+ * @returns A TimeCode instance
988
+ *
989
+ * @category Time
990
+ */
991
+ declare const formatTimeCodeType: (timeCode: TimeCodeInput, options?: TimeCodeInputOptions) => TimeCode;
992
+
993
+ declare type ParsedVideoComponentType = {
994
+ videoFormat?: string;
995
+ dimension?: string;
996
+ frameRate?: string | number;
997
+ height?: number;
998
+ width?: number;
999
+ timeBase?: TimeBase;
1000
+ timeCode?: TimeCode;
1001
+ videoCodec?: string;
1002
+ smpte?: string;
1003
+ videoBitrate?: string;
1004
+ fieldOrder?: string;
1005
+ colorSpace?: string;
1006
+ chromaSubsampling?: string;
1007
+ aspectRatio?: string;
1008
+ colorPrimaries?: string;
1009
+ videoMetadata?: {
1010
+ [key: string]: string;
1011
+ };
1012
+ videoMediaInfo?: ParsedVideoMediaInfoType;
1013
+ };
1014
+ /**
1015
+ * Parses the technical information of a VideoComponentType.
1016
+ * @param {Object} videoComponentType - A VideoComponentType from VidiCore.
1017
+ * @returns {Object} Parsed component object.
1018
+ *
1019
+ * @category Shape
1020
+ */
1021
+ declare const parseVideoComponent: (videoComponentType?: VideoComponentType) => ParsedVideoComponentType;
1022
+
1023
+ declare type ParsedShapeType = {
1024
+ uri?: string;
1025
+ tag?: string;
1026
+ mimeType?: string;
1027
+ } & ParsedContainerComponentType & ParsedBinaryComponentType & ParsedAudioComponentType & ParsedVideoComponentType;
1028
+ /**
1029
+ * Parses the technical information of a ShapeType and its various components.
1030
+ *
1031
+ * Will only parse the first videoComponent, audioComponent, binaryComponent in the corresponding array.
1032
+ * To parse a selected component see:
1033
+ * - {@link parseContainerComponent}
1034
+ * - {@link parseVideoComponent}
1035
+ * - {@link parseAudioComponent}
1036
+ * - {@link parseBinaryComponent}
1037
+ * @param shapeType - A ShapeType from VidiCore.
1038
+ * @returns Parsed shape object.
1039
+ *
1040
+ * @category Shape
1041
+ */
1042
+ declare const parseShapeType: (shapeType?: ShapeType) => ParsedShapeType;
1043
+
1044
+ declare const DOCUMENT_TYPES: {
1045
+ readonly PDF: "PDF";
1046
+ readonly TEXT: "TEXT";
1047
+ readonly MSWORD: "MSWORD";
1048
+ readonly JSON: "JSON";
1049
+ readonly XML: "XML";
1050
+ };
1051
+ declare type DocumentType = keyof typeof DOCUMENT_TYPES;
1052
+ /**
1053
+ * Return a const for the document type of a shape (looks at mimeType)
1054
+ *
1055
+ * @param shape
1056
+ * @returns The document type for a shape
1057
+ *
1058
+ * @category Shape
1059
+ */
1060
+ declare const getDocumentType: (shape: {
1061
+ mimeType?: string | string[];
1062
+ }) => DocumentType;
1063
+
1064
+ declare type FilteredShapeListObject = {
1065
+ src: string;
1066
+ type: string;
1067
+ shape: ParsedShapeType;
1068
+ [key: string]: string | ParsedShapeType;
1069
+ };
1070
+ declare type FilterShapeSourceOption = {
1071
+ sortPriority?: Function;
1072
+ allowedMimeTypes?: string[];
1073
+ allowedMethods?: string[];
1074
+ sourceKey?: string;
1075
+ mimeTypeKey?: string;
1076
+ shapeKey?: string;
1077
+ };
1078
+ /**
1079
+ * Filter a shape type list to get shapes that are playable in a browser
1080
+ *
1081
+ * @param itemType
1082
+ * @param options
1083
+ * @returns
1084
+ *
1085
+ * @category Shape
1086
+ */
1087
+ declare const filterShapeSource: (itemType: ItemType, options: FilterShapeSourceOption) => FilteredShapeListObject[];
1088
+
1089
+ declare const SHAPE_MEDIA_TYPES: {
1090
+ readonly IMAGE: "IMAGE";
1091
+ readonly AUDIO: "AUDIO";
1092
+ readonly VIDEO: "VIDEO";
1093
+ readonly DOCUMENT: "DOCUMENT";
1094
+ readonly BINARY: "BINARY";
1095
+ };
1096
+ declare type ShapeMediaType = keyof typeof SHAPE_MEDIA_TYPES;
1097
+ /**
1098
+ * Returns a const for which media type a shape has
1099
+ *
1100
+ * @param parsedShape
1101
+ * @returns
1102
+ *
1103
+ * @category Shape
1104
+ */
1105
+ declare const getShapeMediaType: (parsedShape: ParsedShapeType) => ShapeMediaType;
1106
+
1107
+ /**
1108
+ * Find the thumbnail uri in a VidiCore item object that's nearest a timeCode
1109
+ *
1110
+ * @remarks
1111
+ * Time code is included in path of VidiCore thumbnail uris
1112
+ *
1113
+ * @param itemType A VidiCore item object
1114
+ * @param timeCode A timeCode to find nearest thumbnail to
1115
+ * @returns A URI of a thumbnail, `undefined` if item has no thumbnails
1116
+ *
1117
+ * @category Thumbnail
1118
+ */
1119
+ declare const findNearestThumbnail: (itemType: ItemType, timeCode: TimeCode | TimeCodeInput) => string;
1120
+
1121
+ /**
1122
+ * TODO
1123
+ */
1124
+ declare type ParsedMediaConvertTranscodePreset = {
1125
+ description?: string;
1126
+ containerFormat?: any;
1127
+ videoFormat?: string;
1128
+ height?: number;
1129
+ width?: number;
1130
+ dimension?: string;
1131
+ aspectRatio?: string;
1132
+ fieldOrder?: string;
1133
+ videoBitrate?: number;
1134
+ timeBase?: TimeBase;
1135
+ frameRate?: string | number;
1136
+ audioFormat?: string;
1137
+ audioSamplerate?: string;
1138
+ audioBitrate?: string;
1139
+ audioBitRateMode?: string;
1140
+ };
1141
+ /**
1142
+ * TODO
1143
+ *
1144
+ * @param mediaconvert
1145
+ * @returns
1146
+ *
1147
+ * @category Transcode
1148
+ */
1149
+ declare const parseMediaConvertPreset: (mediaconvert: TranscodePresetType['mediaconvert']) => ParsedMediaConvertTranscodePreset;
1150
+
1151
+ /**
1152
+ * TODO
1153
+ */
1154
+ declare type ParsedTranscodePreset = {
1155
+ description?: string;
1156
+ containerFormat?: any;
1157
+ videoFormat?: string;
1158
+ height?: number;
1159
+ width?: number;
1160
+ dimension?: string;
1161
+ aspectRatio?: string;
1162
+ fieldOrder?: string;
1163
+ videoBitrate?: number;
1164
+ timeBase?: TimeBase;
1165
+ frameRate?: string | number;
1166
+ audioFormat?: string;
1167
+ audioSamplerate?: string;
1168
+ audioBitrate?: string;
1169
+ audioBitRateMode?: string;
1170
+ audioChannels?: number;
1171
+ };
1172
+ /**
1173
+ * TODO
1174
+ *
1175
+ * @param transcodePresetType
1176
+ * @returns
1177
+ *
1178
+ * @category Transcode
1179
+ */
1180
+ declare const parseTranscodePreset: (transcodePresetType: TranscodePresetType) => ParsedTranscodePreset;
1181
+
1182
+ export { CreateFacetTypeFieldList, CreateFacetTypeOptions, CreateMetadataTypeInput, CreateTimeCodeOptions, DocumentType, FIELD_ATTRIBUTE_KEYS, FIELD_VALUE_ATTRIBUTE_KEYS, 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, SYSTEM_FIELDGROUPS, SYSTEM_FIELDS, ShapeMediaType, TimeBase, TimeBaseInput, TimeCode, TimeCodeInput, TimeCodeInputOptions, createFacetType, createMetadataType, createTimeBase, createTimeCode, filterShapeSource, findNearestThumbnail, formatTimeBaseText, formatTimeBaseType, formatTimeCodeSeconds, formatTimeCodeSmpte, formatTimeCodeText, formatTimeCodeType, getDocumentType, getShapeMediaType, metadataTypeToWebVtt, parseAudioComponent, parseBinaryComponent, parseContainerComponent, parseFacetType, parseFieldList, parseFileType, parseGroupList, parseHighlightTimespan, parseHighlightTimespanList, parseKeyValuePairTypes as parseKeyValuePairType, parseMediaConvertPreset, parseMetadataType, parseNowDate, parseShapeType, parseSimpleMetadataType, parseTimespan, parseTimespanList, parseTranscodePreset, parseVideoComponent };