import type { SiloClientOptions, UploadResult, UploadOptions, SignedUrlResult, SignOptions, ListFilesResult, ListBucketsResult, DashboardData, OrgQuota, SiloBucket, SiloFile, SiloAgeRating, MultipartStartResult, MultipartStartOptions, MultipartPartUrl, MultipartPart, ImageUploadOptions, VideoUploadOptions, BatchStartOptions, BatchStartResult, BatchStatus, DeleteFileResult } from "./types.js"; export type { SiloClientOptions } from "./types.js"; export declare class SiloClient { private baseUrl; private appUrl; private token?; private tokenProvider?; private defaultBucket; private serviceAccount?; constructor(opts: SiloClientOptions); private tokenExpiry; private jwtExpiry; setToken(token: string): void; private ensureFreshToken; private headers; private request; upload(file: File | Blob, opts?: UploadOptions): Promise; uploadBatch(files: File[], opts?: UploadOptions): Promise<{ files: UploadResult[]; }>; getSignedUrl(fileId: string, opts?: SignOptions): Promise; getFileMeta(fileId: string): Promise; getPublicFileMeta(fileId: string, query?: string): Promise; updateFile(fileId: string, data: { isPrivate?: boolean; title?: string | null; description?: string | null; tags?: string[]; age_ratings?: Record | null; }): Promise; /** * Deletes a file by id. Maps the API's status codes to a typed result instead of throwing: * - 204: deleted (or already gone/not found) * - 202: deletion queued (S3 objects are purged asynchronously) * - 409: cannot delete yet (FAILED, or still processing — retry later or use markFileForDeletion) */ deleteFile(fileId: string): Promise; markFileForDeletion(fileId: string): Promise<{ ok: boolean; }>; retryFile(fileId: string): Promise<{ ok: boolean; jobId: string; }>; repairVariants(fileId: string): Promise<{ ok: boolean; storyboard: boolean; captions: boolean; }>; purgeThumbnail(fileId: string): Promise<{ ok: boolean; deleted: number; }>; purgeTransformCache(fileId: string): Promise<{ ok: boolean; deleted: number; }>; startMultipartUpload(opts: MultipartStartOptions): Promise; getUploadPartUrl(fileId: string, uploadId: string, partNumber: number): Promise; completeMultipartUpload(fileId: string, uploadId: string, parts: MultipartPart[], opts?: { image?: ImageUploadOptions; video?: VideoUploadOptions; }): Promise; abortMultipartUpload(fileId: string, uploadId: string): Promise; startBatch(opts: BatchStartOptions): Promise; getBatchStatus(batchId: string): Promise; cancelBatch(batchId: string): Promise; getDashboardData(): Promise; setPlan(plan: "starter" | "pro" | "business"): Promise; listBuckets(): Promise; createBucket(name: string, options?: { slug?: string; visibility?: "PUBLIC" | "PRIVATE"; }): Promise; deleteBucket(bucket: string): Promise; getHlsUrl(fileId: string, _opts?: SignOptions): Promise<{ url: string; storyboardUrl: string; expiresIn: number; }>; listFiles(bucket?: string, opts?: { cursor?: string; limit?: number; }): Promise; /** Dashboard viewer page URL — /view/{id} on the Silo app. */ getViewUrl(fileId: string): string; /** * Signed URL for direct file download — presigned S3 (private) or CDN (public). * Pass `disposition: "attachment"` to force download, `ttl` to override default TTL. */ getFileUrl(fileId: string, opts?: Pick): Promise; /** HLS master playlist URL — API rewrites rung URLs and presigns segments. */ getHlsStreamUrl(fileId: string): Promise; /** Thumbnail — API returns { url } pointing to best resolution for device. */ getThumbnailUrl(fileId: string): Promise; /** Storyboard — returns VTT URL chosen based on device screen and connection quality. */ getStoryboardUrl(fileId: string): Promise; /** Returns the URL of the captions endpoint (returns JSON array of tracks). Pass as ``. */ getCaptionsUrl(fileId: string, opts?: { lang?: string; }): Promise; /** Returns the URL of the chapters endpoint (returns JSON array of chapters). Pass as ``. */ getChaptersUrl(fileId: string): Promise; /** Set or update a user's reaction on a file. */ setRating(fileId: string, userId: string, reaction: "LOVE" | "LIKE" | "DISLIKE"): Promise<{ fileId: string; userId: string; reaction: string; }>; /** Remove a user's reaction from a file. */ removeRating(fileId: string, userId: string): Promise; /** Get a user's reaction on a file (individual). */ getUserRating(fileId: string, userId: string): Promise<{ fileId: string; userId: string; reaction: "LOVE" | "LIKE" | "DISLIKE" | null; }>; /** Get aggregate reactions for a file. */ getAggregateRating(fileId: string): Promise<{ fileId: string; LOVE: number; LIKE: number; DISLIKE: number; }>; /** Upload or replace a caption track (VTT content as string). */ uploadCaption(fileId: string, opts: { language: string; label?: string; vtt: string; }): Promise<{ id: string; language: string; label: string | null; }>; /** Delete a caption track by captionId. */ deleteCaption(fileId: string, captionId: string): Promise; listAgeRatings(region?: string): Promise<{ items: SiloAgeRating[]; }>; createAgeRating(data: { region: string; code: string; title: string; description: string; imageUrl?: string | null; }): Promise; updateAgeRating(id: string, data: Partial<{ region: string; code: string; title: string; description: string; imageUrl: string | null; }>): Promise; deleteAgeRating(id: string): Promise; uploadAgeRatingImage(id: string, file: File | Blob): Promise<{ imageUrl: string; imageKey: string; }>; private _getToken; private _buildAuthedUrl; /** @deprecated Use getFileUrl */ getDirectUrl(fileId: string, opts?: Pick): Promise; /** @deprecated Use getFileUrl */ getApiUrl(bucket: string, key: string): string; /** @deprecated Use getThumbnailUrl (now async) */ getThumbnailUrlSync(fileId: string): string; /** @deprecated Use getThumbnailUrl */ getThumbnailUrlAsync(fileId: string): Promise; /** @deprecated Use getThumbnailUrl and fetch the URL yourself if you need the blob */ fetchThumbnail(fileId: string): Promise; } export declare class SiloError extends Error { status: number; body: string; constructor(status: number, body: string); } //# sourceMappingURL=client.d.ts.map