mirror of
https://github.com/ArthurDanjou/ui.git
synced 2026-01-15 12:39:35 +01:00
@@ -1,5 +1,6 @@
|
||||
import { defu } from 'defu'
|
||||
import type { Locale, Direction } from '../types/locale'
|
||||
import type { DeepPartial } from '../types/utils'
|
||||
|
||||
interface DefineLocaleOptions<M> {
|
||||
name: string
|
||||
@@ -12,3 +13,8 @@ interface DefineLocaleOptions<M> {
|
||||
export function defineLocale<M>(options: DefineLocaleOptions<M>): Locale<M> {
|
||||
return defu<DefineLocaleOptions<M>, [{ dir: Direction }]>(options, { dir: 'ltr' })
|
||||
}
|
||||
|
||||
/* @__NO_SIDE_EFFECTS__ */
|
||||
export function extendLocale<M>(locale: Locale<M>, options: Partial<DefineLocaleOptions<DeepPartial<M>>>): Locale<M> {
|
||||
return defu<Locale<M>, [DefineLocaleOptions<M>]>(options, locale)
|
||||
}
|
||||
|
||||
@@ -1,6 +1,10 @@
|
||||
import type { VNode } from 'vue'
|
||||
import type { AcceptableValue as _AcceptableValue } from 'reka-ui'
|
||||
|
||||
export type DeepPartial<T> = {
|
||||
[P in keyof T]?: T[P] extends object ? DeepPartial<T[P]> : T[P] | undefined
|
||||
}
|
||||
|
||||
export type DynamicSlotsKeys<Name extends string | undefined, Suffix extends string | undefined = undefined> = (
|
||||
Name extends string
|
||||
? Suffix extends string
|
||||
|
||||
Reference in New Issue
Block a user