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

TypeScript type error for changefreq property #224

Closed
colinhemphill opened this issue Aug 10, 2019 · 1 comment
Closed

TypeScript type error for changefreq property #224

colinhemphill opened this issue Aug 10, 2019 · 1 comment

Comments

@colinhemphill
Copy link

There seems to be an issue with the enums for changefreq when using TypeScript. Using an example from the documentation:

var sitemap = smGenerator.createSitemap({
    urls: [
      {
        url: 'http://mobile.test.com/page-1/',
        changefreq: 'weekly',
        priority: 0.3,
        mobile: true,
      },
    ],
    xslUrl: 'sitemap.xsl',
  });

I get the following error:

Type '{ url: string; changefreq: string; priority: number; mobile: boolean; }' is not assignable to type 'string | SitemapItemOptions'.
  Type '{ url: string; changefreq: string; priority: number; mobile: boolean; }' is not assignable to type 'SitemapItemOptions'.
    Types of property 'changefreq' are incompatible.
      Type 'string' is not assignable to type 'EnumChangefreq'.ts(2322)
@derduher
Copy link
Collaborator

derduher commented Aug 11, 2019

Yeah, not sure how I should
document TS only stuff. Import EnumChangefreq and assign EnumChangefreq.WEEKLY.

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

No branches or pull requests

2 participants