-
Notifications
You must be signed in to change notification settings - Fork 361
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Remove TypeScript definition #256
Remove TypeScript definition #256
Conversation
2 similar comments
Has a PR already been submitted to DefinitelyTyped for types or is this relating to #236 where types will not be included until someone champions them? |
The later. Are you willing to do such contribution? :) |
One reason for an alpha release, so get some of these questions figured out 👍 If you are willing to champion that, we can add a reference to the readme about the availability of the types. |
Understood. I would love to help however already bogged down in three separate projects. I just installed on one of them and 'npm i' uses the alpha and saw it break. Wanted to understand if there was a fix coming or if I was locked to v3. If I manage to get unburied from this mound of work, I will try to circle back to help out! Sorry I can not pitch in at this time! |
@myspivey did your projects break because the API is different in v4.0.0 or because of the missing typescript? |
If you use the alpha, you are no longer able to use this project with Typescript in an Angular project. v3 still works fine. I did not look into the full cause but on the Alpha I installed it still had the TS file so I would assume the api change. |
alpha.1 no longer has types, they snuck into alpha.0. We will probably release 4.0 and not wait on types. If no one submits types I'll probably work on it myself. |
In case this is useful to anyone, I have some preliminary types for v4. I haven't added the interface Field<T = any> {
label?: string;
default?: string;
value: string | ((row: T, field: keyof T) => string | null | undefined);
stringify?: boolean;
}
interface Options<T = any> {
ndjson?: boolean;
fields?: Array<keyof T | Field<T>>;
unwind?: string | string[];
flatten?: boolean;
defaultValue?: string;
quote?: string;
doubleQuote?: string;
delimiter?: string;
eol?: string;
excelStrings?: boolean;
header?: boolean;
includeEmptyRows?: boolean;
withBOM?: boolean;
}
export class Parser {
constructor(options?: Options);
parse(data: any): string;
}
export function parse<T>(data: ReadonlyArray<T>, options?: Options<T>): string; |
Thanks @aj-r I have all the types ready and am currently testing before pushing them to DifinitelyTyped. I'll check if it matches your types. |
Typings have been published. Please let me know if you find any issue with them. |
According to TypeScript documentation the TypeScript definition shouldn't really be in this package. It should be published in https://github.com/DefinitelyTyped/DefinitelyTyped by PR.
So I've removed the obsolete TypeScript definition from this project. Once this and the other outstanding PRs are merge, we should be good to cut the 4.0 release.