Skip to content

Commit

Permalink
Merge pull request #34 from DamianGlowala/main
Browse files Browse the repository at this point in the history
feat: autocomplete built-in plugin names and locales
  • Loading branch information
tcampbPPU authored Feb 26, 2024
2 parents 8a143b4 + be17e2e commit 87c1019
Show file tree
Hide file tree
Showing 2 changed files with 330 additions and 3 deletions.
7 changes: 4 additions & 3 deletions src/module.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import { defineNuxtModule, addPlugin, addImports, createResolver, addTemplate } from '@nuxt/kit'
import type { BuiltInLocale, BuiltInPluginName } from './types'

export interface RelativeTimeOptions {
future: string,
Expand Down Expand Up @@ -52,12 +53,12 @@ export interface ModuleOptions {
* @example ['en', 'fr']
*/

locales?: string[]
locales?: BuiltInLocale[]

/**
* The default locale to use
*/
defaultLocale?: string | [string, DefaultLocaleOptions]
defaultLocale?: BuiltInLocale | [BuiltInLocale, DefaultLocaleOptions]


/**
Expand All @@ -70,7 +71,7 @@ export interface ModuleOptions {
* @example ['timezone', 'utc']
*/

plugins?: string[]
plugins?: BuiltInPluginName[]

/**
* An array of external optional plugins to load
Expand Down
326 changes: 326 additions & 0 deletions src/types.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,326 @@
export type BuiltInLocale =
| 'af'
| 'af'
| 'am'
| 'am'
| 'ar-dz'
| 'ar-dz'
| 'ar-iq'
| 'ar-iq'
| 'ar-kw'
| 'ar-kw'
| 'ar-ly'
| 'ar-ly'
| 'ar-ma'
| 'ar-ma'
| 'ar-sa'
| 'ar-sa'
| 'ar-tn'
| 'ar-tn'
| 'ar'
| 'ar'
| 'az'
| 'az'
| 'be'
| 'be'
| 'bg'
| 'bg'
| 'bi'
| 'bi'
| 'bm'
| 'bm'
| 'bn-bd'
| 'bn-bd'
| 'bn'
| 'bn'
| 'bo'
| 'bo'
| 'br'
| 'br'
| 'bs'
| 'bs'
| 'ca'
| 'ca'
| 'cs'
| 'cs'
| 'cv'
| 'cv'
| 'cy'
| 'cy'
| 'da'
| 'da'
| 'de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 'ne'
| 'nl-be'
| 'nl-be'
| 'nl'
| 'nl'
| 'nn'
| 'nn'
| 'oc-lnc'
| 'oc-lnc'
| 'pa-in'
| 'pa-in'
| 'pl'
| 'pl'
| 'pt-br'
| 'pt-br'
| 'pt'
| 'pt'
| 'rn'
| 'rn'
| 'ro'
| 'ro'
| 'ru'
| 'ru'
| 'rw'
| 'rw'
| 'sd'
| 'sd'
| 'se'
| 'se'
| 'si'
| 'si'
| 'sk'
| 'sk'
| 'sl'
| 'sl'
| 'sq'
| 'sq'
| 'sr-cyrl'
| 'sr-cyrl'
| 'sr'
| 'sr'
| 'ss'
| 'ss'
| 'sv-fi'
| 'sv-fi'
| 'sv'
| 'sv'
| 'sw'
| 'sw'
| 'ta'
| 'ta'
| 'te'
| 'te'
| 'tet'
| 'tet'
| 'tg'
| 'tg'
| 'th'
| 'th'
| 'tk'
| 'tk'
| 'tl-ph'
| 'tl-ph'
| 'tlh'
| 'tlh'
| 'tr'
| 'tr'
| 'tzl'
| 'tzl'
| 'tzm-latn'
| 'tzm-latn'
| 'tzm'
| 'tzm'
| 'ug-cn'
| 'ug-cn'
| 'uk'
| 'uk'
| 'ur'
| 'ur'
| 'uz-latn'
| 'uz-latn'
| 'uz'
| 'uz'
| 'vi'
| 'vi'
| 'x-pseudo'
| 'x-pseudo'
| 'yo'
| 'yo'
| 'zh-cn'
| 'zh-cn'
| 'zh-hk'
| 'zh-hk'
| 'zh-tw'
| 'zh-tw'
| 'zh'
| 'zh'


export type BuiltInPluginName =
| 'advancedFormat'
| 'arraySupport'
| 'badMutable'
| 'bigIntSupport'
| 'buddhistEra'
| 'calendar'
| 'customParseFormat'
| 'dayOfYear'
| 'devHelper'
| 'duration'
| 'isBetween'
| 'isLeapYear'
| 'isMoment'
| 'isSameOrAfter'
| 'isSameOrBefore'
| 'isToday'
| 'isTomorrow'
| 'isYesterday'
| 'isoWeek'
| 'isoWeeksInYear'
| 'localeData'
| 'localizedFormat'
| 'minMax'
| 'objectSupport'
| 'pluralGetSet'
| 'preParsePostFormat'
| 'quarterOfYear'
| 'relativeTime'
| 'timezone'
| 'toArray'
| 'toObject'
| 'updateLocale'
| 'utc'
| 'weekOfYear'
| 'weekYear'
| 'weekday'

0 comments on commit 87c1019

Please sign in to comment.