-
-
Notifications
You must be signed in to change notification settings - Fork 17
Open
Description
The Error
error TS1236: The return type of a property decorator function must be either 'void' or 'any'.
Unable to resolve signature of property decorator when called as an expression.
32 @waitFor
~~~~~~~~
error TS2769: No overload matches this call.
Overload 1 of 3, '(fn: AsyncFunction<any[], any>, label?: string | undefined): Function', gave the following error.
Argument of type 'MyComponentClass' is not assignable to parameter of type 'AsyncFunction<any[], any>'.
Type 'MyComponentClass' provides no match for the signature '(...args: any[]): Promise<any>'.
Overload 2 of 3, '(fn: CoroutineFunction<any[], any>, label?: string | undefined): CoroutineFunction<any[], any>', gave the following error.
Argument of type 'MyComponentClass' is not assignable to parameter of type 'CoroutineFunction<any[], any>'.
Type 'MyComponentClass' provides no match for the signature '(...args: any[]): CoroutineGenerator<any>'.
32 @waitFor
~~~~~~~
Found 2 errors.
This is an code that looks like:
@task
@waitFor
myTask = taskFor(async () => {
// ...
using:
- ember-concurrency-ts
- ember-concurrency-async
- ember-concurrency-decorators
- ember-concurrency @ v1.x
I believe the fix would be to make this change:
export default function waitFor(
target: object,
_key: string,
descriptor: PropertyDescriptor,
label?: string
- ): PropertyDescriptor;
+ ): any;
This is with TypeScript 4.1.2
I've worked around this via:
import { waitFor as _waitFor } from '@ember/test-waiters';
export const waitFor = (_waitFor as unknown) as PropertyDecorator;
nwhittaker
Metadata
Metadata
Assignees
Labels
No labels