Skip to content

Commit 761f48e

Browse files
Merge pull request #9 from apivideo/add-return-types
fix: add missing return types in upload methods
2 parents c01f22d + 95245de commit 761f48e

10 files changed

+299
-821
lines changed

CHANGELOG.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,9 @@
11
# Changelog
22
All changes to this project will be documented in this file.
33

4+
## [1.0.1] - 2021-11-23
5+
- Add missing return types in upload methods
6+
47
## [1.0.0] - 2021-11-16
58
- Bump dependancies
69

dist/index.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/src/common.d.ts

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,3 +3,29 @@ export declare const DEFAULT_CHUNK_SIZE: number;
33
export declare const MAX_CHUNK_SIZE: number;
44
export declare const DEFAULT_RETRIES = 5;
55
export declare const DEFAULT_API_HOST = "ws.api.video";
6+
export declare type VideoUploadResponse = {
7+
readonly videoId: string;
8+
readonly title: string;
9+
readonly description: string;
10+
readonly public: boolean;
11+
readonly panoramic: boolean;
12+
readonly mp4Support: boolean;
13+
readonly publishedAt: string;
14+
readonly createdAt: string;
15+
readonly uploadedAt: string;
16+
readonly tags: readonly string[];
17+
readonly metadata: readonly {
18+
readonly key: string;
19+
readonly value: string;
20+
}[];
21+
readonly source: {
22+
readonly type: string;
23+
readonly uri: string;
24+
};
25+
readonly assets: {
26+
readonly iframe: string;
27+
readonly player: string;
28+
readonly hsl: string;
29+
readonly thumbnail: string;
30+
};
31+
};

dist/src/progressive-video-uploader.d.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
import { VideoUploadResponse } from "./common";
12
export interface ProgressiveUploaderOptionsWithUploadToken extends Options {
23
uploadToken: string;
34
videoId?: string;
@@ -30,7 +31,7 @@ export declare class ProgressiveUploader {
3031
constructor(options: ProgressiveUploaderOptionsWithAccessToken | ProgressiveUploaderOptionsWithUploadToken);
3132
onProgress(cb: (e: ProgressiveProgressEvent) => void): void;
3233
uploadPart(file: Blob): Promise<void>;
33-
uploadLastPart(file: Blob): Promise<any>;
34+
uploadLastPart(file: Blob): Promise<VideoUploadResponse>;
3435
private createFormData;
3536
private sleep;
3637
private upload;

dist/src/video-uploader.d.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
import { VideoUploadResponse } from "./common";
12
export interface VideoUploaderOptionsWithUploadToken extends Options {
23
uploadToken: string;
34
videoId?: string;
@@ -34,7 +35,7 @@ export declare class VideoUploader {
3435
private headers;
3536
constructor(options: VideoUploaderOptionsWithAccessToken | VideoUploaderOptionsWithUploadToken);
3637
onProgress(cb: (e: UploadProgressEvent) => void): void;
37-
upload(): Promise<any>;
38+
upload(): Promise<VideoUploadResponse>;
3839
private sleep;
3940
private createFormData;
4041
private uploadCurrentChunk;

0 commit comments

Comments
 (0)