Skip to content
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

Merged
merged 1 commit into from Feb 21, 2018
Merged

Remove TypeScript definition #256

merged 1 commit into from Feb 21, 2018

Conversation

juanjoDiaz
Copy link
Collaborator

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.

@coveralls
Copy link

Coverage Status

Coverage remained the same at 100.0% when pulling 43cb460 on juanjoDiaz:remove_typescript_definition into fb7ad53 on zemirco:master.

2 similar comments
@coveralls
Copy link

Coverage Status

Coverage remained the same at 100.0% when pulling 43cb460 on juanjoDiaz:remove_typescript_definition into fb7ad53 on zemirco:master.

@coveralls
Copy link

Coverage Status

Coverage remained the same at 100.0% when pulling 43cb460 on juanjoDiaz:remove_typescript_definition into fb7ad53 on zemirco:master.

@knownasilya knownasilya merged commit 4f09694 into zemirco:master Feb 21, 2018
@myspivey
Copy link

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?

@juanjoDiaz
Copy link
Collaborator Author

The later.
Types will not be included until someone champions them.
Reason for that being that the previous types were totally outdated for the 4.0.0 release.

Are you willing to do such contribution? :)

@knownasilya
Copy link
Collaborator

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.

@myspivey
Copy link

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!

@juanjoDiaz
Copy link
Collaborator Author

@myspivey did your projects break because the API is different in v4.0.0 or because of the missing typescript?

@myspivey
Copy link

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.

@knownasilya
Copy link
Collaborator

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.

@aj-r
Copy link

aj-r commented Feb 26, 2018

In case this is useful to anyone, I have some preliminary types for v4. I haven't added the Transform class so they're not quite ready for DefinitelyTyped. If someone wants to add the Transform class then go ahead.

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;

@juanjoDiaz
Copy link
Collaborator Author

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.

@juanjoDiaz
Copy link
Collaborator Author

Typings have been published.

Please let me know if you find any issue with them.

@juanjoDiaz juanjoDiaz deleted the remove_typescript_definition branch March 27, 2019 08:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants