UNPKG

klog.js

Version:

A JavaScript implementation of the Klog time tracking file format

37 lines (36 loc) 1.06 kB
import { Duration } from "./duration.js"; import { Range } from "./range.js"; import { Summary } from "./summary.js"; import { EntryNode, Indentation } from "./types.js"; /** * A single time entry. */ export declare class Entry { /** The value of the entry. */ value: Duration | Range; /** Optional summary or tags associated with the entry. */ summary: Summary | null; /** * Create a new entry. */ constructor( /** The value of the entry. */ value: Duration | Range, /** Optional summary or tags associated with the entry. */ summary?: Summary | null); /** @internal */ static fromAST: (node: EntryNode) => Entry; /** * Convert the entry's value to a duration. */ toDuration(): Duration; /** * Convert the entry's value to minutes. */ toMinutes(): number; /** * Render the entry as a Klog string. * @param indent - The indentation to use for the entry. May be `null` for no indentation. */ toString(indent?: Indentation | null): string; }