import type { JSONSchema7Definition } from 'json-schema'; import type { JSONSchema } from './jsonSchema/index.js'; import type { Writable } from 'svelte/store'; export type NumericRange = ARR['length'] extends END ? ACC | START | END : NumericRange; export type ErrorStatus = NumericRange<400, 599>; export declare function clone(data: T): T; export type MaybePromise = T | Promise; export type Prettify = T extends object ? { [K in keyof T]: T[K]; } : T & {}; export type IsAny = boolean extends (T extends never ? true : false) ? true : false; export declare function assertSchema(schema: JSONSchema7Definition, path: string | (string | number | symbol)[]): asserts schema is JSONSchema; export type AllKeys = T extends T ? keyof T : never; export type PickType> = T extends { [k in K]?: any; } ? T[K] : never; /** * Merges a union to a single type which includes the properties of each type in the union. * * Thanks to https://dev.to/lucianbc/union-type-merging-in-typescript-9al */ export type MergeUnion = { [K in AllKeys]: PickType; }; /** * Transforms a Svelte store of a Record type to a merged type of its unions. */ export type MergeFormUnion>> = Store extends Writable ? Writable> : never; /** * Casts a Svelte store of a Record type to a merged type of its unions. * @param store A Svelte store of a Record type * @returns The same store but casted to a merged type of its unions. */ export declare function mergeFormUnion>(store: Writable): Writable>;