|
| 1 | +import { ResourceType } from "../cloud/ResourceType"; |
| 2 | +import { StorageType } from "../cloud/StorageType"; |
| 3 | + |
| 4 | +export type ResponseError = { |
| 5 | + message: string; |
| 6 | + http_code: number |
| 7 | +} |
| 8 | + |
| 9 | +export type ResourceOptions = { |
| 10 | + resourceType?: ResourceType; |
| 11 | + type?: StorageType; |
| 12 | +} |
| 13 | + |
| 14 | +export type SingleDeleteOptions = ResourceOptions & { |
| 15 | + invalidate?: boolean; |
| 16 | +} |
| 17 | + |
| 18 | +export type RenameOptions = ResourceOptions & { |
| 19 | + toType: StorageType; |
| 20 | + overwrite: boolean; |
| 21 | +} |
| 22 | + |
| 23 | +export type AccessMode = 'public' | 'authenticated'; |
| 24 | + |
| 25 | +export type AccessControlType = 'token' | 'anonymous' |
| 26 | + |
| 27 | +export type AccessControl = { |
| 28 | + type: AccessControlType; |
| 29 | + start?: string; |
| 30 | + end?: string; |
| 31 | +} |
| 32 | + |
| 33 | +export type ResponsiveBreakpointOption = { |
| 34 | + createDerived: boolean; |
| 35 | + format?: string; |
| 36 | + transformation?: string; |
| 37 | + maxWidth?: number; |
| 38 | + minWidth?: number; |
| 39 | + bytesStep?: number; |
| 40 | + maxImages?: number |
| 41 | +} |
| 42 | + |
| 43 | +export type AssetOptions = { |
| 44 | + tags?: string[] |
| 45 | + context?: string[] |
| 46 | + colors?: boolean |
| 47 | + faces?: boolean; |
| 48 | + qualityAnalysis?: boolean; |
| 49 | + accessibilityAnalysis?: boolean; |
| 50 | + cinemagraphAnalysis?: boolean; |
| 51 | + imageMetadata?: boolean; |
| 52 | + phash?: boolean |
| 53 | + responsiveBreakpoints?: ResponsiveBreakpointOption[] |
| 54 | + autoTagging?: number; |
| 55 | + categorization?: string; |
| 56 | + detection?: string; |
| 57 | + ocr?: string; |
| 58 | + exif?: boolean; |
| 59 | +} |
| 60 | + |
| 61 | +export type ManupulationOptions = { |
| 62 | + eager?: string[]; |
| 63 | + eageAsync?: boolean; |
| 64 | + eagerNotificationUrl?: string |
| 65 | + transformation?: string |
| 66 | + format?: string; |
| 67 | + customCoordinates?: string[] |
| 68 | + faceCoordinates?: string[] |
| 69 | + backgroundRemoval?: 'cloudinary_ai' | 'pixelz' |
| 70 | + rawConvert?: 'apose' | 'google_speech' | 'extract_text' |
| 71 | +} |
| 72 | + |
| 73 | +export type UploadOptions = ResourceOptions & ManupulationOptions & AssetOptions & { |
| 74 | + publicId?: string; |
| 75 | + folder?: string; |
| 76 | + useFilename?: boolean; |
| 77 | + uniqueFilename?: boolean; |
| 78 | + accessControl?: AccessControl; |
| 79 | + accessMode?: AccessMode; |
| 80 | + discardOriginalFilename?: boolean; |
| 81 | + overwrite?: boolean; |
| 82 | + allowedFormats?: string[]; |
| 83 | + async?: boolean; |
| 84 | + backup?: boolean; |
| 85 | + eval?: string; |
| 86 | + headers?: string; |
| 87 | + invalidate?: boolean; |
| 88 | + moderation?: string; |
| 89 | + notificationUrl?: string; |
| 90 | + proxy?: string; |
| 91 | + returnDeleteToken?: boolean; |
| 92 | +} |
0 commit comments