An open API service indexing awesome lists of open source software.

https://github.com/tim-smart/timecode

A simple Timecode utility class written in Typescript
https://github.com/tim-smart/timecode

smpte timecode

Last synced: 5 months ago
JSON representation

A simple Timecode utility class written in Typescript

Awesome Lists containing this project

README

          

# @tim-smart/timecode

A `Timecode` utility class for working with SMPTE timecode.

## API

Here is a copy of `dist/index.d.ts`:

```ts
export interface ITimecodeObject {
hours: number;
minutes: number;
seconds: number;
frames: number;
}
export declare type TTimecodeInput = string | ITimecodeObject;
export interface ITimecodeOptions {
framerate?: number;
}
export declare class Timecode implements ITimecodeObject {
hours: number;
minutes: number;
seconds: number;
frames: number;

constructor(input: TTimecodeInput | number, opts?: ITimecodeOptions);

add(input: TTimecodeInput, subtract?: boolean): void;
subtract(input: TTimecodeInput): void;
frameCount(): number;
toMilliseconds(): number;
toSeconds(): number;
toString(): string;
}
```