
Company News
Free Business Plan Upgrades for Open Source Maintainers
Open source maintainers are under more pressure than ever. We're raising our open source program from the Team plan to the Business plan, free.
@i18n-micro/types
Advanced tools
@i18n-micro/types provides TypeScript type definitions and interfaces for the nuxt-i18n-micro ecosystem. This package is designed to enhance type safety and developer experience when working with translations, locales, and routing in a Nuxt.js application. It includes types for locales, routing strategies, translation parameters, and more.
You can install @i18n-micro/types using npm or yarn:
npm install @i18n-micro/types
or
yarn add @i18n-micro/types
This package provides TypeScript types and interfaces for working with nuxt-i18n-micro. It is primarily used to ensure type safety when defining locales, routing strategies, and translation parameters.
Here’s an example of how you might use the types provided by this package:
import { Locale, Strategies, ModuleOptions, I18nRouteParams } from '@i18n-micro/types'
// Define locales
const locales: Locale[] = [
{
code: 'en',
iso: 'en-US',
dir: 'ltr',
displayName: 'English',
baseUrl: 'https://example.com/en',
},
{
code: 'de',
iso: 'de-DE',
dir: 'ltr',
displayName: 'German',
baseUrl: 'https://example.com/de',
},
]
// Define routing strategy
const strategy: Strategies = 'prefix_except_default'
// Define module options
const options: ModuleOptions = {
locales,
strategy,
defaultLocale: 'en',
strategy: 'prefix',
}
// Define route parameters
const routeParams: I18nRouteParams = {
en: { page: 'home' },
de: { page: 'startseite' },
}
LocaleRepresents a locale configuration.
LocaleCodeRepresents a locale code (e.g., 'en', 'de').
StrategiesRepresents the available routing strategies.
export type Strategies = 'no_prefix' | 'prefix_except_default' | 'prefix' | 'prefix_and_default'
ModuleOptionsRepresents the configuration options for the nuxt-i18n-micro module.
ModuleOptionsExtendExtends ModuleOptions with additional properties.
I18nRouteParamsRepresents route parameters for different locales.
ParamsRepresents a key-value pair of parameters for interpolation.
PluralFuncRepresents a function for handling pluralization in translations.
GlobalLocaleRoutesRepresents global route configurations for different locales.
TranslationsRepresents a key-value pair of translations.
useI18nHead)Types for per-page i18n SEO overrides: I18nHeadInput, I18nHeadLink, I18nHeadMeta, and I18nHeadDisableGroup. Use them in page helpers or when calling useI18nHead from @i18n-micro/types for typed meta, link, replace, and disable options.
import type { I18nHeadInput } from '@i18n-micro/types'
export function buildArticleHead(article: Article): I18nHeadInput {
return {
meta: [{ property: 'og:title', content: article.title }],
replace: { canonical: article.canonicalUrl, ogUrl: article.canonicalUrl },
}
}
TranslationRepresents a translation value, which can be a string, number, boolean, nested translations, or null.
PluralTranslationsRepresents translations for singular and plural forms.
If you find any issues or have suggestions for improvements, feel free to open an issue or submit a pull request on the GitHub repository.
This project is licensed under the MIT License. See the LICENSE file for more details.
For more information, visit the GitHub repository.
FAQs
TypeScript definitions for the Nuxt I18n Micro ecosystem.
The npm package @i18n-micro/types receives a total of 7,646 weekly downloads. As such, @i18n-micro/types popularity was classified as popular.
We found that @i18n-micro/types demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Company News
Open source maintainers are under more pressure than ever. We're raising our open source program from the Team plan to the Business plan, free.

Security News
The supply chain control that delays freshly published gems now covers lockfile generation and gem vendoring in Ruby projects.

Security News
During a UK cyber test, a Mythos 5 agent used sockpuppets, social engineering, and prompt injection to try to get a maintainer to merge malware.