import { Interpolator, State, Stateful } from "../types"; /** * Generic getter type, contains a `key` and a `g` function. * * First argument corresponds to the return type of the `g` function. * Second argument allows you to extend the getter with additional props. * */ export type Getter = { key: string; g: (props: Stateful) => G; } & Props; /** * Generic interpolator type, contains a `key`, a `state` and an `i` function. * * First argument corresponds to the return type of the `i` function. * Second argument allows you to extend the interpolator with additional props. * */ export type Int = { key: string; state: State; i: Interpolator; } & Props; export type IntsProps, TInt extends Int> = { /** List of getters for the current state. */ getters: TGetter[] | undefined; /** List of getters for the previous state. */ _getters: TGetter[] | undefined; /** List of interpolators for the previous state. */ _ints: TInt[] | undefined; /** Use when you need to modify the generic interpolator. */ modifyInt?: (props: { getter: TGetter; exiting: boolean; _updateInt: TInt | undefined; int: Int; }) => TInt; getPreviousInt?: (props: { getter: TGetter; }) => TInt | undefined; }; /** * Generic ints function. * * It offers a way to modify the generic interpolator and the output of previous g. * */ export declare const ints: ) => G; }, TInt extends { key: string; state: State; i: Interpolator; }>() => ({ getters, _getters, _ints, modifyInt, getPreviousInt, }: IntsProps) => TInt[]; /** * Generic resolved type, contains a `key` and an output of `g` function. * * First argument corresponds to the return type of the `g` function. * Second argument allows you to extend the resolved value with additional props. * */ export type Resolved = { key: string; } & G & Props; /** * Generic resolve function. * * It offers a way to modify the generic resolved value. * */ export declare const resolve: , TInt extends { key: string; state: State; i: Interpolator; }>() => ({ ints, t, modifyResolved, }: { ints: TInt[]; t: number; modifyResolved?: (props: { int: TInt; resolved: Resolved; }) => TResolved; }) => TResolved[];