Skip to content

Commit

Permalink
fix(types): specify arguments for onLanguageSwitched and beforeLangua…
Browse files Browse the repository at this point in the history
…geSwitch
  • Loading branch information
rchl committed Sep 20, 2019
1 parent e3e3f2d commit da6a523
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 5 deletions.
8 changes: 5 additions & 3 deletions docs/options-reference.md
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,9 @@ Here are all the options available when configuring the module and their default
// https://nuxt-community.github.io/nuxt-i18n/seo.html#improving-performance
seo: false,

// Base URL to use as prefix for alternate URLs in hreflang tags
// Fallback base URL to use as prefix for alternate URLs in hreflang tags.
// By default VueRouter's base URL will be used and only if that is not available,
// fallback URL will be used.
baseUrl: '',

// By default a store module is registered and kept in sync with the
Expand Down Expand Up @@ -120,9 +122,9 @@ Here are all the options available when configuring the module and their default
encodePaths: true,

// Called right before app's locale changes
beforeLanguageSwitch: () => null,
beforeLanguageSwitch: (oldLocale, newLocale) => null,

// Called after app's locale has changed
onLanguageSwitched: () => null
onLanguageSwitched: (oldLocale, newLocale) => null
}
```
4 changes: 2 additions & 2 deletions types/nuxt-i18n.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -40,12 +40,12 @@ declare namespace NuxtVueI18n {

// options that are also exposed on VueI18n instance: https://goo.gl/UwNfZo
interface NuxtI18nInterface {
beforeLanguageSwitch?: () => any
beforeLanguageSwitch?: (oldLocale: string, newLocale: string) => void
defaultLocale?: null | Locale
locales?: Array<Locale | LocaleObject>
differentDomains?: boolean
forwardedHost?: boolean
onLanguageSwitched?: () => any
onLanguageSwitched?: (oldLocale: string, newLocale: string) => void
}

// see options reference: https://github.com/nuxt-community/nuxt-i18n/blob/master/docs/options-reference.md
Expand Down

0 comments on commit da6a523

Please sign in to comment.