zemirco / json2csv

Convert json to csv with column titles
http://zemirco.github.io/json2csv
MIT License
2.72k stars 363 forks source link

visual studio code show error #112

Closed tagplus5 closed 8 years ago

tagplus5 commented 8 years ago

[js] Exported external package typings file '.../node_modules/json2csv/index.d.ts' is not a module. Please contact the package author to update the package definition.

knownasilya commented 8 years ago

Feel free to submit a PR, I don't use TS.

mlegenhausen commented 8 years ago

Using declare module seems to be deprecated: https://github.com/Microsoft/TypeScript/issues/2839

I changed the typescript definition to the following:

declare namespace json2csv {
  interface CSVCallback {
    (error: Error, csv: string): void;
  }

  export function json2csv(options: any, callback: CSVCallback): string;
}

export = json2csv.json2csv;

I will prepare a pull request and try to validate if this the current state of the are type definition format.

mlegenhausen commented 8 years ago

In which version will this fix be available?

knownasilya commented 8 years ago

It is now released as 3.4.1

mlegenhausen commented 8 years ago

@knownasilya thanks :)

quantuminformation commented 7 years ago

Has anyone been able to use this with TS? Would be great to add a section in the docs for ts for a minimal example.

knownasilya commented 7 years ago

Feel free to pioneer this, and I'll review your PR.

quantuminformation commented 7 years ago

I found a stopgap,but not using this repo, atm I'm snowed under with work