UNPKG

@melt-ui/svelte

Version:
14 lines (13 loc) 628 B
import { type Readable } from 'svelte/store'; import { type WithGet } from '../withGet.js'; import type { MaybeReadable } from '../../types.js'; type TODO = any; export type ToReadableStores<T extends Record<string, unknown>> = { [K in keyof T]: T[K] extends Readable<TODO> ? WithGet<T[K]> : T[K] extends MaybeReadable<infer U> ? WithGet<Readable<U>> : WithGet<Readable<T[K]>>; }; /** * Given an object of properties, returns an object of writable stores * with the same properties and values. */ export declare function toReadableStores<T extends Record<string, unknown>>(properties: T): ToReadableStores<T>; export {};