-
-
Notifications
You must be signed in to change notification settings - Fork 42
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #38 from airon-assustadus/master
feature Adding index.d.ts for typescript usage
- Loading branch information
Showing
3 changed files
with
107 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,98 @@ | ||
declare module 'convert-csv-to-json' { | ||
export class ConvertCsvToJson { | ||
/** | ||
* Prints a digit as Number type (for example 32 instead of '32') | ||
*/ | ||
formatValueByType(active: boolean): this; | ||
|
||
/** | ||
* | ||
*/ | ||
supportQuotedField(active: boolean): this; | ||
/** | ||
* Defines the field delimiter which will be used to split the fields | ||
*/ | ||
fieldDelimiter(delimiter: string): this; | ||
|
||
/** | ||
* Defines the index where the header is defined | ||
*/ | ||
indexHeader(index: number): this; | ||
|
||
/** | ||
* Defines how to match and parse a sub array | ||
*/ | ||
parseSubArray(delimiter: string, separator: string): this; | ||
|
||
/** | ||
* Defines a custom encoding to decode a file | ||
*/ | ||
customEncoding(encoding: string): this; | ||
|
||
/** | ||
* Defines a custom encoding to decode a file | ||
*/ | ||
utf8Encoding(): this; | ||
|
||
/** | ||
* Defines ucs2 encoding to decode a file | ||
*/ | ||
ucs2Encoding(): this; | ||
|
||
/** | ||
* Defines utf16le encoding to decode a file | ||
*/ | ||
utf16leEncoding(): this; | ||
|
||
/** | ||
* Defines latin1 encoding to decode a file | ||
*/ | ||
latin1Encoding(): this; | ||
|
||
/** | ||
* Defines ascii encoding to decode a file | ||
*/ | ||
asciiEncoding(): this; | ||
|
||
/** | ||
* Defines base64 encoding to decode a file | ||
*/ | ||
base64Encoding(): this; | ||
|
||
/** | ||
* Defines hex encoding to decode a file | ||
*/ | ||
hexEncoding(): this; | ||
|
||
/** | ||
* Parses .csv file and put its content into a file in json format. | ||
* @param {inputFileName} path/filename | ||
* @param {outputFileName} path/filename | ||
* | ||
*/ | ||
generateJsonFileFromCsv( | ||
inputFileName: string, | ||
outputFileName: string, | ||
): void; | ||
|
||
/** | ||
* Parses .csv file and put its content into an Array of Object in json format. | ||
* @param {inputFileName} path/filename | ||
* @return {Array} Array of Object in json format | ||
* | ||
*/ | ||
getJsonFromCsv(inputFileName: string): any[]; | ||
|
||
csvStringToJson(csvString: string): any[]; | ||
/** | ||
* Parses .csv file and put its content into a file in json format. | ||
* @param {inputFileName} path/filename | ||
* @param {outputFileName} path/filename | ||
* | ||
* @deprecated Use generateJsonFileFromCsv() | ||
*/ | ||
jsonToCsv(inputFileName: string, outputFileName: string): void; | ||
} | ||
const converter: ConvertCsvToJson; | ||
export default converter; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters