Home > typeioc > IInterceptor > intercept
Create a subject with members substituted by given parameters. For the instances of an object - interceptInstance method is used, for prototypical/constructible functions - interceptPrototype is used
Signature:
intercept<R extends Function | Object>(subject: R, substitutes?: ISubstituteInfo | ISubstituteInfo[]): R;
Parameter | Type | Description |
---|---|---|
subject | R |
prototypical/constructable function or an instance of an abject |
substitutes | ISubstituteInfo | ISubstituteInfo[] |
instance(s) of ISubstituteInfo interface |
Returns:
R