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
- Host: GitHub
- URL: https://github.com/tim-smart/timecode
- Owner: tim-smart
- License: mit
- Created: 2018-12-11T23:54:44.000Z (about 7 years ago)
- Default Branch: master
- Last Pushed: 2023-12-13T04:10:55.000Z (about 2 years ago)
- Last Synced: 2025-02-14T09:25:26.116Z (11 months ago)
- Topics: smpte, timecode
- Language: TypeScript
- Size: 15.6 KB
- Stars: 2
- Watchers: 3
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE.txt
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;
}
```