floralvikings / jira-connector

NodeJS Wrapper for the Jira REST API
http://floralvikings.github.io/jira-connector/
MIT License
373 stars 180 forks source link

Error using typescript #164

Closed guumo closed 5 years ago

guumo commented 5 years ago

Hi,

When compile project using jira-connector, typescript causes this error:

node_modules/jira-connector/api/issue.d.ts:3:5 - error TS2411: Property 'addWorkLog' of type '(opts: { [key: string]: any; issueId?: string | number; issueKey?: string | number; notifyUsers?: boolean; adjustEstimate?: "auto" | "manual" | "new" | "leave"; newEstimate?: string; reduceBy?: string; expand?: string; ... 6 more ...; properties?: { ...; }[]; }, callback?: any) => Promise<...>' is not assignable to string index type 'Promise<any>'.

3     addWorkLog(opts: {
      ~~~~~~~~~~

node_modules/jira-connector/api/issue.d.ts:27:5 - error TS2411: Property 'getWorklog' of type '(opts: { issueId?: string | number; issueKey?: string | number; id: string; expand?: string; }, callback?: any) => Promise<any>' is not assignable to string index type 'Promise<any>'.

27     getWorklog(opts: {
       ~~~~~~~~~~

node_modules/jira-connector/api/issue.d.ts:34:5 - error TS2411: Property 'updateWorklog' of type '(opts: { [key: string]: any; issueId?: string | number; issueKey?: string | number; id: string; notifyUsers?: boolean; adjustEstimate?: "auto" | "manual" | "new" | "leave"; newEstimate?: string; expand?: string; ... 6 more ...; properties?: { ...; }[]; }, callback?: any) => Promise<...>' is not assignable to string index type 'Promise<any>'.

34     updateWorklog(opts: {
       ~~~~~~~~~~~~~

node_modules/jira-connector/api/issue.d.ts:58:5 - error TS2411: Property 'deleteWorklog' of type '(opts: { issueId?: string | number; issueKey?: string | number; id: string; notifyUsers?: boolean; adjustEstimate?: string; newEstimate?: string; increaseBy?: string; overrideEditableFlag?: boolean; }, callback?: any) => Promise<...>' is not assignable to string index type 'Promise<any>'.

58     deleteWorklog(opts: {
       ~~~~~~~~~~~~~

node_modules/jira-connector/api/issue.d.ts:69:5 - error TS2411: Property 'addAttachment' of type '(opts: { filename: string | string[]; issueId?: string | number; issueKey?: string | number; headers?: { [key: string]: any; 'X-Atlassian-Token': any; charset: any; }; }, callback?: any) => Promise<any>' is not assignable to string index type 'Promise<any>'.

69     addAttachment(opts: {
       ~~~~~~~~~~~~~
MrRefactoring commented 5 years ago

Hi, could you also attach the tsconfig.json file? Also indicate which typescript version you are using.

nodall commented 5 years ago

Hi, I have exactly the same problem. I'm using Version 3.5.1 of typescript. I attach my tsconfig in case it's helpful:

{ "compilerOptions": { "target": "es6", "module": "commonjs", "outDir": "dist", "sourceMap": true, "removeComments": true, "rootDir": "./src" }, "includes": [ "./src//*.ts", "./@types/*/.d.ts", "./node_modules//@types/*.d.ts" ] }

MrRefactoring commented 5 years ago

Thank you very much for your contributions! Fixed in version 2.15.1