Skip to content

Commit 8fc541c

Browse files
committed
Add types
1 parent 115faff commit 8fc541c

3 files changed

Lines changed: 28 additions & 0 deletions

File tree

types/Timecode.d.ts

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
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>>;

types/index.d.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
export { Timecode as default } from "./Timecode";
2+
export * from "./utils";

types/utils.d.ts

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

0 commit comments

Comments
 (0)