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.09 kB
text/typescript
/**
* @packageDocumentation
*
* A transformer that can transform a Set to an array and back.
*/
import { TypedTransformer } from './TypedTransformer.cjs';
/**
* A transformer that can transform a Set to an array and back.
*/
export declare class SetTransformer extends TypedTransformer<Set<unknown>, unknown[]> {
/**
* An id of the transformer.
*
* @returns The ID of the transformer.
*/
get id(): string;
/**
* Checks if the value is a Set.
*
* @param value - The value to check.
* @returns True if the value is a Set, false otherwise.
*/
canTransform(value: unknown): value is Set<unknown>;
/**
* Restores the value from an array.
*
* @param transformedValue - The array to restore the value from.
* @returns The restored value.
*/
restoreValue(transformedValue: unknown[]): Set<unknown>;
/**
* Transforms the value to an array.
*
* @param value - The value to transform.
* @returns The transformed value.
*/
transformValue(value: Set<unknown>): unknown[];
}