[ffmpeg-concat] Create type definition (#43945)

* Create ffmpeg-concat type definition

* Export syntax

* Transition.params is optional
This commit is contained in:
Weslen do Nascimento 2020-04-16 20:14:18 -03:00 committed by GitHub
parent 3ce60aa3be
commit 98d8f8e220
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 74 additions and 0 deletions

View File

@ -0,0 +1,29 @@
import concat from 'ffmpeg-concat';
concat({
audio: '',
cleanupFrames: true,
concurrency: 4,
frameFormat: 'raw',
log: () => {},
output: '',
tempDir: '',
transition: {
duration: 100,
name: '',
params: { direction: [1, -1] },
},
transitions: [
{
duration: 100,
name: '',
params: { direction: [1, -1] },
},
{
duration: 100,
name: '',
params: { direction: [1, -1] },
},
],
videos: ['', ''],
});

27
types/ffmpeg-concat/index.d.ts vendored Normal file
View File

@ -0,0 +1,27 @@
// Type definitions for ffmpeg-concat 1.1
// Project: https://github.com/transitive-bullshit/ffmpeg-concat
// Definitions by: Weslen Nascimento <https://github.com/weslenng>
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
interface Transition {
duration: number;
name: string;
params?: any;
}
interface ConcatOptions {
audio?: string;
cleanupFrames?: boolean;
concurrency?: number;
frameFormat?: 'jpg' | 'png' | 'raw';
log?: (stdout: string) => void;
output: string;
tempDir?: string;
transition?: Transition;
transitions?: ReadonlyArray<Transition>;
videos: ReadonlyArray<string>;
}
declare function concat(concatOptions: ConcatOptions): Promise<void>;
export = concat;

View File

@ -0,0 +1,17 @@
{
"compilerOptions": {
"module": "commonjs",
"lib": ["es6"],
"noImplicitAny": true,
"noImplicitThis": true,
"strictFunctionTypes": true,
"strictNullChecks": true,
"baseUrl": "../",
"typeRoots": ["../"],
"types": [],
"noEmit": true,
"forceConsistentCasingInFileNames": true,
"esModuleInterop": true
},
"files": ["index.d.ts", "ffmpeg-concat-tests.ts"]
}

View File

@ -0,0 +1 @@
{ "extends": "dtslint/dt.json" }