Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

@BindOption: Unable to resolve signature of property decorator when called as an expression. #1174

Closed
1 task done
socsieng opened this issue Jan 15, 2020 · 1 comment
Closed
1 task done
Labels
bug Functionality does not match expectation

Comments

@socsieng
Copy link
Contributor

Unable to use @BindOption for custom option names

Expected Behavior

Should be able to use @BindOption to bind custom options to class member.

Actual Behavior

Unable to use @BindOption with custom option name.

This results in a TypeScript compilation error:

TS1240: Unable to resolve signature of property decorator when called as an expression.

It works with where the parameter is keyof TypeDocOptionMap.

Steps to reproduce the bug

Sample code that will should result in the error

export class TestPlugin extends ConverterComponent {
  @BindOption('myParam') // fails - TS1240: Unable to resolve signature of property decorator when called as an expression.
  myParam!: string;

  @BindOption('name') // works with existing TypeDoc option name
  typedocParam!: string;
}

Environment

  • Typedoc version: 0.16.4
  • Node.js version: 8.16.0
  • OS: macOS Catalina
@socsieng socsieng added the bug Functionality does not match expectation label Jan 15, 2020
@Gerrit0
Copy link
Collaborator

Gerrit0 commented Jan 15, 2020

Well that's the weirdest TS type checking behavior I've seen in a long time...

class Test {
    @Broken // Unable to resolve signature of property decorator when called as an expression. (1240)
    a!: unknown
    @Working
    b!: unknown
}

declare function Broken(obj: object): void
declare function Working(obj: object, key: PropertyKey): void

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Functionality does not match expectation
Projects
None yet
Development

No branches or pull requests

2 participants