@@ -7,21 +7,21 @@ import type { Effect, BlendFunction } from 'postprocessing'
77export const resolveRef = < T , > ( ref : T | React . MutableRefObject < T > ) =>
88 typeof ref === 'object' && ref != null && 'current' in ref ? ref . current : ref
99
10- export type EffectConstructor = new ( ...args : any [ ] ) => Effect
10+ type Constructor < T = { } > = new ( ...args : any [ ] ) => T
1111
12- export type EffectProps < T extends EffectConstructor > = ReactThreeFiber . Node <
13- T extends Function ? T [ 'prototype' ] : InstanceType < T > ,
12+ export type EffectProps < T extends Effect > = ReactThreeFiber . Node <
13+ T extends Function ? T [ 'prototype' ] : InstanceType < Constructor < T > > ,
1414 T
1515> &
16- ConstructorParameters < T > [ 0 ] & {
16+ ConstructorParameters < Constructor < T > > [ 0 ] & {
1717 blendFunction ?: BlendFunction
1818 opacity ?: number
1919 }
2020
2121let i = 0
22- const components = new WeakMap < EffectConstructor , React . ExoticComponent < any > | string > ( )
22+ const components = new WeakMap < Constructor , React . ExoticComponent < any > | string > ( )
2323
24- export const wrapEffect = < T extends EffectConstructor > ( effect : T , defaults ?: EffectProps < T > ) =>
24+ export const wrapEffect = < T extends Effect > ( effect : Constructor < T > , defaults ?: EffectProps < T > ) =>
2525 /* @__PURE__ */ React . forwardRef < T , EffectProps < T > > ( function Effect (
2626 { blendFunction = defaults ?. blendFunction , opacity = defaults ?. opacity , ...props } ,
2727 ref
0 commit comments