mobx-bonsai
Version:
A fast lightweight alternative to MobX-State-Tree + Y.js two-way binding
12 lines (11 loc) • 513 B
TypeScript
import { ImmutableDate } from './ImmutableDate';
/**
* Transforms an ISO date string to a Date (getter).
*
* @param this - The object containing the property to transform
* @param propName - The name of the property to transform
* @returns A function that transforms the ISO string property into a Date
*/
export declare function isoStringToDateTransform<T extends {
[k in K]?: string | null | undefined;
}, K extends keyof T>(propName: K): (this: T) => ImmutableDate | Extract<T[K], undefined | null>;