UNPKG

obsidian-dev-utils

Version:

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

51 lines (50 loc) 1.33 kB
/** * @packageDocumentation * * Contains a component that displays and edits a month. */ import { TypedRangeTextComponent } from './TypedRangeTextComponent.cjs'; /** * An ISO 8601 month. */ export interface IsoMonth { /** * A month (1-12). */ month: number; /** * A year (1-9999). */ year: number; } /** * A component that displays and edits a month. * * You can add this component using {@link SettingEx.addMonth}. * * 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 MonthComponent extends TypedRangeTextComponent<IsoMonth> { /** * Creates a new month component. * * @param containerEl - The container element of the component. */ constructor(containerEl: HTMLElement); /** * Converts a string to a month. * * @param str - The string to convert. * @returns The month. */ valueFromString(str: string): IsoMonth; /** * Converts a month to a string. * * @param value - The month to convert. * @returns The string. */ valueToString(value: IsoMonth): string; }