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.03 kB
/** * @packageDocumentation * * A transformer that can transform Date to an ISO string and back. */ import { TypedTransformer } from './TypedTransformer.cjs'; /** * A transformer that can transform Date to an ISO string and back. */ export declare class DateTransformer extends TypedTransformer<Date, string> { /** * An id of the transformer. * * @returns `date`. */ get id(): string; /** * Determines if the value is a Date. * * @param value - The value to check. * @returns A boolean indicating if the value is a Date. */ canTransform(value: unknown): value is Date; /** * Restores the value from a string. * * @param transformedValue - The transformed value. * @returns The restored value. */ restoreValue(transformedValue: string): Date; /** * Transforms the value to a string. * * @param value - The value to transform. * @returns The transformed value. */ transformValue(value: Date): string; }