import { Pos } from '../Iteration/Pos'; import { Concat } from '../List/Concat'; import { Length } from '../List/Length'; import { Next } from '../Iteration/Next'; import { Cast } from '../Any/Cast'; import { Parameters } from './Parameters'; import { Return } from './Return'; import { IterationOf } from '../Iteration/IterationOf'; import { Iteration } from '../Iteration/Iteration'; import { NonNullableFlat } from '../Object/NonNullable'; import { x } from '../Any/x'; import { List } from '../List/List'; import { Function } from './Function'; import { Extends } from '../Any/Extends'; import { Tail } from '../List/Tail'; import { RequiredKeys } from '../List/RequiredKeys'; /** * @hidden */ declare type _SplitParams

> = { 0: P extends [...infer A, ...PRest] ? _SplitParams, [...PSplit, A], Tail> : never; 1: PSplit; 2: P[number][][]; }[number extends Length

? 2 : P extends [] ? 1 : 0]; /** * Splits tuples to preserve their labels * @hidden */ declare type SplitParams

= _SplitParams

extends infer X ? Cast : never; /** * @hidden */ declare type _JoinParams = { 0: _JoinParams, [...L, ...PSplit[0]]>; 1: L; 2: PSplit[number][]; }[number extends Length ? 2 : PSplit extends [] ? 1 : 0]; /** * Undoes the job of [[SplitParams]] * @hidden */ declare type JoinParams

= _JoinParams

extends infer X ? Cast : never; /** * @hidden */ declare type GapOf = L1[Pos] extends x ? Concat]> : LN; /** * @hidden */ declare type _GapsOf> = { 0: _GapsOf, Tail, Next>; 1: Concat>; }[Extends, Length>]; /** * @hidden */ declare type GapsOf = _GapsOf> extends infer X ? Cast : never; /** * @hidden */ declare type Gaps = Cast, List>; /** * Curry a [[Function]] * @param F to curry * @returns [[Function]] * @example * ```ts * import {F} from 'ts-toolbelt' * * /// If you are looking for creating types for `curry` * /// It handles placeholders and variable arguments * declare function curry(fn: Fn): F.Curry * ``` */ export declare type Curry =

>, G extends List = GapsOf>, R extends any = Return>(...p: Gaps> | P) => RequiredKeys extends never ? R : Curry<(...p: G) => R>; export {};