UNPKG

obsidian-dev-utils

Version:

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

41 lines (40 loc) 1.26 kB
/** * @packageDocumentation * * A transformer that can transform a Map to an array of entries and back. */ import { TypedTransformer } from './TypedTransformer.cjs'; type MapEntry = readonly [key: unknown, value: unknown]; /** * A transformer that can transform a Map to an array of entries and back. */ export declare class MapTransformer extends TypedTransformer<Map<unknown, unknown>, MapEntry[]> { /** * An id of the transformer. * * @returns The ID of the transformer. */ get id(): string; /** * Checks if the value is a Map. * * @param value - The value to check. * @returns True if the value is a Map, false otherwise. */ canTransform(value: unknown): value is Map<unknown, unknown>; /** * Restores the value from an array of entries. * * @param transformedValue - The array of entries to restore the value from. * @returns The restored value. */ restoreValue(transformedValue: MapEntry[]): Map<unknown, unknown>; /** * Transforms the value to an array of entries. * * @param value - The value to transform. * @returns The transformed value. */ transformValue(value: Map<unknown, unknown>): MapEntry[]; } export {};