Skip to content

Exporting a keyword-named function in a module  #1784

@panuhorsmalahti

Description

@panuhorsmalahti

The type definition file for the Q module has the following problem:

 //export function try(method: Function, ...args: any[]): Promise<any>; // <- This is broken currently - not sure how to fix.

The compiler doesn't accept the type definition because it thinks a try/catch block is about to begin.

q/Q.d.ts(204,21): error TS1006: Identifier expected; 'try' is a keyword.
q/Q.d.ts(204,24): error TS1005: '{' expected.
q/Q.d.ts(204,72): error TS1005: '=>' expected.

Is there any way to define this exported function?

Metadata

Metadata

Assignees

No one assigned

    Labels

    FixedA PR has been merged for this issueSuggestionAn idea for TypeScript

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions