Skip to content

Update types.ts#379

Open
navanshu wants to merge 1 commit into
ekalinin:masterfrom
Febnik:master
Open

Update types.ts#379
navanshu wants to merge 1 commit into
ekalinin:masterfrom
Febnik:master

Conversation

@navanshu
Copy link
Copy Markdown

@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
Copy Markdown
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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants