Skip to content

Commit

Permalink
Update transformation types for Cloudinary Video Player cloudinary-co…
Browse files Browse the repository at this point in the history
  • Loading branch information
nooras committed Oct 9, 2024
1 parent 65eb446 commit f2e6659
Show file tree
Hide file tree
Showing 2 changed files with 347 additions and 1 deletion.
5 changes: 4 additions & 1 deletion packages/types/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -30,5 +30,8 @@
"bugs": {
"url": "https://github.com/cloudinary-community/cloudinary-util/issues"
},
"homepage": "https://github.com/cloudinary-community/cloudinary-util"
"homepage": "https://github.com/cloudinary-community/cloudinary-util",
"dependencies": {
"@cloudinary/url-gen": "1.15.0"
}
}
343 changes: 343 additions & 0 deletions packages/types/src/types/cloudinary-video-player.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
import {
type Transformation,
} from "@cloudinary/url-gen";

export interface CloudinaryVideoPlayerPlaylistOptions {
/**
* Whether to auto-advance to the next video and the delay between them.
Expand Down Expand Up @@ -483,3 +487,342 @@ export interface CloudinaryVideoPlayerOptionPosterOptions {
*/
posterColor?: string;
}

export type AudioCodecType = string | "none" | "aac" | "vorbis" | "mp3";

export type AudioFrequency =
string
| number
| 8000
| 11025
| 16000
| 22050
| 32000
| 37800
| 44056
| 44100
| 47250
| 48000
| 88200
| 96000
| 176400
| 192000;

export type ColorSpaceType =
string
| "srgb"
| "cmyk"
|"no_cmyk"
| "keep_cmyk"
| "tinysrgb"
| "srgb:truecolor";

export type CropMode =
string
| "scale"
| "fit"
| "limit"
| "mfit"
| "fill"
| "lfill"
| "pad"
| "lpad"
| "mpad"
| "crop"
| "thumb"
| "imagga_crop"
| "imagga_scale";

export type Gravity =
string
| "north_west"
| "north"
| "north_east"
| "west"
| "center"
| "east"
| "south_west"
| "south"
| "south_east"
| "xy_center"
| "face"
| "face:center"
| "face:auto"
| "faces"
| "faces:center"
| "faces:auto"
| "body"
| "body:face"
| "adv_face"
| "adv_faces"
| "adv_eyes"
| "custom"
| "custom:face"
| "custom:faces"
| "custom:adv_face"
| "custom:adv_faces"
| "auto"
| "auto:adv_face"
| "auto:adv_faces"
| "auto:adv_eyes"
| "auto:body"
| "auto:face"
| "auto:faces"
| "auto:custom_no_override"
| "auto:none"
| "liquid"
| "ocr_text";

export type ImageEffect =
string
| "hue"
| "red"
| "green"
| "blue"
| "negate"
| "brightness"
| "auto_brightness"
| "brightness_hsb"
| "sepia"
| "grayscale"
| "blackwhite"
| "saturation"
| "colorize"
| "replace_color"
| "simulate_colorblind"
| "assist_colorblind"
| "recolor"
| "tint"
| "contrast"
| "auto_contrast"
| "auto_color"
| "vibrance"
| "noise"
| "ordered_dither"
| "pixelate_faces"
| "pixelate_region"
| "pixelate"
| "unsharp_mask"
| "sharpen"
| "blur_faces"
| "blur_region"
| "blur"
| "tilt_shift"
| "gradient_fade"
| "vignette"
| "anti_removal"
| "overlay"
| "mask"
| "multiply"
| "displace"
| "shear"
| "distort"
| "trim"
| "make_transparent"
| "shadow"
| "viesus_correct"
| "fill_light"
| "gamma"
| "improve";

export type ImageFlags =
string
| Array<string>
| "any_format"
| "attachment"
| "apng"
| "awebp"
| "clip"
| "clip_evenodd"
| "cutter"
| "force_strip"
| "force_icc"
| "getinfo"
| "ignore_aspect_ratio"
| "immutable_cache"
| "keep_attribution"
| "keep_iptc"
| "layer_apply"
| "lossy"
| "preserve_transparency"
| "png8"
| "png24"
| "png32"
| "progressive"
| "rasterize"
| "region_relative"
| "relative"
| "replace_image"
| "sanitize"
| "strip_profile"
| "text_no_trim"
| "no_overflow"
| "text_disallow_overflow"
| "tiff8_lzw"
| "tiled";

export type ImageFormatType =
string |
'usdz'|
'jp2'|
'ai'|
'auto'|
'bmp'|
'eps'|
'flif'|
'gif'|
'heic'|
'ico'|
'jpc'|
'jpg'|
'pdf'|
'png'|
'psd'|
'svg'|
'tiff'|
'wdp'|
'webp'|
'arw'|
'aac'|
'aiff'|
'amr'|
'flac'|
'm4a'|
'mp3'|
'ogg'|
'opus'|
'wav'|
'avif'|
'cr2'|
'djvu'|
'eps3'|
'ept'|
'fxb'|
'gltf'|
'hdp'|
'heif'|
'indd'|
'jpe'|
'jpeg'|
'jxr'|
'ps'|
'spd'|
'tga'|
'tif'|
'3g2'|
'3gp'|
'avi'|
'flv'|
'm2ts'|
'm3u8'|
'mkv'|
'mov'|
'mp4'|
'mpd'|
'mpeg'|
'mts'|
'mxf'|
'ogv'|
'ts'|
'webm'|
'wmv'|
'glb';

export type RotationModeType =
stringOrNumber
| Array<stringOrNumber>
| "auto_right"
| "auto_left"
| "ignore"
| "vflip"
| "hflip";

export type StreamingProfileTypes =
string
| "4k"
| "full_hd"
| "hd"
| "sd"
| "full_hd_wifi"
| "full_hd_lean"
| "hd_lean";

export type stringOrNumber = number | string;

export interface LegacyITransforamtionOptions {
transformation?: LegacyITransforamtionOptions | string | Transformation;
raw_transformation?: string;
crop?: CropMode;
width?: stringOrNumber;
height?: stringOrNumber;
size?: string;
aspect_ratio?: stringOrNumber;
gravity?: Gravity;
x?: stringOrNumber;
y?: stringOrNumber;
zoom?: stringOrNumber;
background?: string;
angle?: RotationModeType;
radius?: stringOrNumber | stringOrNumber[];
overlay?: string | Record<string, any>;
custom_function?: string | { function_type?: string | "wasm" | "remote", source?: string }
variables?: Array<string | Record<string, any>>;
if?: string;
else?: string;
end_if?: string;
dpr?: stringOrNumber;
quality?: stringOrNumber;
delay?: stringOrNumber;
// eslint-disable-next-line @typescript-eslint/ban-types
underlay?: string | Object;
color?: string;
color_space?: ColorSpaceType;
opacity?: stringOrNumber;
border?: {
width?: stringOrNumber;
color?: string;
} | string;
default_image?: string;
density?: stringOrNumber;
format?: ImageFormatType;
fetch_format?: ImageFormatType;
effect?: string | Array<stringOrNumber> | ImageEffect;
page?: stringOrNumber;
flags?: ImageFlags | [] | string;
audio_codec?: AudioCodecType;
audio_frequency?: AudioFrequency;
// eslint-disable-next-line @typescript-eslint/ban-types
video_codec?: string | Object;
bit_rate?: stringOrNumber;
fps?: string | Array<stringOrNumber>;
keyframe_interval?: string;
offset?: string,
start_offset?: stringOrNumber;
end_offset?: stringOrNumber;
duration?: stringOrNumber;
streaming_profile?: StreamingProfileTypes
video_sampling?: stringOrNumber;
cloud_name?: string;
api_key?: string;
api_secret?: string;
private_cdn?: boolean;
secure_distribution?: string;
force_version?: boolean;
ssl_detected?: boolean;
secure?: boolean;
cdn_subdomain?: boolean;
secure_cdn_subdomain?: boolean;
cname?: string;
shorten?: boolean;
sign_url?: boolean;
long_url_signature?: boolean;
use_root_path?: boolean;
// eslint-disable-next-line @typescript-eslint/ban-types
auth_token?: object;
account_id?: string;
provisioning_api_key?: string;
provisioning_api_secret?: string;
version?: stringOrNumber;
url_suffix?: string;
[futureKey: string]: any;
}

0 comments on commit f2e6659

Please sign in to comment.