Skip to content

Commit c58a155

Browse files
committed
types
1 parent e647e05 commit c58a155

File tree

3 files changed

+10
-8
lines changed

3 files changed

+10
-8
lines changed

spring/src/Interpolation.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -238,7 +238,7 @@ export class Interpolation<In = any, Out = any> extends FrameValue<Out> {
238238
}
239239

240240
export interface InterpolatorFactory {
241-
<In, Out>(interpolator: InterpolatorFn<In, Out>): typeof interpolator
241+
<In, Out>(interpolator: InterpolatorFn<In, Out>): typeof interpolator;
242242

243243
<Out>(config: InterpolatorConfig<Out>): (input: number) => Animatable<Out>
244244

spring/src/globals.ts

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import { createInterpolator } from "./createInterpolator";
22
import { FluidValue, getFluidValue } from "./fluids";
33
import type { OpaqueAnimation } from "./FrameLoop";
4-
import { InterpolatorArgs, InterpolatorConfig } from "./Interpolation";
4+
import { Interpolation, InterpolatorArgs, InterpolatorConfig } from "./Interpolation";
55
import { normalizeColor } from "./normalizeColor";
66
import { raf } from "./rafz";
77
import { cssVariableRegex, isSSR, noop, OneOrMore, Rafz } from "./utils";
@@ -101,10 +101,12 @@ export let createStringInterpolator = (
101101
// Optional
102102
//
103103

104-
export let to: <In, Out>(
104+
export let to = <In, Out>(
105105
source: OneOrMore<FluidValue>,
106106
args: InterpolatorArgs<In, Out>
107-
) => FluidValue<Out>;
107+
) => {
108+
return new Interpolation(source, args)
109+
}
108110

109111
export let colors = _colors as { [key: string]: number } | null;
110112

spring/src/solid/createSpring.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -31,14 +31,14 @@ export type CreateSpringProps<Props extends object = any> = unknown &
3131
export function createSpring<Props extends object>(
3232
props: () =>
3333
| (Props & Valid<Props, CreateSpringProps<Props>>)
34-
| CreateSpringProps
35-
): Accessor<SpringValues<PickAnimated<Props>>[]> & {
34+
| CreateSpringProps<Props>
35+
): Accessor<SpringValues<PickAnimated<Props>>> & {
3636
ref: SpringRefType<PickAnimated<Props>>;
3737
};
3838

3939
export function createSpring<Props extends object>(
40-
props: (Props & Valid<Props, CreateSpringProps<Props>>) | CreateSpringProps
41-
): Accessor<SpringValues<PickAnimated<Props>>[]> & {
40+
props: (Props & Valid<Props, CreateSpringProps<Props>>) | CreateSpringProps<Props>
41+
): Accessor<SpringValues<PickAnimated<Props>>> & {
4242
ref: SpringRefType<PickAnimated<Props>>;
4343
};
4444

0 commit comments

Comments
 (0)