diff --git a/src/core/interfaces.d.ts b/src/core/interfaces.d.ts index 94dd25e9c..8ad5447d7 100644 --- a/src/core/interfaces.d.ts +++ b/src/core/interfaces.d.ts @@ -1280,7 +1280,7 @@ export interface DefaultMiddlewareResult extends MiddlewareResult { (): MiddlewareResult; - returns: () => MiddlewareResultFactory< + withType: () => MiddlewareResultFactory< CustomProps, Children, Middleware, diff --git a/src/core/middleware/icache.ts b/src/core/middleware/icache.ts index 1ba520cfa..35f8f3318 100644 --- a/src/core/middleware/icache.ts +++ b/src/core/middleware/icache.ts @@ -124,7 +124,7 @@ const icacheFactory = factory( } ); -export const createICacheMiddleware = () => icacheFactory.returns>(); +export const createICacheMiddleware = () => icacheFactory.withType>(); export const icache = createICacheMiddleware(); diff --git a/src/core/middleware/resources.ts b/src/core/middleware/resources.ts index b55fb142a..a547cfcaf 100644 --- a/src/core/middleware/resources.ts +++ b/src/core/middleware/resources.ts @@ -1107,7 +1107,7 @@ const resourceMiddlewareFactory = factory( ); export function createResourceMiddleware() { - return resourceMiddlewareFactory.returns< + return resourceMiddlewareFactory.withType< ResourceMiddleware, MIDDLEWARE extends void ? {} : ResourceMiddlewareProperties >(); diff --git a/src/core/vdom.ts b/src/core/vdom.ts index 23628627a..2916eb09a 100644 --- a/src/core/vdom.ts +++ b/src/core/vdom.ts @@ -803,7 +803,7 @@ function createFactory(callback: any, middlewares: any, key?: any): any { return keys; }, key ? [key] : []); - factory.returns = () => { + factory.withType = () => { return factory; }; callback.keys = keys; diff --git a/src/testing/harness/harness.ts b/src/testing/harness/harness.ts index 43a978689..736a51e20 100644 --- a/src/testing/harness/harness.ts +++ b/src/testing/harness/harness.ts @@ -56,7 +56,10 @@ export interface HarnessAPI { interface HarnessOptions { customComparator?: CustomComparator[]; - middleware?: [MiddlewareResultFactory, MiddlewareResultFactory][]; + middleware?: [ + MiddlewareResultFactory, + Exclude, 'withType'> + ][]; } const factory = create(); diff --git a/src/testing/renderer.ts b/src/testing/renderer.ts index f5a545631..b43b0b749 100644 --- a/src/testing/renderer.ts +++ b/src/testing/renderer.ts @@ -86,7 +86,7 @@ interface RendererOptions { MiddlewareResultFactory, Pick< MiddlewareResultFactory, - Exclude, 'returns'> + Exclude, 'withType'> > ][]; }