Skip to content

Commit b1909a1

Browse files
authored
Merge pull request pmndrs#163 from PrecociouslyDigital/patch-2
Update type definitions
2 parents fa1bfff + 18d1679 commit b1909a1

File tree

1 file changed

+15
-11
lines changed

1 file changed

+15
-11
lines changed

index.d.ts

Lines changed: 15 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -85,6 +85,10 @@ interface SpringProps<S extends object, DS extends object = {}> {
8585
* @default undefined
8686
*/
8787
inject?: any
88+
/**
89+
* Animation start delay, optional
90+
*/
91+
delay?: number
8892
}
8993

9094
export const config: {
@@ -101,7 +105,7 @@ export const config: {
101105
}
102106

103107
export class Spring<S extends object, DS extends object> extends PureComponent<
104-
SpringProps<S, DS>
108+
SpringProps<S, DS> & S
105109
> {}
106110

107111
export function interpolate(
@@ -170,7 +174,7 @@ interface TransitionProps<S extends object, DS extends object = {}> {
170174
export class Transition<
171175
S extends object,
172176
DS extends object
173-
> extends PureComponent<TransitionProps<S, DS>> {}
177+
> extends PureComponent<TransitionProps<S, DS> & S> {}
174178

175179
type TrailKeyProps = string | number
176180
type TrailKeyItemProps = string | number | object
@@ -195,7 +199,7 @@ interface TrailProps<S extends object, DS extends object = {}> {
195199
}
196200

197201
export class Trail<S extends object, DS extends object> extends PureComponent<
198-
TrailProps<S, DS>
202+
TrailProps<S, DS> & S
199203
> {}
200204

201205
interface ParallaxProps<S extends object, DS extends object = {}> {
@@ -211,7 +215,7 @@ interface ParallaxProps<S extends object, DS extends object = {}> {
211215
export class Parallax<
212216
S extends object,
213217
DS extends object
214-
> extends PureComponent<ParallaxProps<S, DS>> {}
218+
> extends PureComponent<ParallaxProps<S, DS> & S> {}
215219

216220
interface ParallaxLayerProps<S extends object, DS extends object = {}> {
217221
factor?: number
@@ -224,25 +228,25 @@ interface ParallaxLayerProps<S extends object, DS extends object = {}> {
224228
export class ParallaxLayer<
225229
S extends object,
226230
DS extends object
227-
> extends PureComponent<ParallaxLayerProps<S, DS>> {}
231+
> extends PureComponent<ParallaxLayerProps<S, DS> & S> {}
228232

229233
interface KeyframesProps<S extends object, DS extends object = {}> {
230-
state: string
234+
state?: string
231235
}
232236

233-
export class Keyframes<S extends object, DS extends object> extends Component<
234-
KeyframesProps<S, DS>
237+
export class Keyframes<S extends object, DS extends object> extends PureComponent<
238+
KeyframesProps<S, DS> & S
235239
> {
236240
static create<S extends object, DS extends object>(
237241
primitive: ComponentType
238242
): (states: object) => (props: object) => Keyframes<S, DS>
239243
static Spring<S extends object, DS extends object>(
240244
states: object
241-
): (props: object) => Keyframes<S, DS>
245+
): (props: object) => Keyframes<S | Pick<SpringProps<S,DS>, Exclude<keyof SpringProps<S,DS>, "to">>, DS>
242246
static Trail<S extends object, DS extends object>(
243247
states: object
244-
): (props: object) => Keyframes<S, DS>
248+
): (props: object) => Keyframes<S | Pick<TrailProps<S,DS>, Exclude<keyof TrailProps<S,DS>, "to">>, DS>
245249
static Transition<S extends object, DS extends object>(
246250
states: object
247-
): (props: object) => Keyframes<S, DS>
251+
): (props: object) => Keyframes<S | Pick<TransitionProps<S,DS>, Exclude<keyof TransitionProps<S,DS>, "to">>, DS>
248252
}

0 commit comments

Comments
 (0)