import { App } from 'vue'; import { ComponentObjectPropsOptions } from 'vue'; import { ComputedRef } from 'vue'; import { CSSProperties } from 'vue'; import { LocaleConfig as LocaleConfig_2 } from './helper'; import { MaybeRef } from 'vue'; import { NBEM } from '../../common/bem-helper/src'; import { PropType } from 'vue'; import { Ref } from 'vue'; export declare type AnyFunction = (...args: any[]) => any; /** * Arabic locale config. * * @author @ahmedoashery */ export declare function arEGLocale(): LocaleConfig_2; export declare const booleanNumberProp: { type: (NumberConstructor | BooleanConstructor)[]; default: null; }; export declare const booleanProp: { type: BooleanConstructor; default: null; }; export declare const booleanStringProp: { type: (BooleanConstructor | StringConstructor)[]; default: null; }; export declare function buildProps(props: T): Expand>; export declare const classProp: PropType; export declare type ClassType = string | Record | Array>; declare type CommonExcludedProps = 'inherit' | 'value' | 'checked' | 'active' | 'visible' | 'label' | 'options' | 'name'; export declare type ComponentSize = 'small' | 'default' | 'large'; export declare type ComponentState = 'default' | 'success' | 'error' | 'warning'; /** * Provide a hover delay config for under components. * * @param sourceDelay hover delay config * @param app the app of Vue, will use app.provide if specify */ export declare function configHoverDelay(sourceDelay: MaybeRef, app?: App): void; /** * Provide a icons config for under components. * * @param icons icons config * @param app the app of Vue, will use app.provide if specify */ export declare function configIcons(icons: MaybeRef, app?: App): void; /** * Provide a id counter config for under components. * * You only should use this method when initialize application. * * @param sourceCounter id counter config * @param app the app of Vue, will use app.provide if specify */ export declare function configIdCounter(sourceCounter?: IDCounter, app?: App): void; /** * Provide a locale config for under components. * * @param sourceLocale locale config * @param app the app of Vue, will use app.provide if specify */ export declare function configLocale(sourceLocale: MaybeRef, app?: App): void; /** * Provide a namespace config for under components. * * You only should use this method when initialize application. * * @param sourceNamespace namespace config * @param app the app of Vue, will use app.provide if specify */ export declare function configNamespace(sourceNamespace: MaybeRef, app?: App): void; /** * Provide a props config for under components. * * @param props props config * @param app the app of Vue, will use app.provide if specify */ export declare function configProps(props: MaybeRef, app?: App): void; /** * Create a configurable props * * @param T the type of import('vue').ExtractPropTypes * @param E the props should force exclude * @param I the props should force include */ export declare type ConfigurableProps = PostProps<{ [P in keyof T]?: P extends I ? T[P] : P extends `on${Capitalize}` ? never : T[Exclude]; }, ExcludeProps>; /** * Provide a z-index config for under components. * * @param sourceZIndex z-index config * @param app the app of Vue, will use app.provide if specify */ export declare function configZIndex(sourceZIndex: MaybeRef, app?: App): void; export declare function createIconProp(defaultValue?: Record | AnyFunction | null): { isFunc: boolean; default: AnyFunction | Record | null; }; export declare function createSizeProp(defaultValue?: MaybeRef): { default: () => ComponentSize; validator: (value: ComponentSize) => boolean; }; export declare function createStateProp(defaultValue?: MaybeRef): { default: () => ComponentState; validator: (value: ComponentState) => boolean; }; /** * German locale config. * * @author @Andrek18 */ export declare function deDELocale(): LocaleConfig_2; export declare type DeepPartial = { [K in keyof T]?: T[K] extends Record ? DeepPartial : T[K]; }; export declare function defineLocale(locale: LocaleOptions): DeepPartial; export declare function defineLocaleConfig(locale: LocaleConfig): LocaleConfig; export declare function emitEvent(handlers: MaybeArray<(...args: A) => void> | undefined, ...args: A): void; export declare type EnsureValue = Exclude; /** * English locale config. * * @author @qmhc */ export declare function enUSLocale(): LocaleConfig_2; /** * Split and combo the first parameter of the given function * * @example * ```ts * // origin function * type Fn = (value: string | number | boolean) => void * * // after transform * type After = * | ((value: string | number | boolean) => void) * | ((value: string | number) => void) * | ((value: string | boolean) => void) * | ((value: number | boolean) => void) * | ((value: string) => void) * | ((value: number) => void) * | ((value: boolean) => void) * ``` */ declare type EventListener_2 = Expand[0]>>> extends infer F extends any[] ? Parameters extends [unknown, ...infer Others] ? GenerateEvent> : GenerateEvent> : never; export { EventListener_2 as EventListener } export declare function eventProp(): PropType>; declare type ExcludeProps = Exclude | Exclude | (P extends I ? never : P extends `on${Capitalize}` ? P : never); /** * Use to deconstruct advanced types */ export declare type Expand = T extends unknown ? { [K in keyof T]: T[K]; } : never; /** * Persian (Farsi) locale config. * * @author @alphaelf */ export declare function faIRLocale(): LocaleConfig_2; declare type ForceBoolean = true extends T ? Exclude | boolean : false extends T ? Exclude | boolean : T; declare type ForceBooleanDeep = T extends unknown ? { [K in keyof T]: ForceBoolean; } : never; /** * French locale config. * * @author @Nalca */ export declare function frFRLocale(): LocaleConfig_2; declare type GenerateEvent = T extends unknown ? Others extends never ? (value: T[0]) => R : (value: T[0], ...args: Others) => R : never; export declare function getCountWord(wordTemplate: string, count: number): string; export declare function getCountWordOnly(wordTemplate: string, count: number): string; export declare function getDefaultLocaleConfig(locale?: string): LocaleConfig; export declare function getStepByWord(wordTemplate: string, step: number): string; export declare const globalDelay: ComputedRef; export declare const globalIcons: ComputedRef; export declare const globalLocal: ComputedRef; export declare const globalNamespace: ComputedRef<"vxp">; export declare const globalZIndex: ComputedRef; export declare type IconArrayValue = [IconValue, IconOptions?]; export declare type IconConfig = IconValue | IconArrayValue; export declare type IconName = keyof IconsOptions; export declare const iconNames: readonly (keyof IconsOptions)[]; export declare interface IconOptions extends Record { class?: ClassType; style?: StyleType; scale?: number | string; title?: string; label?: string; flip?: 'horizontal' | 'vertical' | 'both'; effect?: string; size?: string; color?: string; rotate?: number | string; } export declare const iconProp: (ObjectConstructor | FunctionConstructor)[]; export declare type IconsConfig = { [K in keyof IconsOptions]-?: IconConfig; }; export declare interface IconsOptions { loading?: IconConfig; clear?: IconConfig; close?: IconConfig; calendar?: IconConfig; clock?: IconConfig; exchange?: IconConfig; angleUp?: IconConfig; angleRight?: IconConfig; angleDown?: IconConfig; angleLeft?: IconConfig; anglesRight?: IconConfig; anglesLeft?: IconConfig; retweet?: IconConfig; refresh?: IconConfig; filter?: IconConfig; ellipsis?: IconConfig; upload?: IconConfig; uploadCloud?: IconConfig; check?: IconConfig; help?: IconConfig; alert?: IconConfig; question?: IconConfig; info?: IconConfig; success?: IconConfig; warning?: IconConfig; error?: IconConfig; delete?: IconConfig; preview?: IconConfig; image?: IconConfig; plus?: IconConfig; minus?: IconConfig; plusSquare?: IconConfig; minusSquare?: IconConfig; cipherText?: IconConfig; plainText?: IconConfig; user?: IconConfig; light?: IconConfig; dark?: IconConfig; signOut?: IconConfig; indent?: IconConfig; outdent?: IconConfig; search?: IconConfig; rotateRight?: IconConfig; rotateLeft?: IconConfig; flipX?: IconConfig; flipY?: IconConfig; zoomIn?: IconConfig; zoonOut?: IconConfig; fullScreen?: IconConfig; resetScreen?: IconConfig; dragger?: IconConfig; file?: IconConfig; fileText?: IconConfig; fileCode?: IconConfig; fileImage?: IconConfig; fileAudio?: IconConfig; fileVideo?: IconConfig; fileZip?: IconConfig; volume?: IconConfig; volumeLow?: IconConfig; volumeMute?: IconConfig; play?: IconConfig; pause?: IconConfig; fullWindow?: IconConfig; pip?: IconConfig; playState?: IconConfig; pauseState?: IconConfig; playPrev?: IconConfig; playNext?: IconConfig; } export declare type IconValue = Record | (() => any); export declare interface IDCounter { getNext: () => number | string; } export declare interface LocaleConfig { locale: string; /** * if false, the spaces will be removed when make sentence */ wordSpace: boolean; calendar: { year: string; month: string; month1: string; month2: string; month3: string; month4: string; month5: string; month6: string; month7: string; month8: string; month9: string; month10: string; month11: string; month12: string; week1: string; week2: string; week3: string; week4: string; week5: string; week6: string; week7: string; ariaLabel: { year: string; month: string; month1: string; month2: string; month3: string; month4: string; month5: string; month6: string; month7: string; month8: string; month9: string; month10: string; month11: string; month12: string; week1: string; week2: string; week3: string; week4: string; week5: string; week6: string; week7: string; }; }; captcha: { slideEnd: string; slide: string; success: string; fail: string; doCaptcha: string; pointInOrder: string; trigger: string; completed: string; }; checkbox: { all: string; }; colorPicker: { confirm: string; cancel: string; ariaLabel: { clear: string; }; }; confirm: { confirm: string; cancel: string; }; datePicker: { confirm: string; cancel: string; placeholder: { year: string; month: string; date: string; datetime: string; start: string; end: string; select: string; }; startTime: string; endTime: string; ariaLabel: { clear: string; quarter: string; week: string; date: string; hour: string; minute: string; second: string; }; }; drawer: { confirm: string; cancel: string; }; form: { submit: string; reset: string; notNullable: string; validateFail: string; }; image: { placeholder: string; error: string; }; input: { placeholder: string; ariaLabel: { clear: string; }; }; layout: { signOut: string; signType: string; majorColor: string; themeMode: string; }; modal: { confirm: string; cancel: string; }; numberInput: { placeholder: string; outOfRange: string; ariaLabel: { clear: string; increase: string; decrease: string; }; }; pagination: { page: string; perPage: string; prevPage: string; nextPage: string; prev: string; next: string; total: string; jumpTo: string; itemUnit: string; }; select: { placeholder: string; empty: string; search: string; ariaLabel: { clear: string; }; }; table: { empty: string; filterConfirm: string; filterReset: string; filterAll: string; }; timeAgo: { ago: string; late: string; justNow: string; second: string; minute: string; hour: string; yesterday: string; days: string; lastMonth: string; months: string; lastYear: string; years: string; }; timePicker: { confirm: string; cancel: string; placeholder: { time: string; start: string; end: string; select: string; }; ariaLabel: { clear: string; hour: string; minute: string; second: string; }; }; tour: { prev: string; next: string; done: string; stepCount: string; }; transfer: { source: string; target: string; empty: string; reverse: string; search: string; }; tree: { empty: string; }; upload: { upload: string; uploading: string; dragOrClick: string; ariaLabel: { preview: string; delete: string; }; }; video: { play: string; pause: string; playPrev: string; playNext: string; refresh: string; flip: string; requestPip: string; exitPip: string; fullWindow: string; fullWindowExit: string; fullScreen: string; fullScreenExit: string; chapterCount: string; }; viewer: { rotateRight: string; rotateLeft: string; flipHorizontal: string; flipVertical: string; zoomIn: string; zoomOut: string; fullScreen: string; fullScreenExit: string; reset: string; }; } export declare type LocaleNames = Exclude; export declare type LocaleOptions = DeepPartial; export declare function localeProp(_name: N): PropType>; export declare function makeSentence(words: string, wordSpace?: boolean): string; declare type MaybeArray = T | T[]; export declare type MaybeFunction = AnyFunction extends T ? T : T | (() => T); export declare type NameHelper = ReturnType; export declare type Namespace = 'vxp'; export declare type NormalizedIconsConfig = Record; export declare function omitProps(props: T, keys: K[]): Expand>; export declare function omitProps(props: T, keys: K[], extra: E): Expand & E>; declare type PostProps = Omit<{ [P in keyof T]: MaybeFunction; }, E>; declare interface PropsConfig { /** * The default value of the prop */ default: T | (() => T) | null; /** * Whether the prop is a function type * * @default false */ isFunc?: boolean; /** * Whether the prop is not configurable * * @default false */ static?: boolean; /** * Whether the prop is required * * @default false */ required?: boolean; /** * The validator for the prop, decide whether the value of the prop is valid * * @param value the value of the prop */ validator?: (value: T) => any; } declare type PropsConfigOptions = { [K in keyof T]?: PropsConfig> | EnsureValue | (() => EnsureValue) | null; }; export declare type PropsOptions = Record>; export declare const PROVIDED_HOVER_DELAY = "___vxp-provided-hover-delay"; export declare const PROVIDED_ICONS = "__vxp-provided-icons"; export declare const PROVIDED_ID_CONTER = "__vxp-provided-id-counter"; export declare const PROVIDED_LOCALE = "__vxp-provided-locale"; export declare const PROVIDED_NAMESPACE = "__vxp-provided-namespace"; export declare const PROVIDED_PROPS = "__vxp-provided-props"; export declare const PROVIDED_Z_INDEX = "___vxp-provided-z-index"; export declare function registerLocale(locale: LocaleConfig): void; export declare const sizeProp: PropType; declare type SplitAndCombo = T extends unknown ? [T] | (SplitAndCombo> extends infer U extends any[] ? U extends U ? [ForceBoolean] : never : never) : never; export declare const stateProp: PropType; export declare const styleProp: PropType; export declare type StyleType = string | CSSProperties | Array; /** * Tamil locale config. * * @author @thearasu */ export declare function taINLocale(): LocaleConfig_2; export declare function useHookProps>(props: T, defaults: { [K in keyof T]: T[K] | null; }): { [P in keyof T]-?: Exclude; }; export declare function useHoverDelay(): ComputedRef; export declare function useIcons(): ComputedRef; export declare function useId(customId?: MaybeRef): Readonly>; export declare function useLocale(): ComputedRef; export declare function useLocale(name: T): ComputedRef; export declare function useLocale(name: T, customLocale: MaybeRef>): ComputedRef; /** * Create a name helper for BEM. * * For css vars name, the namespace is fixed to 'vxp' (not responsive). */ export declare function useNameHelper(block: B, namespace?: MaybeRef): NBEM; export declare function useNamespace(): ComputedRef; export declare function useProps>(name: string, sourceProps: T, config?: PropsConfigOptions): { [P in keyof T]-?: Exclude; }; export declare function useWordSpace(): ComputedRef; export declare function useZIndex(): () => number; export declare const valueProp: { type: (NumberConstructor | BooleanConstructor | StringConstructor)[]; default: null; }; export declare const valuesProp: { type: PropType>; default: null; }; declare type VexipProps = { [P in keyof T]: T[P] extends PropType ? PropType : T[P] extends { type: PropType; } ? PropType : T[P]; }; declare type VoidFunction_2 = () => void; export { VoidFunction_2 as VoidFunction } export declare function wrapProps(props: T): Expand; /** * Chinese (Simplified) locale config. * * @author @qmhc */ export declare function zhCNLocale(): LocaleConfig_2; /** * Chinese (HK) locale config. * * @author @qmhc */ export declare function zhHKLocale(): LocaleConfig_2; /** * Chinese (TW) locale config. * * @author @qmhc */ export declare function zhTWLocale(): LocaleConfig_2; export { }