@vidispine/vdt-js 23.2.0-pre.1 → 23.2.0-pre.2

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