UNPKG

obsidian-dev-utils

Version:

This is the collection of useful functions that you can use for your Obsidian plugin development

39 lines (38 loc) 1.18 kB
/** * @packageDocumentation * * Contains a component that displays and edits a time. */ import type { Duration } from 'moment'; import { TypedRangeTextComponent } from './TypedRangeTextComponent.mjs'; /** * A component that displays and edits a time. * * You can add this component using {@link SettingEx.addTime}. * * In order to add the styles for the component, use {@link initPluginContext} in your plugin's `onload()` function. * * Alternatively, you can copy styles from {@link https://github.com/mnaoumov/obsidian-dev-utils/releases/latest/download/styles.css}. */ export declare class TimeComponent extends TypedRangeTextComponent<Duration> { /** * Creates a new time component. * * @param containerEl - The container element of the component. */ constructor(containerEl: HTMLElement); /** * Converts a string to a time. * * @param str - The string to convert. * @returns The date. */ valueFromString(str: string): Duration; /** * Converts a time to a string. * * @param value - The time to convert. * @returns The string. */ valueToString(value: Duration): string; }