directix 1.0.0-beta.2 → 1.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.d.ts CHANGED
@@ -4,132 +4,137 @@ import { Plugin as Plugin_2 } from 'vue';
4
4
  import { VNode } from 'vue';
5
5
 
6
6
  /**
7
- * 添加清理函数到元素
7
+ * Add cleanup function to element
8
8
  */
9
9
  export declare function addCleanupVue2(el: Element, fn: () => void): void;
10
10
 
11
11
  /**
12
- * 添加清理函数到元素
12
+ * Add cleanup function to element
13
13
  */
14
14
  export declare function addCleanupVue3(el: Element, fn: () => void): void;
15
15
 
16
16
  /**
17
- * 指令绑定值类型
17
+ * Directive binding value type
18
18
  */
19
19
  export declare type ClickOutsideBinding = ClickOutsideHandler | ClickOutsideOptions;
20
20
 
21
21
  /**
22
- * 点击外部处理函数
22
+ * Click outside handler
23
23
  */
24
24
  export declare type ClickOutsideHandler = (event: MouseEvent | TouchEvent) => void;
25
25
 
26
26
  /**
27
- * 点击外部指令选项
27
+ * Click outside directive options
28
28
  */
29
29
  export declare interface ClickOutsideOptions {
30
30
  /**
31
- * 点击外部时的回调函数
31
+ * Callback when clicking outside
32
32
  * @required
33
33
  */
34
34
  handler: ClickOutsideHandler;
35
35
  /**
36
- * 排除的元素选择器或元素引用
36
+ * Excluded element selectors or element references
37
37
  */
38
38
  exclude?: (string | HTMLElement | (() => HTMLElement | null))[];
39
39
  /**
40
- * 是否使用捕获模式
40
+ * Whether to use capture mode
41
41
  * @default true
42
42
  */
43
43
  capture?: boolean;
44
44
  /**
45
- * 监听的事件类型
45
+ * Event types to listen for
46
46
  * @default ['click']
47
47
  */
48
48
  events?: ('click' | 'mousedown' | 'mouseup' | 'touchstart' | 'touchend')[];
49
49
  /**
50
- * 是否禁用
50
+ * Whether to disable
51
51
  * @default false
52
52
  */
53
53
  disabled?: boolean;
54
54
  /**
55
- * 停止传播
55
+ * Stop propagation
56
56
  * @default false
57
57
  */
58
58
  stop?: boolean;
59
59
  /**
60
- * 阻止默认行为
60
+ * Prevent default behavior
61
61
  * @default false
62
62
  */
63
63
  prevent?: boolean;
64
64
  }
65
65
 
66
66
  /**
67
- * 指令绑定值类型
67
+ * Configure permission directive
68
+ */
69
+ export declare function configurePermission(config: PermissionConfig): void;
70
+
71
+ /**
72
+ * Directive binding value type
68
73
  */
69
74
  export declare type CopyBinding = string | CopyOptions;
70
75
 
71
76
  /**
72
- * 复制失败回调
77
+ * Copy error callback
73
78
  */
74
79
  export declare type CopyErrorCallback = (error: Error) => void;
75
80
 
76
81
  /**
77
- * 复制指令选项
82
+ * Copy directive options
78
83
  */
79
84
  export declare interface CopyOptions {
80
85
  /**
81
- * 要复制的文本
86
+ * Text to copy
82
87
  * @required
83
88
  */
84
89
  value: string;
85
90
  /**
86
- * 复制成功回调
91
+ * Callback on copy success
87
92
  */
88
93
  onSuccess?: CopySuccessCallback;
89
94
  /**
90
- * 复制失败回调
95
+ * Callback on copy error
91
96
  */
92
97
  onError?: CopyErrorCallback;
93
98
  /**
94
- * 复制按钮的提示文本
99
+ * Tooltip text for the copy button
95
100
  */
96
101
  title?: string;
97
102
  /**
98
- * 是否禁用
103
+ * Whether to disable
99
104
  * @default false
100
105
  */
101
106
  disabled?: boolean;
102
107
  }
103
108
 
104
109
  /**
105
- * 复制成功回调
110
+ * Copy success callback
106
111
  */
107
112
  export declare type CopySuccessCallback = (text: string) => void;
108
113
 
109
114
  /**
110
- * Vue 2 指令适配器
115
+ * Vue 2 directive adapter
111
116
  * @returns Vue 2 directive object with bind/inserted/update/unbind hooks
112
117
  */
113
118
  export declare function createVue2Directive<T, B extends Element>(hooks: DirectiveHooks<T, B>): Record<string, any>;
114
119
 
115
120
  /**
116
- * Vue 3 指令适配器
121
+ * Vue 3 directive adapter
117
122
  * @returns Vue 3 directive object with created/mounted/updated/unmounted hooks
118
123
  */
119
124
  export declare function createVue3Directive<T, B extends Element>(hooks: DirectiveHooks<T, B>): Record<string, any>;
120
125
 
121
126
  /**
122
- * 跨版本指令类型(兼容 Vue 2/3
127
+ * Cross-version directive type (compatible with Vue 2/3)
123
128
  */
124
129
  export declare type CrossVersionDirective = Directive | Vue2DirectiveHooks | Vue3DirectiveHooks;
125
130
 
126
131
  /**
127
- * 指令绑定值类型
132
+ * Directive binding value type
128
133
  */
129
134
  export declare type DebounceBinding<T extends (...args: any[]) => any = any> = T | DebounceOptions<T>;
130
135
 
131
136
  /**
132
- * 防抖函数类型
137
+ * Debounced function type
133
138
  */
134
139
  export declare interface DebouncedFunction<T extends (...args: any[]) => any> {
135
140
  (...args: Parameters<T>): void;
@@ -138,7 +143,7 @@ export declare interface DebouncedFunction<T extends (...args: any[]) => any> {
138
143
  }
139
144
 
140
145
  /**
141
- * 防抖函数
146
+ * Debounce function
142
147
  */
143
148
  export declare function debounceFn<T extends (...args: any[]) => any>(func: T, wait?: number, options?: {
144
149
  leading?: boolean;
@@ -149,49 +154,49 @@ export declare function debounceFn<T extends (...args: any[]) => any>(func: T, w
149
154
  };
150
155
 
151
156
  /**
152
- * 防抖指令选项
157
+ * Debounce directive options
153
158
  */
154
159
  export declare interface DebounceOptions<T extends (...args: any[]) => any = any> {
155
160
  /**
156
- * 要防抖的函数
161
+ * Function to debounce
157
162
  */
158
163
  handler: T;
159
164
  /**
160
- * 延迟时间(毫秒)
165
+ * Delay time in milliseconds
161
166
  * @default 300
162
167
  */
163
168
  wait?: number;
164
169
  /**
165
- * 是否在延迟开始前立即调用
170
+ * Whether to invoke immediately before delay starts
166
171
  * @default false
167
172
  */
168
173
  leading?: boolean;
169
174
  /**
170
- * 是否在延迟结束后调用
175
+ * Whether to invoke after delay ends
171
176
  * @default true
172
177
  */
173
178
  trailing?: boolean;
174
179
  }
175
180
 
176
181
  /**
177
- * 深拷贝
182
+ * Deep clone an object
178
183
  */
179
184
  export declare function deepClone<T>(obj: T): T;
180
185
 
181
186
  /**
182
- * 深合并
187
+ * Deep merge objects
183
188
  */
184
189
  export declare function deepMerge<T extends Record<string, any>>(target: T, ...sources: Partial<T>[]): T;
185
190
 
186
191
  /**
187
- * 定义一个跨版本兼容的指令
188
- * @param definition 指令定义
189
- * @returns Vue 指令对象
192
+ * Define a cross-version compatible directive
193
+ * @param definition The directive definition
194
+ * @returns Vue directive object
190
195
  */
191
196
  export declare function defineDirective<T = any, B extends Element = Element>(definition: DirectiveDefinition<T, B>): Directive;
192
197
 
193
198
  /**
194
- * 定义指令组
199
+ * Define a directive group
195
200
  */
196
201
  export declare function defineDirectiveGroup(name: string, directives: Record<string, any>): {
197
202
  name: string;
@@ -200,352 +205,1340 @@ export declare function defineDirectiveGroup(name: string, directives: Record<st
200
205
  };
201
206
 
202
207
  /**
203
- * 统一的指令绑定对象
208
+ * Unified directive binding object
204
209
  */
205
210
  export declare interface DirectiveBinding<T = any> {
206
- /** 指令绑定的值 */
211
+ /** The value passed to the directive */
207
212
  value: T;
208
- /** 上一次绑定的值 */
213
+ /** The previous value */
209
214
  oldValue: T | null;
210
- /** 指令参数 (v-xxx:arg) */
215
+ /** The directive argument (v-xxx:arg) */
211
216
  arg?: string;
212
- /** 修饰符对象 (v-xxx.modifier) */
217
+ /** The modifiers object (v-xxx.modifier) */
213
218
  modifiers: Record<string, boolean>;
214
- /** 组件实例 */
219
+ /** The component instance */
215
220
  instance: ComponentPublicInstance | null;
216
221
  }
217
222
 
218
223
  /**
219
- * 指令定义接口
224
+ * Directive definition interface
220
225
  */
221
226
  export declare interface DirectiveDefinition<T = any, B extends Element = Element> extends DirectiveHooks<T, B> {
222
- /** 指令名称 */
227
+ /** The directive name */
223
228
  name: string;
224
- /** 指令版本 */
229
+ /** The Vue version compatibility */
225
230
  version?: '2' | '3' | 'both';
226
- /** 是否服务端渲染兼容 */
231
+ /** Whether SSR compatible */
227
232
  ssr?: boolean;
228
- /** 默认值 */
233
+ /** Default values */
229
234
  defaults?: Partial<T>;
230
235
  }
231
236
 
232
237
  /**
233
- * 统一的指令钩子函数
238
+ * Unified directive hooks
234
239
  */
235
240
  export declare interface DirectiveHooks<T = any, B extends Element = Element> {
236
241
  /**
237
- * 指令绑定到元素时调用
238
- * @param el 绑定的 DOM 元素
239
- * @param binding 绑定对象
240
- * @param vnode Vue 虚拟节点
242
+ * Called when the directive is bound to an element
243
+ * @param el The bound DOM element
244
+ * @param binding The binding object
245
+ * @param vnode The Vue virtual node
241
246
  */
242
247
  mounted?: (el: B, binding: DirectiveBinding<T>, vnode: VNode) => void;
243
248
  /**
244
- * 元素更新时调用
245
- * @param el 绑定的 DOM 元素
246
- * @param binding 新的绑定对象
247
- * @param vnode 新的虚拟节点
248
- * @param prevBinding 旧的绑定对象
249
- * @param prevVnode 旧的虚拟节点
249
+ * Called when the element is updated
250
+ * @param el The bound DOM element
251
+ * @param binding The new binding object
252
+ * @param vnode The new virtual node
253
+ * @param prevBinding The previous binding object
254
+ * @param prevVnode The previous virtual node
250
255
  */
251
256
  updated?: (el: B, binding: DirectiveBinding<T>, vnode: VNode, prevBinding: DirectiveBinding<T>, prevVnode: VNode) => void;
252
257
  /**
253
- * 指令卸载时调用
254
- * @param el 绑定的 DOM 元素
255
- * @param binding 绑定对象
256
- * @param vnode 虚拟节点
258
+ * Called when the directive is unbound
259
+ * @param el The bound DOM element
260
+ * @param binding The binding object
261
+ * @param vnode The virtual node
257
262
  */
258
263
  unmounted?: (el: B, binding: DirectiveBinding<T>, vnode: VNode) => void;
259
264
  }
260
265
 
261
266
  /**
262
- * 指令安装选项
267
+ * Directive installation options
263
268
  */
264
269
  export declare interface DirectiveInstallOptions {
265
- /** 注册的指令名称列表,不传则注册全部 */
270
+ /** List of directive names to register, registers all if not provided */
266
271
  directives?: string[];
267
- /** 是否注册全部指令 */
272
+ /** Whether to register all directives */
268
273
  all?: boolean;
269
- /** 全局配置 */
274
+ /** Global configuration */
270
275
  config?: Record<string, any>;
271
276
  }
272
277
 
273
278
  /**
274
- * Directix 插件
279
+ * Directix plugin
275
280
  */
276
281
  export declare const Directix: Plugin_2;
277
282
 
278
283
  /**
279
- * 指令绑定值类型
284
+ * Directive binding value type
280
285
  */
281
286
  export declare type FocusBinding = boolean | FocusOptions_2;
282
287
 
283
288
  /**
284
- * 焦点指令选项
289
+ * Focus directive options
285
290
  */
286
291
  declare interface FocusOptions_2 {
287
292
  /**
288
- * 是否自动聚焦
293
+ * Whether to auto focus
289
294
  * @default true
290
295
  */
291
296
  focus?: boolean;
292
297
  /**
293
- * 是否在每次更新时重新聚焦
298
+ * Whether to refocus when binding value changes
294
299
  * @default false
295
300
  */
296
301
  refocus?: boolean;
297
302
  /**
298
- * 聚焦时的回调
303
+ * Callback when focused
299
304
  */
300
305
  onFocus?: (el: HTMLElement) => void;
301
306
  /**
302
- * 失焦时的回调
307
+ * Callback when blurred
303
308
  */
304
309
  onBlur?: (el: HTMLElement) => void;
305
310
  }
306
311
  export { FocusOptions_2 as FocusOptions }
307
312
 
308
313
  /**
309
- * 生成唯一 ID
314
+ * Generate unique ID
310
315
  */
311
316
  export declare function generateId(prefix?: string): string;
312
317
 
313
318
  /**
314
- * 获取嵌套属性值
319
+ * Get nested property value by path
315
320
  */
316
321
  export declare function get<T = any>(obj: Record<string, any>, path: string, defaultValue?: T): T;
317
322
 
318
323
  /**
319
- * 获取当前 Vue 版本
324
+ * Get current configuration
325
+ */
326
+ export declare function getPermissionConfig(): PermissionConfig | null;
327
+
328
+ /**
329
+ * Get current Vue version
330
+ */
331
+ export declare function getVueVersion(): VueVersion;
332
+
333
+ /**
334
+ * Directive binding value type
335
+ */
336
+ export declare type HoverBinding = HoverHandler | HoverOptions;
337
+
338
+ /**
339
+ * Hover state change handler
340
+ */
341
+ export declare type HoverHandler = (isHovering: boolean, event: MouseEvent) => void;
342
+
343
+ /**
344
+ * Hover directive options
345
+ */
346
+ export declare interface HoverOptions {
347
+ /**
348
+ * Callback when hover state changes
349
+ */
350
+ handler?: HoverHandler;
351
+ /**
352
+ * Callback when mouse enters
353
+ */
354
+ onEnter?: (event: MouseEvent) => void;
355
+ /**
356
+ * Callback when mouse leaves
357
+ */
358
+ onLeave?: (event: MouseEvent) => void;
359
+ /**
360
+ * CSS class to add when hovering
361
+ * @default 'v-hover'
362
+ */
363
+ class?: string;
364
+ /**
365
+ * Whether to disable
366
+ * @default false
367
+ */
368
+ disabled?: boolean;
369
+ /**
370
+ * Delay in milliseconds before triggering enter
371
+ * @default 0
372
+ */
373
+ enterDelay?: number;
374
+ /**
375
+ * Delay in milliseconds before triggering leave
376
+ * @default 0
377
+ */
378
+ leaveDelay?: number;
379
+ }
380
+
381
+ /**
382
+ * Directive binding value type
383
+ */
384
+ export declare type InfiniteScrollBinding = InfiniteScrollHandler | InfiniteScrollOptions;
385
+
386
+ /**
387
+ * Infinite scroll handler
388
+ */
389
+ export declare type InfiniteScrollHandler = () => void | Promise<void>;
390
+
391
+ /**
392
+ * Infinite scroll directive options
393
+ */
394
+ export declare interface InfiniteScrollOptions {
395
+ /**
396
+ * Handler to call when scrolling to bottom
397
+ * @required
398
+ */
399
+ handler: InfiniteScrollHandler;
400
+ /**
401
+ * Distance from bottom to trigger load (in pixels)
402
+ * @default 0
403
+ */
404
+ distance?: number;
405
+ /**
406
+ * Whether to disable
407
+ * @default false
408
+ */
409
+ disabled?: boolean;
410
+ /**
411
+ * Whether currently loading
412
+ * @default false
413
+ */
414
+ loading?: boolean;
415
+ /**
416
+ * Whether to use IntersectionObserver (more efficient)
417
+ * @default true
418
+ */
419
+ useIntersection?: boolean;
420
+ /**
421
+ * Throttle time in milliseconds
422
+ * @default 200
423
+ */
424
+ throttle?: number;
425
+ /**
426
+ * Custom scroll container
427
+ */
428
+ container?: string | Element | null;
429
+ /**
430
+ * Callback when load starts
431
+ */
432
+ onLoadStart?: () => void;
433
+ /**
434
+ * Callback when load completes
435
+ */
436
+ onLoadEnd?: () => void;
437
+ /**
438
+ * Callback on error
439
+ */
440
+ onError?: (error: Error) => void;
441
+ }
442
+
443
+ /**
444
+ * Directive binding value type
445
+ */
446
+ export declare type IntersectBinding = IntersectHandler | IntersectOptions;
447
+
448
+ /**
449
+ * Intersect event handler
450
+ */
451
+ export declare type IntersectHandler = (entry: IntersectionObserverEntry, observer: IntersectionObserver) => void;
452
+
453
+ /**
454
+ * Intersect directive options
320
455
  */
321
- export declare function getVueVersion(): 2 | 3;
456
+ export declare interface IntersectOptions {
457
+ /** Callback when element intersects */
458
+ handler?: IntersectHandler;
459
+ /** Callback when element enters viewport */
460
+ onEnter?: (entry: IntersectionObserverEntry, observer: IntersectionObserver) => void;
461
+ /** Callback when element leaves viewport */
462
+ onLeave?: (entry: IntersectionObserverEntry, observer: IntersectionObserver) => void;
463
+ /** Callback when element changes intersection */
464
+ onChange?: (isIntersecting: boolean, entry: IntersectionObserverEntry) => void;
465
+ /** Root element for intersection @default null (viewport) */
466
+ root?: Element | null;
467
+ /** Margin around the root @default '0px' */
468
+ rootMargin?: string;
469
+ /** Threshold(s) at which to trigger callback @default 0 */
470
+ threshold?: number | number[];
471
+ /** Whether to disable @default false */
472
+ disabled?: boolean;
473
+ /** Whether to trigger only once @default false */
474
+ once?: boolean;
475
+ }
322
476
 
323
477
  /**
324
- * 检查是否为数组
478
+ * Check if value is an array
325
479
  */
326
480
  export declare function isArray(value: unknown): value is any[];
327
481
 
328
482
  /**
329
- * 检查是否为布尔值
483
+ * Check if value is a boolean
330
484
  */
331
485
  export declare function isBoolean(value: unknown): value is boolean;
332
486
 
333
487
  /**
334
- * 是否浏览器环境
488
+ * Check if browser environment
335
489
  */
336
490
  export declare const isBrowser: () => boolean;
337
491
 
338
492
  /**
339
- * 检查是否为空
493
+ * Check if value is empty
340
494
  */
341
495
  export declare function isEmpty(value: unknown): boolean;
342
496
 
343
497
  /**
344
- * 检查是否为函数
498
+ * Check if value is a function
345
499
  */
346
500
  export declare function isFunction(value: unknown): value is (...args: any[]) => any;
347
501
 
348
502
  /**
349
- * 检查是否为数字
503
+ * Check if value is a number
350
504
  */
351
505
  export declare function isNumber(value: unknown): value is number;
352
506
 
353
507
  /**
354
- * 检查是否为对象
508
+ * Check if value is an object
355
509
  */
356
510
  export declare function isObject(value: unknown): value is Record<string, any>;
357
511
 
358
512
  /**
359
- * 检查是否为 Promise
513
+ * Check if value is a Promise
360
514
  */
361
515
  export declare function isPromise<T = any>(value: unknown): value is Promise<T>;
362
516
 
363
517
  /**
364
- * 是否服务端渲染
518
+ * Check if server-side rendering
365
519
  */
366
520
  export declare const isSSR: () => boolean;
367
521
 
368
522
  /**
369
- * 检查是否为字符串
523
+ * Check if value is a string
370
524
  */
371
525
  export declare function isString(value: unknown): value is string;
372
526
 
373
527
  /**
374
- * 是否 Vue 2
528
+ * Check if Vue 2 (includes 2.7)
375
529
  */
376
- export declare const isVue2: () => boolean;
530
+ export declare function isVue2(): boolean;
377
531
 
378
532
  /**
379
- * 是否 Vue 3
533
+ * Check if Vue 2.7 (has built-in Composition API support)
380
534
  */
381
- export declare const isVue3: () => boolean;
535
+ export declare function isVue27(): boolean;
382
536
 
383
537
  /**
384
- * 解析时间参数
385
- * 支持格式: "300" | "300ms" | "1s"
538
+ * Check if Vue 3
386
539
  */
387
- export declare function parseTime(arg?: string): number | null;
540
+ export declare function isVue3(): boolean;
388
541
 
389
542
  /**
390
- * 设置嵌套属性值
543
+ * Directive binding value type
391
544
  */
392
- export declare function set(obj: Record<string, any>, path: string, value: any): void;
545
+ export declare type LazyBinding = string | LazyOptions;
393
546
 
394
547
  /**
395
- * 是否支持 Clipboard API
548
+ * Lazy directive options
396
549
  */
397
- export declare const supportsClipboard: () => boolean;
550
+ export declare interface LazyOptions {
551
+ /**
552
+ * Image source URL
553
+ */
554
+ src?: string;
555
+ /**
556
+ * Placeholder image URL
557
+ */
558
+ placeholder?: string;
559
+ /**
560
+ * Error image URL (shown when loading fails)
561
+ */
562
+ error?: string;
563
+ /**
564
+ * Preload distance in pixels
565
+ * @default 0
566
+ */
567
+ preload?: number;
568
+ /**
569
+ * Callback when image loads successfully
570
+ */
571
+ onLoad?: (el: HTMLElement) => void;
572
+ /**
573
+ * Callback when image fails to load
574
+ */
575
+ onError?: (el: HTMLElement, error: Error) => void;
576
+ /**
577
+ * Number of retry attempts
578
+ * @default 1
579
+ */
580
+ attempt?: number;
581
+ /**
582
+ * Filter function, return false to skip loading
583
+ */
584
+ filter?: (src: string) => boolean;
585
+ /**
586
+ * Custom IntersectionObserver
587
+ */
588
+ observer?: IntersectionObserver;
589
+ /**
590
+ * Whether to disable lazy loading
591
+ * @default false
592
+ */
593
+ disabled?: boolean;
594
+ }
398
595
 
399
596
  /**
400
- * 是否支持 IntersectionObserver
597
+ * Lazy loading state
401
598
  */
402
- export declare const supportsIntersectionObserver: () => boolean;
599
+ export declare type LazyState = 'pending' | 'loading' | 'loaded' | 'error';
403
600
 
404
601
  /**
405
- * 是否支持 MutationObserver
602
+ * Directive binding value type
406
603
  */
407
- export declare const supportsMutationObserver: () => boolean;
604
+ export declare type LoadingBinding = boolean | LoadingOptions;
408
605
 
409
606
  /**
410
- * 是否支持 Passive 事件监听
607
+ * Loading directive options
411
608
  */
412
- export declare const supportsPassive: () => boolean;
609
+ export declare interface LoadingOptions {
610
+ /**
611
+ * Loading state
612
+ * @default true
613
+ */
614
+ value?: boolean;
615
+ /**
616
+ * Loading text to display
617
+ */
618
+ text?: string;
619
+ /**
620
+ * CSS class for loading overlay
621
+ * @default 'v-loading'
622
+ */
623
+ loadingClass?: string;
624
+ /**
625
+ * CSS class for loading spinner
626
+ * @default 'v-loading__spinner'
627
+ */
628
+ spinnerClass?: string;
629
+ /**
630
+ * CSS class for loading text
631
+ * @default 'v-loading__text'
632
+ */
633
+ textClass?: string;
634
+ /**
635
+ * Custom spinner HTML
636
+ */
637
+ spinner?: string;
638
+ /**
639
+ * Background color
640
+ * @default 'rgba(255, 255, 255, 0.9)'
641
+ */
642
+ background?: string;
643
+ /**
644
+ * Whether to lock scroll while loading
645
+ * @default false
646
+ */
647
+ lock?: boolean;
648
+ /**
649
+ * Whether to disable
650
+ * @default false
651
+ */
652
+ disabled?: boolean;
653
+ }
413
654
 
414
655
  /**
415
- * 是否支持 ResizeObserver
656
+ * Directive binding value type
416
657
  */
417
- export declare const supportsResizeObserver: () => boolean;
658
+ export declare type LongPressBinding = LongPressHandler | LongPressOptions;
418
659
 
419
660
  /**
420
- * 指令绑定值类型
661
+ * Long press handler
421
662
  */
422
- export declare type ThrottleBinding<T extends (...args: any[]) => any = any> = T | ThrottleOptions<T>;
663
+ export declare type LongPressHandler = (event: MouseEvent | TouchEvent) => void;
423
664
 
424
665
  /**
425
- * 节流函数类型
666
+ * Long press directive options
426
667
  */
427
- export declare interface ThrottledFunction<T extends (...args: any[]) => any> {
428
- (...args: Parameters<T>): void;
429
- cancel: () => void;
668
+ export declare interface LongPressOptions {
669
+ /**
670
+ * Callback when long press is triggered
671
+ * @required
672
+ */
673
+ handler: LongPressHandler;
674
+ /**
675
+ * Duration in milliseconds to trigger long press
676
+ * @default 500
677
+ */
678
+ duration?: number;
679
+ /**
680
+ * Whether to disable
681
+ * @default false
682
+ */
683
+ disabled?: boolean;
684
+ /**
685
+ * Maximum movement distance before canceling
686
+ * @default 10
687
+ */
688
+ distance?: number;
689
+ /**
690
+ * Callback when long press starts (on mousedown/touchstart)
691
+ */
692
+ onStart?: (event: MouseEvent | TouchEvent) => void;
693
+ /**
694
+ * Callback when long press is canceled
695
+ */
696
+ onCancel?: (event: MouseEvent | TouchEvent) => void;
697
+ /**
698
+ * Callback on each tick during long press
699
+ */
700
+ onTick?: (remaining: number) => void;
701
+ /**
702
+ * Interval for onTick callback in milliseconds
703
+ * @default 100
704
+ */
705
+ tickInterval?: number;
706
+ /**
707
+ * Whether to prevent default behavior
708
+ * @default true
709
+ */
710
+ prevent?: boolean;
711
+ /**
712
+ * Whether to stop propagation
713
+ * @default false
714
+ */
715
+ stop?: boolean;
430
716
  }
431
717
 
718
+ export declare type MaskBinding = string | MaskOptions;
719
+
432
720
  /**
433
- * 节流函数
721
+ * Mask directive options
434
722
  */
435
- export declare function throttleFn<T extends (...args: any[]) => any>(func: T, wait?: number, options?: {
436
- leading?: boolean;
437
- trailing?: boolean;
438
- }): ((...args: Parameters<T>) => void) & {
439
- cancel: () => void;
440
- };
723
+ export declare interface MaskOptions {
724
+ /** Mask pattern: # digit, A letter, N alphanumeric, X any, others as literals */
725
+ mask: string;
726
+ /** Placeholder character @default '_' */
727
+ placeholder?: string;
728
+ /** Show mask placeholder on focus @default true */
729
+ showPlaceholder?: boolean;
730
+ /** Show mask on blur @default false */
731
+ showMaskOnBlur?: boolean;
732
+ /** Clear incomplete on blur @default false */
733
+ clearIncomplete?: boolean;
734
+ /** Disable @default false */
735
+ disabled?: boolean;
736
+ /** Callback when value changes */
737
+ onChange?: (value: string, rawValue: string) => void;
738
+ /** Callback when mask is complete */
739
+ onComplete?: (value: string) => void;
740
+ }
441
741
 
442
742
  /**
443
- * 节流指令选项
743
+ * Directive binding value type
444
744
  */
445
- export declare interface ThrottleOptions<T extends (...args: any[]) => any = any> {
745
+ export declare type MutationBinding = MutationHandler | MutationOptions;
746
+
747
+ /**
748
+ * Mutation change handler
749
+ */
750
+ export declare type MutationHandler = (mutations: MutationRecord[], observer: MutationObserver) => void;
751
+
752
+ /**
753
+ * Mutation directive options
754
+ */
755
+ export declare interface MutationOptions {
446
756
  /**
447
- * 要节流的函数
757
+ * Callback when mutations occur
758
+ * @required
448
759
  */
449
- handler: T;
760
+ handler: MutationHandler;
450
761
  /**
451
- * 延迟时间(毫秒)
452
- * @default 300
762
+ * Whether to observe attribute changes
763
+ * @default false
453
764
  */
454
- wait?: number;
765
+ attributes?: boolean;
455
766
  /**
456
- * 是否在延迟开始前立即调用
457
- * @default true
767
+ * Specific attributes to observe
458
768
  */
459
- leading?: boolean;
769
+ attributeFilter?: string[];
460
770
  /**
461
- * 是否在延迟结束后调用
771
+ * Whether to observe child node additions/removals
462
772
  * @default true
463
773
  */
464
- trailing?: boolean;
774
+ childList?: boolean;
775
+ /**
776
+ * Whether to observe all descendants, not just direct children
777
+ * @default false
778
+ */
779
+ subtree?: boolean;
780
+ /**
781
+ * Whether to observe character data changes
782
+ * @default false
783
+ */
784
+ characterData?: boolean;
785
+ /**
786
+ * Whether to record old attribute values
787
+ * @default false
788
+ */
789
+ attributeOldValue?: boolean;
790
+ /**
791
+ * Whether to record old character data
792
+ * @default false
793
+ */
794
+ characterDataOldValue?: boolean;
795
+ /**
796
+ * Whether to disable
797
+ * @default false
798
+ */
799
+ disabled?: boolean;
465
800
  }
466
801
 
467
802
  /**
468
- * v-click-outside 指令
469
- *
470
- * @example
471
- * ```vue
472
- * <template>
473
- * <div v-click-outside="handleClickOutside">
474
- * 下拉菜单
475
- * </div>
476
- * </template>
477
- * ```
803
+ * Parse time argument
804
+ * Supports formats: "300" | "300ms" | "1s"
478
805
  */
479
- declare const vClickOutside: Directive;
480
- export { vClickOutside as clickOutside }
481
- export { vClickOutside }
806
+ export declare function parseTime(arg?: string): number | null;
482
807
 
483
808
  /**
484
- * v-copy 指令
485
- *
486
- * @example
487
- * ```vue
488
- * <template>
489
- * <button v-copy="textToCopy">复制文本</button>
490
- * </template>
491
- * ```
809
+ * Permission action mode
492
810
  */
493
- declare const vCopy: Directive;
494
- export { vCopy as copy }
495
- export { vCopy }
811
+ export declare type PermissionAction = 'remove' | 'disable' | 'hide';
496
812
 
497
813
  /**
498
- * v-debounce 指令
499
- *
500
- * @example
501
- * ```vue
502
- * <template>
503
- * <input v-debounce="handleInput" />
504
- * <input v-debounce:500ms="handleInput" />
505
- * <input v-debounce="{ handler: handleInput, wait: 500 }" />
506
- * <div v-debounce.scroll="handleScroll">滚动防抖</div>
507
- * <div v-debounce:100.scroll="handleScroll">100ms 滚动防抖</div>
508
- * </template>
509
- * ```
814
+ * Directive binding value type
510
815
  */
511
- declare const vDebounce: Directive;
512
- export { vDebounce as debounce }
513
- export { vDebounce }
816
+ export declare type PermissionBinding = string | string[] | PermissionOptions;
514
817
 
515
818
  /**
516
- * v-focus 指令
517
- *
518
- * @example
519
- * ```vue
520
- * <template>
521
- * <input v-focus />
522
- * <input v-focus="{ focus: true, refocus: true }" />
523
- * </template>
524
- * ```
819
+ * Permission configuration
525
820
  */
526
- declare const vFocus: Directive;
527
- export { vFocus as focus }
528
- export { vFocus }
821
+ export declare interface PermissionConfig {
822
+ /** Get current user's permissions */
823
+ getPermissions: () => string[];
824
+ /** Get current user's roles */
825
+ getRoles?: () => string[];
826
+ /** Role to permission mapping */
827
+ roleMap?: Record<string, string[]>;
828
+ }
529
829
 
530
830
  /**
531
- * v-throttle 指令
532
- *
533
- * @example
534
- * ```vue
535
- * <template>
536
- * <button v-throttle="handleClick">节流按钮</button>
537
- * <button v-throttle:1s="handleClick">1秒节流</button>
538
- * <div v-throttle.scroll="handleScroll">滚动节流</div>
539
- * <div v-throttle:100.scroll="handleScroll">100ms 滚动节流</div>
540
- * </template>
541
- * ```
831
+ * Permission check mode
542
832
  */
543
- declare const vThrottle: Directive;
544
- export { vThrottle as throttle }
545
- export { vThrottle }
833
+ declare type PermissionMode = 'some' | 'every';
546
834
 
547
835
  /**
548
- * Vue 2 指令钩子
836
+ * Permission directive options
837
+ */
838
+ export declare interface PermissionOptions {
839
+ /** Permission value(s) to check */
840
+ value: string | string[];
841
+ /** Logic for multiple permissions: 'some' (OR) or 'every' (AND). Default: 'some' */
842
+ mode?: PermissionMode;
843
+ /** Action when permission denied. Default: 'remove' */
844
+ action?: PermissionAction;
845
+ /** Custom permission check function */
846
+ check?: (permission: string | string[], mode: PermissionMode) => boolean;
847
+ /** Callback when permission state changes */
848
+ onChange?: (hasPermission: boolean) => void;
849
+ }
850
+
851
+ /**
852
+ * Reset Vue version (useful for testing)
853
+ */
854
+ export declare function resetVueVersion(): void;
855
+
856
+ /**
857
+ * Directive binding value type
858
+ */
859
+ export declare type ResizeBinding = ResizeHandler | ResizeOptions;
860
+
861
+ /**
862
+ * Resize event handler
863
+ */
864
+ export declare type ResizeHandler = (entry: ResizeObserverEntry) => void;
865
+
866
+ /**
867
+ * Resize information
868
+ */
869
+ export declare interface ResizeInfo {
870
+ /** New width */
871
+ width: number;
872
+ /** New height */
873
+ height: number;
874
+ /** Content rect */
875
+ contentRect: DOMRectReadOnly;
876
+ /** Border box size */
877
+ borderBoxSize: ReadonlyArray<ResizeObserverSize>;
878
+ /** Content box size */
879
+ contentBoxSize: ReadonlyArray<ResizeObserverSize>;
880
+ /** Device pixel content box size */
881
+ devicePixelContentBoxSize: ReadonlyArray<ResizeObserverSize>;
882
+ }
883
+
884
+ /**
885
+ * Resize directive options
886
+ */
887
+ export declare interface ResizeOptions {
888
+ /**
889
+ * Resize event handler
890
+ * @required
891
+ */
892
+ handler: ResizeHandler;
893
+ /**
894
+ * Whether to disable
895
+ * @default false
896
+ */
897
+ disabled?: boolean;
898
+ /**
899
+ * Whether to use box model
900
+ * - 'content-box': size of content area
901
+ * - 'border-box': size of border box
902
+ * - 'device-pixel-content-box': size in device pixels
903
+ * @default 'content-box'
904
+ */
905
+ box?: 'content-box' | 'border-box' | 'device-pixel-content-box';
906
+ /**
907
+ * Debounce time in milliseconds
908
+ * @default 0 (no debounce)
909
+ */
910
+ debounce?: number;
911
+ /**
912
+ * Callback for browsers without ResizeObserver (uses object fallback)
913
+ */
914
+ onFallback?: (info: ResizeInfo) => void;
915
+ }
916
+
917
+ /**
918
+ * Directive binding value type
919
+ */
920
+ export declare type RippleBinding = boolean | string | RippleOptions;
921
+
922
+ /**
923
+ * Ripple directive options
924
+ */
925
+ export declare interface RippleOptions {
926
+ /**
927
+ * Ripple color
928
+ * @default 'currentColor'
929
+ */
930
+ color?: string;
931
+ /**
932
+ * Ripple duration in milliseconds
933
+ * @default 600
934
+ */
935
+ duration?: number;
936
+ /**
937
+ * Whether to disable ripple
938
+ * @default false
939
+ */
940
+ disabled?: boolean;
941
+ /**
942
+ * Initial scale of ripple
943
+ * @default 0
944
+ */
945
+ initialScale?: number;
946
+ /**
947
+ * Final scale of ripple
948
+ * @default 2
949
+ */
950
+ finalScale?: number;
951
+ }
952
+
953
+ /**
954
+ * Directive binding value type
955
+ */
956
+ export declare type SanitizeBinding = boolean | SanitizeOptions;
957
+
958
+ /**
959
+ * Sanitize handler
960
+ */
961
+ export declare type SanitizeHandler = (value: string) => string;
962
+
963
+ /**
964
+ * Sanitize directive options
965
+ */
966
+ export declare interface SanitizeOptions {
967
+ /**
968
+ * Tags to allow (whitelist)
969
+ * @default []
970
+ */
971
+ allowedTags?: string[];
972
+ /**
973
+ * Attributes to allow (whitelist)
974
+ * @default []
975
+ */
976
+ allowedAttributes?: string[];
977
+ /**
978
+ * Whether to allow data URLs
979
+ * @default false
980
+ */
981
+ allowDataUrls?: boolean;
982
+ /**
983
+ * Whether to allow inline styles
984
+ * @default false
985
+ */
986
+ allowStyles?: boolean;
987
+ /**
988
+ * Whether to allow class attribute
989
+ * @default false
990
+ */
991
+ allowClass?: boolean;
992
+ /**
993
+ * Whether to allow id attribute
994
+ * @default false
995
+ */
996
+ allowId?: boolean;
997
+ /**
998
+ * Custom sanitize function
999
+ */
1000
+ handler?: SanitizeHandler;
1001
+ /**
1002
+ * Whether to disable
1003
+ * @default false
1004
+ */
1005
+ disabled?: boolean;
1006
+ /**
1007
+ * Whether to sanitize on update
1008
+ * @default true
1009
+ */
1010
+ sanitizeOnUpdate?: boolean;
1011
+ }
1012
+
1013
+ /**
1014
+ * Directive binding value type
1015
+ */
1016
+ export declare type ScrollBinding = ScrollHandler | ScrollOptions_2;
1017
+
1018
+ /**
1019
+ * Scroll event handler
1020
+ */
1021
+ export declare type ScrollHandler = (event: Event, info: ScrollInfo) => void;
1022
+
1023
+ /**
1024
+ * Scroll information
1025
+ */
1026
+ export declare interface ScrollInfo {
1027
+ /** Current scroll left position */
1028
+ scrollLeft: number;
1029
+ /** Current scroll top position */
1030
+ scrollTop: number;
1031
+ /** Maximum scroll left */
1032
+ scrollLeftMax: number;
1033
+ /** Maximum scroll top */
1034
+ scrollTopMax: number;
1035
+ /** Horizontal scroll progress (0-1) */
1036
+ progressX: number;
1037
+ /** Vertical scroll progress (0-1) */
1038
+ progressY: number;
1039
+ /** Direction of horizontal scroll (-1: left, 1: right, 0: none) */
1040
+ directionX: -1 | 0 | 1;
1041
+ /** Direction of vertical scroll (-1: up, 1: down, 0: none) */
1042
+ directionY: -1 | 0 | 1;
1043
+ /** Scroll container element or window */
1044
+ container: Element | Window;
1045
+ }
1046
+
1047
+ /**
1048
+ * Scroll directive options
1049
+ */
1050
+ declare interface ScrollOptions_2 {
1051
+ /**
1052
+ * Scroll event handler
1053
+ * @required
1054
+ */
1055
+ handler: ScrollHandler;
1056
+ /**
1057
+ * Whether to disable
1058
+ * @default false
1059
+ */
1060
+ disabled?: boolean;
1061
+ /**
1062
+ * Whether to use passive event listener
1063
+ * @default true
1064
+ */
1065
+ passive?: boolean;
1066
+ /**
1067
+ * Throttle time in milliseconds
1068
+ * @default 0 (no throttle)
1069
+ */
1070
+ throttle?: number;
1071
+ /**
1072
+ * Custom scroll container selector or element
1073
+ */
1074
+ container?: string | Element | Window | null;
1075
+ }
1076
+ export { ScrollOptions_2 as ScrollOptions }
1077
+
1078
+ /**
1079
+ * Set nested property value by path
1080
+ */
1081
+ export declare function set(obj: Record<string, any>, path: string, value: any): void;
1082
+
1083
+ /**
1084
+ * Set Vue version explicitly (for cases where auto-detection fails)
1085
+ */
1086
+ export declare function setVueVersion(version: VueVersion): void;
1087
+
1088
+ export declare type StickyBinding = boolean | number | StickyOptions;
1089
+
1090
+ /**
1091
+ * Sticky directive options
1092
+ */
1093
+ export declare interface StickyOptions {
1094
+ /** Top offset when sticky @default 0 */
1095
+ top?: number | string;
1096
+ /** Bottom offset when sticky */
1097
+ bottom?: number | string;
1098
+ /** Z-index when sticky @default 100 */
1099
+ zIndex?: number;
1100
+ /** CSS class to add when sticky @default 'v-sticky--fixed' */
1101
+ stickyClass?: string;
1102
+ /** Whether to disable @default false */
1103
+ disabled?: boolean;
1104
+ /** Callback when sticky state changes */
1105
+ onChange?: (isSticky: boolean) => void;
1106
+ /** Custom scroll container */
1107
+ container?: string | Element | null;
1108
+ }
1109
+
1110
+ /**
1111
+ * Check if Clipboard API is supported
1112
+ */
1113
+ export declare const supportsClipboard: () => boolean;
1114
+
1115
+ /**
1116
+ * Check if IntersectionObserver is supported
1117
+ */
1118
+ export declare const supportsIntersectionObserver: () => boolean;
1119
+
1120
+ /**
1121
+ * Check if MutationObserver is supported
1122
+ */
1123
+ export declare const supportsMutationObserver: () => boolean;
1124
+
1125
+ /**
1126
+ * Check if passive event listening is supported
1127
+ */
1128
+ export declare const supportsPassive: () => boolean;
1129
+
1130
+ /**
1131
+ * Check if ResizeObserver is supported
1132
+ */
1133
+ export declare const supportsResizeObserver: () => boolean;
1134
+
1135
+ /**
1136
+ * Directive binding value type
1137
+ */
1138
+ export declare type ThrottleBinding<T extends (...args: any[]) => any = any> = T | ThrottleOptions<T>;
1139
+
1140
+ /**
1141
+ * Throttled function type
1142
+ */
1143
+ export declare interface ThrottledFunction<T extends (...args: any[]) => any> {
1144
+ (...args: Parameters<T>): void;
1145
+ cancel: () => void;
1146
+ }
1147
+
1148
+ /**
1149
+ * Throttle function
1150
+ */
1151
+ export declare function throttleFn<T extends (...args: any[]) => any>(func: T, wait?: number, options?: {
1152
+ leading?: boolean;
1153
+ trailing?: boolean;
1154
+ }): ((...args: Parameters<T>) => void) & {
1155
+ cancel: () => void;
1156
+ };
1157
+
1158
+ /**
1159
+ * Throttle directive options
1160
+ */
1161
+ export declare interface ThrottleOptions<T extends (...args: any[]) => any = any> {
1162
+ /**
1163
+ * Function to throttle
1164
+ */
1165
+ handler: T;
1166
+ /**
1167
+ * Delay time in milliseconds
1168
+ * @default 300
1169
+ */
1170
+ wait?: number;
1171
+ /**
1172
+ * Whether to invoke immediately before delay starts
1173
+ * @default true
1174
+ */
1175
+ leading?: boolean;
1176
+ /**
1177
+ * Whether to invoke after delay ends
1178
+ * @default true
1179
+ */
1180
+ trailing?: boolean;
1181
+ }
1182
+
1183
+ /**
1184
+ * v-click-outside directive
1185
+ *
1186
+ * @example
1187
+ * ```vue
1188
+ * <template>
1189
+ * <div v-click-outside="handleClickOutside">
1190
+ * Dropdown menu
1191
+ * </div>
1192
+ * </template>
1193
+ * ```
1194
+ */
1195
+ declare const vClickOutside: Directive;
1196
+ export { vClickOutside as clickOutside }
1197
+ export { vClickOutside }
1198
+
1199
+ /**
1200
+ * v-copy directive
1201
+ *
1202
+ * @example
1203
+ * ```vue
1204
+ * <template>
1205
+ * <button v-copy="textToCopy">Copy Text</button>
1206
+ * </template>
1207
+ * ```
1208
+ */
1209
+ declare const vCopy: Directive;
1210
+ export { vCopy as copy }
1211
+ export { vCopy }
1212
+
1213
+ /**
1214
+ * v-debounce directive
1215
+ *
1216
+ * @example
1217
+ * ```vue
1218
+ * <template>
1219
+ * <input v-debounce="handleInput" />
1220
+ * <input v-debounce:500ms="handleInput" />
1221
+ * <input v-debounce="{ handler: handleInput, wait: 500 }" />
1222
+ * <div v-debounce.scroll="handleScroll">Scroll Debounce</div>
1223
+ * <div v-debounce:100.scroll="handleScroll">100ms Scroll Debounce</div>
1224
+ * </template>
1225
+ * ```
1226
+ */
1227
+ declare const vDebounce: Directive;
1228
+ export { vDebounce as debounce }
1229
+ export { vDebounce }
1230
+
1231
+ /**
1232
+ * v-focus directive
1233
+ *
1234
+ * @example
1235
+ * ```vue
1236
+ * <template>
1237
+ * <input v-focus />
1238
+ * <input v-focus="{ focus: true, refocus: true }" />
1239
+ * </template>
1240
+ * ```
1241
+ */
1242
+ declare const vFocus: Directive;
1243
+ export { vFocus as focus }
1244
+ export { vFocus }
1245
+
1246
+ /**
1247
+ * v-hover directive
1248
+ *
1249
+ * @example
1250
+ * ```vue
1251
+ * <template>
1252
+ * <div v-hover="handleHover">Hover me</div>
1253
+ * <div v-hover="{ onEnter: handleEnter, onLeave: handleLeave, class: 'is-hovering' }">Hover me</div>
1254
+ * </template>
1255
+ * ```
1256
+ */
1257
+ declare const vHover: Directive;
1258
+ export { vHover as hover }
1259
+ export { vHover }
1260
+
1261
+ /**
1262
+ * v-infinite-scroll directive
1263
+ *
1264
+ * @example
1265
+ * ```vue
1266
+ * <template>
1267
+ * <div v-infinite-scroll="loadMore" class="scroll-container">
1268
+ * <div v-for="item in items" :key="item.id">{{ item.name }}</div>
1269
+ * </div>
1270
+ *
1271
+ * <div v-infinite-scroll="{ handler: loadMore, distance: 100, disabled: isLoading }">
1272
+ * <div v-for="item in items" :key="item.id">{{ item.name }}</div>
1273
+ * </div>
1274
+ * </template>
1275
+ * ```
1276
+ */
1277
+ declare const vInfiniteScroll: Directive;
1278
+ export { vInfiniteScroll as infiniteScroll }
1279
+ export { vInfiniteScroll }
1280
+
1281
+ /**
1282
+ * v-intersect directive
1283
+ *
1284
+ * @example
1285
+ * ```vue
1286
+ * <div v-intersect="handleIntersect">Observe me</div>
1287
+ * <div v-intersect="{ onEnter: handleEnter, onLeave: handleLeave }">Track visibility</div>
1288
+ * <div v-intersect="{ threshold: 0.5, once: true }">Trigger once at 50%</div>
1289
+ * ```
1290
+ */
1291
+ declare const vIntersect: Directive;
1292
+ export { vIntersect as intersect }
1293
+ export { vIntersect }
1294
+
1295
+ /**
1296
+ * Directive binding value type
1297
+ */
1298
+ export declare type VisibleBinding = boolean | VisibleOptions;
1299
+
1300
+ /**
1301
+ * Visible change handler
1302
+ */
1303
+ export declare type VisibleHandler = (isVisible: boolean) => void;
1304
+
1305
+ /**
1306
+ * Visible directive options
1307
+ */
1308
+ export declare interface VisibleOptions {
1309
+ /**
1310
+ * Callback when visibility changes
1311
+ */
1312
+ handler?: VisibleHandler;
1313
+ /**
1314
+ * Whether to disable
1315
+ * @default false
1316
+ */
1317
+ disabled?: boolean;
1318
+ /**
1319
+ * Whether to set visibility: hidden instead of display: none
1320
+ * @default false
1321
+ */
1322
+ useHidden?: boolean;
1323
+ /**
1324
+ * Initial visibility
1325
+ * @default true
1326
+ */
1327
+ initial?: boolean;
1328
+ }
1329
+
1330
+ /**
1331
+ * v-lazy directive
1332
+ *
1333
+ * @example
1334
+ * ```vue
1335
+ * <template>
1336
+ * <img v-lazy="imageUrl" />
1337
+ * <img v-lazy="{ src: imageUrl, placeholder: 'placeholder.jpg' }" />
1338
+ * <div v-lazy="backgroundImageUrl"></div>
1339
+ * </template>
1340
+ * ```
1341
+ */
1342
+ declare const vLazy: Directive;
1343
+ export { vLazy as lazy }
1344
+ export { vLazy }
1345
+
1346
+ /**
1347
+ * v-loading directive
1348
+ *
1349
+ * @example
1350
+ * ```vue
1351
+ * <template>
1352
+ * <div v-loading="isLoading">Content</div>
1353
+ * <div v-loading="{ value: isLoading, text: 'Loading...' }">Content</div>
1354
+ * <div v-loading="{ value: isLoading, lock: true }">Locked scroll while loading</div>
1355
+ * </template>
1356
+ * ```
1357
+ */
1358
+ declare const vLoading: Directive;
1359
+ export { vLoading as loading }
1360
+ export { vLoading }
1361
+
1362
+ /**
1363
+ * v-long-press directive
1364
+ *
1365
+ * @example
1366
+ * ```vue
1367
+ * <template>
1368
+ * <button v-long-press="handleLongPress">Long Press Me</button>
1369
+ * <button v-long-press="{ handler: handleLongPress, duration: 1000 }">1 Second Press</button>
1370
+ * </template>
1371
+ * ```
1372
+ */
1373
+ declare const vLongPress: Directive;
1374
+ export { vLongPress as longPress }
1375
+ export { vLongPress }
1376
+
1377
+ /**
1378
+ * v-mask directive
1379
+ *
1380
+ * @example
1381
+ * ```vue
1382
+ * <input v-mask="'###-##-####'" placeholder="SSN" />
1383
+ * <input v-mask="'(###) ###-####'" placeholder="Phone" />
1384
+ * <input v-mask="{ mask: '##/##/####' }" placeholder="Date" />
1385
+ * ```
1386
+ */
1387
+ declare const vMask: Directive;
1388
+ export { vMask as mask }
1389
+ export { vMask }
1390
+
1391
+ /**
1392
+ * v-mutation directive
1393
+ *
1394
+ * @example
1395
+ * ```vue
1396
+ * <template>
1397
+ * <div v-mutation="handleMutation">Observe my changes</div>
1398
+ * <div v-mutation="{ handler: handleMutation, attributes: true, subtree: true }">
1399
+ * Observe attributes and subtree
1400
+ * </div>
1401
+ * </template>
1402
+ *
1403
+ * <script setup>
1404
+ * function handleMutation(mutations: MutationRecord[], observer: MutationObserver) {
1405
+ * mutations.forEach(mutation => {
1406
+ * console.log('Type:', mutation.type)
1407
+ * console.log('Target:', mutation.target)
1408
+ * })
1409
+ * }
1410
+ * </script>
1411
+ * ```
1412
+ */
1413
+ declare const vMutation: Directive;
1414
+ export { vMutation as mutation }
1415
+ export { vMutation }
1416
+
1417
+ /**
1418
+ * v-permission directive
1419
+ *
1420
+ * Controls element visibility and state based on user permissions.
1421
+ * Supports role-based and permission-based access control with wildcard support.
1422
+ *
1423
+ * @example
1424
+ * ```vue
1425
+ * <template>
1426
+ * <button v-permission="'admin'">Admin Only</button>
1427
+ * <button v-permission="['admin', 'editor']">Admin or Editor</button>
1428
+ * <button v-permission="{ value: ['read', 'write'], mode: 'every' }">Read & Write</button>
1429
+ * <button v-permission="{ value: 'admin', action: 'disable' }">Disabled for non-admin</button>
1430
+ * </template>
1431
+ *
1432
+ * <script setup>
1433
+ * import { configurePermission } from 'directix'
1434
+ *
1435
+ * configurePermission({
1436
+ * getPermissions: () => store.getters.permissions,
1437
+ * getRoles: () => store.getters.roles,
1438
+ * roleMap: { admin: ['*'], editor: ['read', 'write'] }
1439
+ * })
1440
+ * </script>
1441
+ * ```
1442
+ */
1443
+ declare const vPermission: Directive;
1444
+ export { vPermission as permission }
1445
+ export { vPermission }
1446
+
1447
+ /**
1448
+ * v-resize directive
1449
+ *
1450
+ * @example
1451
+ * ```vue
1452
+ * <template>
1453
+ * <div v-resize="handleResize">Resize me</div>
1454
+ * <div v-resize="{ handler: handleResize, debounce: 200 }">Debounced resize</div>
1455
+ * </template>
1456
+ * ```
1457
+ */
1458
+ declare const vResize: Directive;
1459
+ export { vResize as resize }
1460
+ export { vResize }
1461
+
1462
+ /**
1463
+ * v-ripple directive
1464
+ *
1465
+ * @example
1466
+ * ```vue
1467
+ * <template>
1468
+ * <button v-ripple>Click me</button>
1469
+ * <button v-ripple="'rgba(255, 255, 255, 0.3)'">Custom color</button>
1470
+ * <button v-ripple="{ color: 'red', duration: 800 }">Custom options</button>
1471
+ * </template>
1472
+ * ```
1473
+ */
1474
+ declare const vRipple: Directive;
1475
+ export { vRipple as ripple }
1476
+ export { vRipple }
1477
+
1478
+ /**
1479
+ * v-sanitize directive
1480
+ *
1481
+ * @example
1482
+ * ```vue
1483
+ * <template>
1484
+ * <div v-sanitize v-html="userContent"></div>
1485
+ * <div v-sanitize="{ allowedTags: ['b', 'i', 'p'] }" v-html="userContent"></div>
1486
+ * <div v-sanitize="{ handler: customSanitizer }" v-html="userContent"></div>
1487
+ * </template>
1488
+ * ```
1489
+ */
1490
+ declare const vSanitize: Directive;
1491
+ export { vSanitize as sanitize }
1492
+ export { vSanitize }
1493
+
1494
+ /**
1495
+ * v-scroll directive
1496
+ *
1497
+ * @example
1498
+ * ```vue
1499
+ * <template>
1500
+ * <div v-scroll="handleScroll">Scroll container</div>
1501
+ * <div v-scroll="{ handler: handleScroll, throttle: 100 }">Throttled scroll</div>
1502
+ * </template>
1503
+ * ```
1504
+ */
1505
+ declare const vScroll: Directive;
1506
+ export { vScroll as scroll }
1507
+ export { vScroll }
1508
+
1509
+ /**
1510
+ * v-sticky directive
1511
+ *
1512
+ * @example
1513
+ * ```vue
1514
+ * <div v-sticky>Sticky header</div>
1515
+ * <div v-sticky="50">Sticky with 50px top offset</div>
1516
+ * <div v-sticky="{ top: 60, zIndex: 1000 }">Custom sticky</div>
1517
+ * ```
1518
+ */
1519
+ declare const vSticky: Directive;
1520
+ export { vSticky as sticky }
1521
+ export { vSticky }
1522
+
1523
+ /**
1524
+ * v-throttle directive
1525
+ *
1526
+ * @example
1527
+ * ```vue
1528
+ * <template>
1529
+ * <button v-throttle="handleClick">Throttled Button</button>
1530
+ * <button v-throttle:1s="handleClick">1s Throttled</button>
1531
+ * <div v-throttle.scroll="handleScroll">Scroll Throttle</div>
1532
+ * <div v-throttle:100.scroll="handleScroll">100ms Scroll Throttle</div>
1533
+ * </template>
1534
+ * ```
1535
+ */
1536
+ declare const vThrottle: Directive;
1537
+ export { vThrottle as throttle }
1538
+ export { vThrottle }
1539
+
1540
+ /**
1541
+ * Vue 2 directive hooks
549
1542
  */
550
1543
  export declare interface Vue2DirectiveHooks {
551
1544
  bind?: (el: any, binding: any, vnode: any, oldVnode: any) => void;
@@ -556,7 +1549,7 @@ export declare interface Vue2DirectiveHooks {
556
1549
  }
557
1550
 
558
1551
  /**
559
- * Vue 3 指令钩子
1552
+ * Vue 3 directive hooks
560
1553
  */
561
1554
  export declare interface Vue3DirectiveHooks {
562
1555
  created?: (el: any, binding: any, vnode: any, prevVnode: any) => void;
@@ -568,4 +1561,28 @@ export declare interface Vue3DirectiveHooks {
568
1561
  unmounted?: (el: any, binding: any, vnode: any, prevVnode: any) => void;
569
1562
  }
570
1563
 
1564
+ /**
1565
+ * Vue version type
1566
+ * - 2: Vue 2.6.x (requires @vue/composition-api for Composition API)
1567
+ * - 2.7: Vue 2.7.x (has built-in Composition API support)
1568
+ * - 3: Vue 3.x
1569
+ */
1570
+ export declare type VueVersion = 2 | 2.7 | 3;
1571
+
1572
+ /**
1573
+ * v-visible directive
1574
+ *
1575
+ * @example
1576
+ * ```vue
1577
+ * <template>
1578
+ * <div v-visible="showElement">Show/Hide</div>
1579
+ * <div v-visible="{ handler: onVisibleChange }">Track visibility</div>
1580
+ * <div v-visible="{ useHidden: true, initial: false }">Uses visibility: hidden</div>
1581
+ * </template>
1582
+ * ```
1583
+ */
1584
+ declare const vVisible: Directive;
1585
+ export { vVisible }
1586
+ export { vVisible as visible }
1587
+
571
1588
  export { }