@datocms/cma-client
Version:
JS client for DatoCMS REST Content Management API
28 lines (27 loc) • 982 B
TypeScript
import { type LocalizedFieldValue } from '../utilities/normalizedFieldValues';
import type { VideoEditorConfiguration } from './appearance/video';
import type { RequiredValidator } from './validators/required';
export type VideoFieldValue = {
provider: 'youtube' | 'vimeo' | 'facebook';
provider_uid: string;
url: string;
width: number;
height: number;
thumbnail_url: string;
title: string;
} | null;
export declare function isVideoFieldValue(value: unknown): value is VideoFieldValue;
export declare function isLocalizedVideoFieldValue(value: unknown): value is LocalizedFieldValue<VideoFieldValue>;
export type VideoFieldValidators = {
/** Value must be specified or it won't be valid */
required?: RequiredValidator;
};
export type VideoFieldAppearance = {
editor: 'video';
parameters: VideoEditorConfiguration;
} | {
/** Plugin ID */
editor: string;
/** Plugin configuration */
parameters: Record<string, unknown>;
};