obsidian-dev-utils
Version:
This is the collection of useful functions that you can use for your Obsidian plugin development
40 lines (39 loc) • 1.14 kB
text/typescript
/**
* @packageDocumentation
*
* A transformer that can transform Duration to an ISO string and back.
*/
import type { Duration } from 'moment';
import { TypedTransformer } from './TypedTransformer.mjs';
/**
* A transformer that converts a Duration to an ISO string and back.
*/
export declare class DurationTransformer extends TypedTransformer<Duration, string> {
/**
* An id of the transformer.
*
* @returns The id of the transformer.
*/
get id(): string;
/**
* Checks if the value is a Duration.
*
* @param value - The value to check.
* @returns True if the value is a Duration, false otherwise.
*/
canTransform(value: unknown): value is Duration;
/**
* Restores the value from a string.
*
* @param transformedValue - The string to restore the value from.
* @returns The restored value.
*/
restoreValue(transformedValue: string): Duration;
/**
* Transforms the value to a string.
*
* @param value - The value to transform.
* @returns The transformed value.
*/
transformValue(value: Duration): string;
}