mirror of
https://github.com/FlipsideCrypto/DefinitelyTyped.git
synced 2026-02-06 10:56:53 +00:00
* Added types for objects-to-csv * removed leftover type * Updated after running npm test properly
13 lines
494 B
TypeScript
13 lines
494 B
TypeScript
import ObjectsToCsv = require('objects-to-csv');
|
|
|
|
const SAMPLE_ASCII = [
|
|
{ code: 'HK', name: 'Hong Kong' },
|
|
{ code: 'KLN', name: 'Kowloon' },
|
|
{ code: 'NT', name: 'New Territories' },
|
|
];
|
|
|
|
const ascii = new ObjectsToCsv(SAMPLE_ASCII); // $ExpectType ObjectsToCsv
|
|
const asciiFile = ascii.toDisk('name'); // $ExpectType Promise<string>
|
|
const asciiString = ascii.toString(); // $ExpectType Promise<string>
|
|
const convertAscii = ascii.convert(SAMPLE_ASCII); // $ExpectType Promise<string>
|