import * as React from "react"; import { MutableRefObject, ReactElement } from "react"; //#region src/animated.d.ts /** These types can be animated */ type Animatable = T extends number ? number : T extends string ? string : T extends ReadonlyArray ? Array extends T ? ReadonlyArray : { [P in keyof T]: Animatable } : never; //#endregion //#region src/utils.d.ts /** Ensure each type of `T` is an array */ type Arrify = [T, T] extends [infer T, infer DT] ? DT extends ReadonlyArray ? Array extends DT ? ReadonlyArray ? U : T> : DT : ReadonlyArray ? U : T> : never; /** Override the property types of `A` with `B` and merge any new properties */ type Merge = Remap<{ [P in keyof A]: P extends keyof B ? B[P] : A[P] } & Omit>; /** Return the keys of `T` with values that are assignable to `U` */ type AssignableKeys = T extends object ? U extends object ? { [P in Extract]: T[P] extends U[P] ? P : never }[Extract] : never : never; /** Better type errors for overloads with generic types */ type Constrain = [T] extends [Any] ? U : [T] extends [U] ? T : U; /** Try to simplify `&` out of an object type */ type Remap = {} & { [P in keyof T]: T[P] }; type Pick = {} & { [P in K]: T[P] }; type Omit = Pick>; type Partial = {} & { [P in keyof T]?: T[P] | undefined }; type Overwrite = Remap & U>; type MergeUnknown = Remap>; type MergeDefaults> = Remap & Partial>>>; type OneOrMore = T | readonly T[]; type Falsy = false | null | undefined; type NoInfer = [T][T extends any ? 0 : never]; type StaticProps = Omit; interface Lookup { [key: string]: T; } type LoosePick = {} & Pick; /** Intersected with other object types to allow for unknown properties */ interface UnknownProps extends Lookup {} /** Use `[T] extends [Any]` to know if a type parameter is `any` */ declare class Any { private _; } type AnyFn = any[], Out = any> = (...args: In) => Out; /** Ensure the given type is an object type */ type ObjectType = T extends object ? T : {}; /** Intersect a union of objects but merge property types with _unions_ */ type ObjectFromUnion = Remap<{ [P in keyof Intersect]: T extends infer U ? P extends keyof U ? U[P] : never : never }>; /** Convert a union to an intersection */ type Intersect = (U extends any ? (k: U) => void : never) extends ((k: infer I) => void) ? I : never; type AllKeys = T extends any ? keyof T : never; type Exclusive = AllKeys extends infer K ? T extends any ? Remap & { [P in Exclude]?: undefined }> : never : never; /** An object that needs to be manually disposed of */ interface Disposable { dispose(): void; } type RefProp = MutableRefObject; type ElementType

= React.ElementType

| LeafFunctionComponent

; type LeafFunctionComponent

= { (props: P): ReactElement | null; displayName?: string; }; type ComponentPropsWithRef = T extends React.ComponentClass ? React.PropsWithoutRef

& React.RefAttributes> : React.PropsWithRef>; type ComponentType

= React.ComponentClass

| LeafFunctionComponent

; //#endregion //#region src/interpolation.d.ts type EasingFunction = (t: number) => number; type ExtrapolateType = 'identity' | 'clamp' | 'extend'; interface InterpolatorFactory { (interpolator: InterpolatorFn): typeof interpolator; (config: InterpolatorConfig): (input: number) => Animatable; (range: readonly number[], output: readonly Constrain[], extrapolate?: ExtrapolateType): (input: number) => Animatable; (...args: InterpolatorArgs): InterpolatorFn; } type InterpolatorArgs = [InterpolatorFn, Output>] | [InterpolatorConfig] | [readonly number[], readonly Constrain[], (ExtrapolateType | undefined)?]; type InterpolatorFn = (...inputs: Arrify) => Output; type InterpolatorConfig = { /** * What happens when the spring goes below its target value. * * - `extend` continues the interpolation past the target value * - `clamp` limits the interpolation at the max value * - `identity` sets the value to the interpolation input as soon as it hits the boundary * * @default 'extend' */ extrapolateLeft?: ExtrapolateType; /** * What happens when the spring exceeds its target value. * * - `extend` continues the interpolation past the target value * - `clamp` limits the interpolation at the max value * - `identity` sets the value to the interpolation input as soon as it hits the boundary * * @default 'extend' */ extrapolateRight?: ExtrapolateType; /** * What happens when the spring exceeds its target value. * Shortcut to set `extrapolateLeft` and `extrapolateRight`. * * - `extend` continues the interpolation past the target value * - `clamp` limits the interpolation at the max value * - `identity` sets the value to the interpolation input as soon as it hits the boundary * * @default 'extend' */ extrapolate?: ExtrapolateType; /** * Input ranges mapping the interpolation to the output values. * * @example * * range: [0, 0.5, 1], output: ['yellow', 'orange', 'red'] * * @default [0,1] */ range?: readonly number[]; /** * Output values from the interpolation function. Should match the length of the `range` array. */ output: readonly Constrain[]; /** * Transformation to apply to the value before interpolation. */ map?: (value: number) => number; /** * Custom easing to apply in interpolator. */ easing?: EasingFunction; }; //#endregion export { AllKeys, Animatable, Any, AnyFn, Arrify, AssignableKeys, ComponentPropsWithRef, ComponentType, Constrain, Disposable, EasingFunction, ElementType, Exclusive, ExtrapolateType, Falsy, InterpolatorArgs, InterpolatorConfig, InterpolatorFactory, InterpolatorFn, Lookup, LoosePick, Merge, MergeDefaults, MergeUnknown, NoInfer, ObjectFromUnion, ObjectType, Omit, OneOrMore, Overwrite, Partial, Pick, RefProp, Remap, StaticProps, UnknownProps };