Is your feature request related to a problem? Please describe.
A type definition can be stricter so that parse have more type hint in typescript.
A clear and concise description of what the problem is. Ex. I'm always frustrated when [...]
In csv-parse
onRecord should return type conform to expected type,
parse data callback should have signature of (err, data) => {} where data should be of the same type defined in onRecord return type.
columns should have keyof type of expected type in list or a function that return keyof of expected type in list
Parser class should extends AsyncIterator so the for await syntax can infer type.
Describe the solution you'd like
Use generic in type declaration. To prevent breaking change, specify any as default of generic.
A clear and concise description of what you want to happen.
Many type checker should be applicable in compile time type checking. Using mechanism available in typescript can aid this aspect. Instead of relying on always any type everywhere, using generic with default to any can be useful if developer choose to opt-in.
Describe alternatives you've considered
A clear and concise description of any alternative solutions or features you've considered.
None
Additional context
Add any other context or screenshots about the feature request here.
Is your feature request related to a problem? Please describe.
A type definition can be stricter so that parse have more type hint in typescript.
A clear and concise description of what the problem is. Ex. I'm always frustrated when [...]
In csv-parse
onRecordshould return type conform to expected type,parsedata callback should have signature of (err, data) => {} where data should be of the same type defined inonRecordreturn type.columnsshould havekeyoftype of expected type in list or a function that returnkeyofof expected type in listParserclass should extendsAsyncIteratorso thefor awaitsyntax can infer type.Describe the solution you'd like
Use generic in type declaration. To prevent breaking change, specify any as default of generic.
A clear and concise description of what you want to happen.
Many type checker should be applicable in compile time type checking. Using mechanism available in typescript can aid this aspect. Instead of relying on always
anytype everywhere, using generic with default toanycan be useful if developer choose to opt-in.Describe alternatives you've considered
A clear and concise description of any alternative solutions or features you've considered.
None
Additional context
Add any other context or screenshots about the feature request here.