Skip to content

Commit 0a8b915

Browse files
committed
Update types
1 parent 21e0a2f commit 0a8b915

File tree

3 files changed

+32
-20
lines changed

3 files changed

+32
-20
lines changed

types/Timecode.d.ts

Lines changed: 15 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,15 @@
1-
/**
2-
* Timecode - React Component
3-
*
4-
* @param {Object} props
5-
* @param {String} [props.as='span'] - HTML element to render
6-
* @param {String} [props.format='H:?m:ss'] - Timecode format
7-
* @param {String} [props.postfix=''] - Postfix to append to timecode
8-
* @param {String} [props.prefix=''] - Prefix to prepend to timecode
9-
* @param {Number} [props.time=0] - Time in milliseconds
10-
* @param {Object} [rest] - Additional props to pass to HTML element
11-
* @param {React.Ref} [ref] - React ref
12-
* @returns {React.ReactElement}
13-
*/
14-
export const Timecode: import("react").ForwardRefExoticComponent<import("react").RefAttributes<any>>;
1+
import { ForwardRefExoticComponent } from 'react'
2+
3+
interface TimecodeProps {
4+
as?: String | React.ComponentType<any>
5+
// @deprecated
6+
component?: React.ComponentType<any>
7+
format?: string
8+
postfix?: string
9+
prefix?: string
10+
time?: number
11+
}
12+
13+
declare const Timecode: ForwardRefExoticComponent<TimecodeProps>
14+
15+
export default Timecode

types/tsconfig.json

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
{
2+
"compilerOptions": {
3+
"module": "commonjs",
4+
"lib": ["es6"],
5+
"noImplicitAny": true,
6+
"noImplicitThis": true,
7+
"strictNullChecks": true,
8+
"strictFunctionTypes": true,
9+
"noEmit": true
10+
}
11+
}

types/utils.d.ts

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
1-
export function parseTime(time: any): {
1+
export function parseTime(time: number): {
22
hours: number;
33
minutes: number;
44
seconds: number;
5-
milliseconds: any;
5+
milliseconds: number;
66
};
7-
export function pad(number: any, length?: number): string;
8-
export function formatMilliseconds(milliseconds: any, length?: number): string;
7+
export function pad(number: number, length?: number): string;
8+
export function formatMilliseconds(milliseconds: number, length?: number): string;
99
export function formatTimecode({ format, time }: {
10-
format: any;
11-
time: any;
10+
format: string;
11+
time: number;
1212
}): string;

0 commit comments

Comments
 (0)