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.34 kB
/** * @packageDocumentation * * Contains a component that displays and edits a week. */ import { TypedRangeTextComponent } from './TypedRangeTextComponent.cjs'; /** * An ISO 8601 week date. */ export interface IsoWeek { /** * An ISO 8601 week number (1-53). */ weekNumber: number; /** * A year (1-9999). */ year: number; } /** * A component that displays and edits a Week. * * You can add this component using {@link SettingEx.addWeek}. * * 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 WeekComponent extends TypedRangeTextComponent<IsoWeek> { /** * Creates a new Week component. * * @param containerEl - The container element of the component. */ constructor(containerEl: HTMLElement); /** * Converts a string to a Week. * * @param str - The string to convert. * @returns The week. */ valueFromString(str: string): IsoWeek; /** * Converts a week to a string. * * @param value - The week to convert. * @returns The string. */ valueToString(value: IsoWeek): string; }