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

Update types.ts #379

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open

Update types.ts #379

wants to merge 1 commit into from

Conversation

navanshu
Copy link

@navanshu navanshu commented Dec 9, 2021

When using this package with typescript. Typescript compilers throws error that you are not using "EnumChangefreq". but as I saw the compiled output of the program doesn't really uses it. So it is better to give users the freedom and correct type both.

When using this package with typescript. Typescript compilers throws error that you are not using "EnumChangefreq". but as I saw the compiled output of the program doesn't really uses it. So it is better to give users the freedom and correct type both.
@huntharo
Copy link
Contributor

@navanshu - Thanks for the PR! This seems reasonable. It's not a breaking change because it still works with the Enum and allows the exact same set of string values in the end.

I think we should:

  1. Rebase this onto latest master branch
  2. Extract the list of strings as a type like this (it might be possible to use some type magic to get the type to be created from the enum):
/**
 * @inheritdoc {EnumChangefreq}
 */
export type q = 'daily' | 'monthly' | 'always' | 'hourly' | 'weekly' | 'yearly' | 'never';
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
2 participants