import { ObjectCannedACL, S3ClientConfig } from "@aws-sdk/client-s3"; import { Upload } from "@tus/utils"; import fs from "node:fs"; import Mux from "@mux/mux-node"; import { EventType } from "mitt"; //#region src/types/index.d.ts type ImageMimeType = 'image/apng' | 'image/avif' | 'image/gif' | 'image/jpeg' | 'image/png' | 'image/svg+xml' | 'image/webp'; type VideoMimeType = 'application/mxf' | 'video/3gpp' | 'video/3gpp2' | 'video/mp2t' | 'video/mp4' | 'video/mpeg' | 'video/quicktime' | 'video/webm' | 'video/x-f4v' | 'video/x-flv' | 'video/x-matroska' | 'video/x-ms-asf' | 'video/x-ms-wmv' | 'video/x-msvideo' | 'video/x-mxf'; type MimeType = ImageMimeType | VideoMimeType; interface MediaCloudPluginOptions { enabled?: boolean; collection?: string; view?: 'grid' | 'list'; storage?: { 'video/*': 'mux' | 's3'; 'application/mxf'?: 'mux' | 's3'; 'video/3gpp'?: 'mux' | 's3'; 'video/3gpp2'?: 'mux' | 's3'; 'video/mp2t'?: 'mux' | 's3'; 'video/mp4'?: 'mux' | 's3'; 'video/mpeg'?: 'mux' | 's3'; 'video/quicktime'?: 'mux' | 's3'; 'video/webm'?: 'mux' | 's3'; 'video/x-f4v'?: 'mux' | 's3'; 'video/x-flv'?: 'mux' | 's3'; 'video/x-matroska'?: 'mux' | 's3'; 'video/x-ms-asf'?: 'mux' | 's3'; 'video/x-ms-wmv'?: 'mux' | 's3'; 'video/x-msvideo'?: 'mux' | 's3'; 'video/x-mxf'?: 'mux' | 's3'; }; limits?: { mimeTypes?: (MimeType | 'image/*' | 'video/*')[]; fileSize?: number; concurrency?: number; }; folders?: boolean; mux?: { assetOptions: Partial; tokenId: string; tokenSecret: string; webhookSecret: string; testMode?: boolean; }; s3?: { accessKeyId: string; bucket: string; region: string; secretAccessKey: string; prefix?: string; acl?: ObjectCannedACL; endpoint?: string; respectForwardedHeaders?: boolean; }; } interface MediaCloudDefaultPluginOptions { enabled: boolean; collection: string; view: 'grid'; folders: boolean; storage: { 'video/*': 'mux'; }; limits: { mimeTypes: (MimeType | 'image/*' | 'video/*')[]; fileSize: number; concurrency: number; }; } type Storage = 'mux' | 's3'; interface MediaCloudEmitterEvents { [key: EventType]: Record; addUpload: { filename: string; uploadId?: string; polling?: boolean; pollingUrl?: string; }; updateUpload: { filename: string; progress: number; polling?: boolean; pollingUrl?: string; }; removeUpload: { uploadId?: string; filename?: string; }; uploadComplete: { filename: string; }; uploadError: { filename: string; error: string; }; } interface S3StoreConfig { expirationPeriodInMilliseconds?: number; maxConcurrentPartUploads?: number; /** * The maximum number of parts allowed in a multipart upload. Defaults to 10,000. */ maxMultipartParts?: number; /** * The minimal part size for parts. * Can be used to ensure that all non-trailing parts are exactly the same size. * Can not be lower than 5MiB or more than 5GiB. */ minPartSize?: number; /** * The preferred part size for parts send to S3. Can not be lower than 5MiB or more than 5GiB. * The server calculates the optimal part size, which takes this size into account, * but may increase it to not exceed the S3 10K parts limit. */ partSize?: number; s3ClientConfig: { acl?: ObjectCannedACL; bucket: string; } & S3ClientConfig; useTags?: boolean; } interface TusUploadMetadata { file: Upload; 'tus-version': string; 'upload-id': string; } interface IncompletePartInfo { createReader: (options: { cleanUpOnEnd: boolean; }) => fs.ReadStream; path: string; size: number; } interface AWSError extends Error { Code?: string; code?: string; } interface NodeFSError extends Error { code?: string; } type StaticRenditions = Record | null | undefined; type RequireAllNested = { [P in keyof T]-?: RequireAllNested }; //#endregion export { AWSError, ImageMimeType, IncompletePartInfo, MediaCloudDefaultPluginOptions, MediaCloudEmitterEvents, MediaCloudPluginOptions, MimeType, NodeFSError, RequireAllNested, S3StoreConfig, StaticRenditions, Storage, TusUploadMetadata, VideoMimeType }; //# sourceMappingURL=index.d.mts.map