UNPKG

obsidian-dev-utils

Version:

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

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