directix 1.7.0 → 1.9.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
@@ -1,3 +1,4 @@
1
+ import { App } from 'vue';
1
2
  import { ComponentPublicInstance } from 'vue';
2
3
  import { Directive } from 'vue';
3
4
  import { Plugin as Plugin_2 } from 'vue';
@@ -14,6 +15,33 @@ export declare function addCleanupVue2(el: Element, fn: () => void): void;
14
15
  */
15
16
  export declare function addCleanupVue3(el: Element, fn: () => void): void;
16
17
 
18
+ /**
19
+ * Assert a condition and throw an error if false
20
+ */
21
+ declare function assert_2(condition: boolean, message: string, directive?: string): asserts condition;
22
+ export { assert_2 as assert }
23
+
24
+ /**
25
+ * Assert a number is positive
26
+ */
27
+ export declare function assertPositive(value: number, directive: string, param: string): void;
28
+
29
+ /**
30
+ * Assert a number is within range
31
+ */
32
+ export declare function assertRange(value: number, min: number, max: number, directive: string, param: string): void;
33
+
34
+ /**
35
+ * Assert a parameter type
36
+ */
37
+ declare function assertType_2<T>(value: unknown, type: 'string' | 'number' | 'boolean' | 'object' | 'function' | 'symbol' | 'bigint' | 'undefined', directive: string, param: string): asserts value is T;
38
+ export { assertType_2 as assertType }
39
+
40
+ /**
41
+ * Calculate statistics from metrics
42
+ */
43
+ export declare function calculateStats(metrics: PerformanceMetric[]): PerformanceStats;
44
+
17
45
  /**
18
46
  * Calculate remaining time
19
47
  */
@@ -32,6 +60,16 @@ export declare function capitalizeText(text: string, options?: {
32
60
  */
33
61
  export declare function capitalizeWord(word: string): string;
34
62
 
63
+ /**
64
+ * Clear DevTools state
65
+ */
66
+ export declare function clearDevtoolsState(): void;
67
+
68
+ /**
69
+ * Clear all performance metrics
70
+ */
71
+ export declare function clearPerformanceMetrics(): void;
72
+
35
73
  /**
36
74
  * Click delay handler
37
75
  */
@@ -78,6 +116,11 @@ export declare interface ComposableThrottledFunction<T extends (...args: any[])
78
116
  cancel: () => void;
79
117
  }
80
118
 
119
+ /**
120
+ * Configure performance monitoring
121
+ */
122
+ export declare function configurePerformance(config: Partial<PerformanceConfig>): void;
123
+
81
124
  /**
82
125
  * Configure permission directive
83
126
  */
@@ -168,6 +211,55 @@ export declare function createCapitalizer(options?: {
168
211
  */
169
212
  export declare function createDelayedClick(handler: ClickDelayHandler, delay?: number): (event: MouseEvent | TouchEvent) => void;
170
213
 
214
+ /**
215
+ * Create a directive from a template
216
+ *
217
+ * @example
218
+ * ```ts
219
+ * const vMyDirective = createDirectiveTemplate({
220
+ * name: 'my-directive',
221
+ * onMount(el, options) {
222
+ * el.style.color = options.color
223
+ * },
224
+ * onUpdate(el, options) {
225
+ * el.style.color = options.color
226
+ * },
227
+ * onUnmount(el) {
228
+ * el.style.color = ''
229
+ * },
230
+ * })
231
+ * ```
232
+ */
233
+ export declare function createDirectiveTemplate<T = any, B extends Element = Element>(template: DirectiveTemplateOptions<T, B>): Directive;
234
+
235
+ /**
236
+ * Create a simple event-based directive template
237
+ *
238
+ * @example
239
+ * ```ts
240
+ * const vTrack = createEventDirective({
241
+ * name: 'track',
242
+ * eventName: 'click',
243
+ * handler(el, binding, event) {
244
+ * analytics.track(binding.value, { element: el.tagName })
245
+ * },
246
+ * })
247
+ * ```
248
+ */
249
+ export declare function createEventDirective(options: {
250
+ name: string;
251
+ eventName: string;
252
+ handler: (el: HTMLElement, binding: any, event: Event) => void;
253
+ /** Options for addEventListener */
254
+ listenerOptions?: boolean | AddEventListenerOptions;
255
+ ssr?: boolean;
256
+ }): Directive;
257
+
258
+ /**
259
+ * Create i18n instance
260
+ */
261
+ export declare function createI18n(options: I18nOptions): I18nInstance;
262
+
171
263
  /**
172
264
  * Create a lowercase transformation function
173
265
  *
@@ -258,6 +350,29 @@ export declare function createPermissionChecker(config: {
258
350
  roleMap?: Record<string, string[]>;
259
351
  }): (value: string | string[], mode?: PermissionMode) => boolean;
260
352
 
353
+ /**
354
+ * Create a style-based directive template
355
+ *
356
+ * @example
357
+ * ```ts
358
+ * const vOpacity = createStyleDirective({
359
+ * name: 'opacity',
360
+ * cssProperty: 'opacity',
361
+ * defaultUnit: '',
362
+ * })
363
+ * ```
364
+ */
365
+ export declare function createStyleDirective(options: {
366
+ name: string;
367
+ /** CSS property name */
368
+ cssProperty: string;
369
+ /** Default unit (e.g., 'px', '%') */
370
+ defaultUnit?: string;
371
+ /** Validate value */
372
+ validate?: (value: any) => boolean;
373
+ ssr?: boolean;
374
+ }): Directive;
375
+
261
376
  /**
262
377
  * Create a trim function with preset options
263
378
  *
@@ -337,6 +452,24 @@ export declare function createWatermarkUrl(content: string | string[], options?:
337
452
  */
338
453
  export declare type CrossVersionDirective = Directive | Vue2DirectiveHooks | Vue3DirectiveHooks;
339
454
 
455
+ /**
456
+ * Date format options per region
457
+ */
458
+ export declare interface DateFormatOptions {
459
+ /** Date format pattern */
460
+ datePattern: string;
461
+ /** Time format pattern */
462
+ timePattern: string;
463
+ /** 12/24 hour format */
464
+ hourCycle: 'h12' | 'h23' | 'h24';
465
+ /** First day of week (0=Sunday, 1=Monday) */
466
+ firstDayOfWeek: number;
467
+ /** Date separator */
468
+ dateSeparator: string;
469
+ /** Time separator */
470
+ timeSeparator: string;
471
+ }
472
+
340
473
  /**
341
474
  * Simple debounce function wrapper
342
475
  *
@@ -363,6 +496,11 @@ export declare function debounceFn<T extends (...args: any[]) => any>(fn: T, wai
363
496
  trailing?: boolean;
364
497
  }): ComposableDebouncedFunction<T>;
365
498
 
499
+ /**
500
+ * Show a debug message (only in development)
501
+ */
502
+ export declare function debug(message: string, params?: Record<string, any>): void;
503
+
366
504
  /**
367
505
  * Deep clone an object
368
506
  */
@@ -389,6 +527,26 @@ export declare function defineDirectiveGroup(name: string, directives: Record<st
389
527
  install: (app: any) => void;
390
528
  };
391
529
 
530
+ /**
531
+ * Define a Directix plugin
532
+ */
533
+ export declare function definePlugin(plugin: DirectixPlugin): DirectixPlugin;
534
+
535
+ /**
536
+ * Detect user locale info
537
+ */
538
+ export declare function detectLocaleInfo(): LocaleInfo;
539
+
540
+ /**
541
+ * DevTools event
542
+ */
543
+ export declare interface DevtoolsEvent {
544
+ type: 'directive:mounted' | 'directive:updated' | 'directive:unmounted' | 'plugin:install' | 'plugin:uninstall';
545
+ name: string;
546
+ timestamp: number;
547
+ data?: any;
548
+ }
549
+
392
550
  /**
393
551
  * Unified directive binding object
394
552
  */
@@ -419,6 +577,23 @@ export declare interface DirectiveDefinition<T = any, B extends Element = Elemen
419
577
  defaults?: Partial<T>;
420
578
  }
421
579
 
580
+ /**
581
+ * Directive-specific error helper
582
+ */
583
+ export declare function directiveError(directive: string, message: string, params?: Record<string, any>): void;
584
+
585
+ /**
586
+ * Directive extension hook
587
+ */
588
+ export declare interface DirectiveExtension {
589
+ /** Target directive name */
590
+ target: string;
591
+ /** Hook to extend */
592
+ hook: 'mounted' | 'updated' | 'unmounted' | 'beforeMount' | 'afterMount';
593
+ /** Extension handler */
594
+ handler: (el: any, binding: any, vnode: any, prevVnode?: any) => void | Promise<void>;
595
+ }
596
+
422
597
  /**
423
598
  * Unified directive hooks
424
599
  */
@@ -448,6 +623,23 @@ export declare interface DirectiveHooks<T = any, B extends Element = Element> {
448
623
  unmounted?: (el: B, binding: DirectiveBinding<T>, vnode: VNode) => void;
449
624
  }
450
625
 
626
+ /**
627
+ * Vue DevTools Integration
628
+ *
629
+ * Provides debugging capabilities for Directix through Vue DevTools.
630
+ * Shows registered directives, plugins, and performance metrics.
631
+ */
632
+ /**
633
+ * Directive info for DevTools
634
+ */
635
+ export declare interface DirectiveInfo {
636
+ name: string;
637
+ element?: string;
638
+ bindings: number;
639
+ lastUpdated: number;
640
+ options?: Record<string, any>;
641
+ }
642
+
451
643
  /**
452
644
  * Directive installation options
453
645
  */
@@ -460,21 +652,155 @@ export declare interface DirectiveInstallOptions {
460
652
  config?: Record<string, any>;
461
653
  }
462
654
 
655
+ /**
656
+ * Per-directive messages
657
+ */
658
+ declare interface DirectiveMessages {
659
+ description: string;
660
+ params?: Record<string, string>;
661
+ errors?: Record<string, string>;
662
+ warnings?: Record<string, string>;
663
+ }
664
+
665
+ /**
666
+ * Directive performance metrics
667
+ */
668
+ export declare interface DirectivePerformance {
669
+ /** Directive name */
670
+ name: string;
671
+ /** Mount stats */
672
+ mount: PerformanceStats;
673
+ /** Update stats */
674
+ update: PerformanceStats;
675
+ /** Unmount stats */
676
+ unmount: PerformanceStats;
677
+ /** Total time spent */
678
+ totalTime: number;
679
+ /** Call count */
680
+ callCount: number;
681
+ }
682
+
683
+ /**
684
+ * Directive template options
685
+ */
686
+ export declare interface DirectiveTemplateOptions<T = any, B extends Element = Element> {
687
+ /** Directive name */
688
+ name: string;
689
+ /** SSR safe */
690
+ ssr?: boolean;
691
+ /** Default options */
692
+ defaults?: Partial<T>;
693
+ /** Called when directive is mounted */
694
+ onMount: (el: B, options: T, binding: any) => void;
695
+ /** Called when directive is updated */
696
+ onUpdate?: (el: B, options: T, binding: any) => void;
697
+ /** Called when directive is unmounted */
698
+ onUnmount: (el: B, state: Record<string, any>) => void;
699
+ /** Validate options */
700
+ validate?: (options: T) => string | null;
701
+ /** Normalize binding value to options */
702
+ normalize?: (binding: any) => T;
703
+ }
704
+
705
+ /**
706
+ * Directive-specific warning helper
707
+ */
708
+ export declare function directiveWarn(directive: string, message: string, params?: Record<string, any>): void;
709
+
463
710
  /**
464
711
  * Directix plugin
465
712
  */
466
713
  export declare const Directix: Plugin_2;
467
714
 
715
+ /**
716
+ * Plugin definition
717
+ */
718
+ export declare interface DirectixPlugin {
719
+ /** Plugin metadata */
720
+ meta: PluginMeta;
721
+ /** Install function - called when plugin is registered */
722
+ install: (ctx: PluginContext) => void | Promise<void>;
723
+ /** Uninstall function - called when plugin is removed */
724
+ uninstall?: (ctx: PluginContext) => void | Promise<void>;
725
+ /** Plugin dependencies */
726
+ dependencies?: string[];
727
+ }
728
+
729
+ /**
730
+ * Disable DevTools integration
731
+ */
732
+ export declare function disableDevtools(): void;
733
+
734
+ /**
735
+ * Disable performance monitoring
736
+ */
737
+ export declare function disablePerformance(): void;
738
+
468
739
  /**
469
740
  * Draggable axis
470
741
  */
471
742
  export declare type DraggableAxis = 'x' | 'y' | 'both';
472
743
 
744
+ /**
745
+ * Enable DevTools integration
746
+ */
747
+ export declare function enableDevtools(): void;
748
+
749
+ /**
750
+ * Enable performance monitoring
751
+ */
752
+ export declare function enablePerformance(): void;
753
+
754
+ /**
755
+ * End a performance measurement
756
+ */
757
+ export declare function endMeasure(markId: string, directive: string, phase: 'mount' | 'update' | 'unmount', metadata?: Record<string, any>): void;
758
+
759
+ export declare const enUS: I18nMessages;
760
+
761
+ /**
762
+ * Show an error message
763
+ */
764
+ export declare function error(options: WarningOptions): void;
765
+
766
+ export declare function error(message: string, params?: Record<string, any>): void;
767
+
768
+ /**
769
+ * Global error messages
770
+ */
771
+ declare interface ErrorMessages {
772
+ invalid_param: string;
773
+ missing_required: string;
774
+ type_error: string;
775
+ value_out_of_range: string;
776
+ not_supported: string;
777
+ ssr_not_supported: string;
778
+ }
779
+
473
780
  /**
474
781
  * Export format type
475
782
  */
476
783
  export declare type ExportFormat = 'csv' | 'json' | 'txt' | 'html';
477
784
 
785
+ /**
786
+ * Export performance metrics as JSON
787
+ */
788
+ export declare function exportPerformanceData(): {
789
+ config: PerformanceConfig;
790
+ metrics: PerformanceMetric[];
791
+ report: DirectivePerformance[];
792
+ };
793
+
794
+ /**
795
+ * Format currency with locale-specific format
796
+ */
797
+ export declare function formatCurrencyLocale(value: number, options?: Partial<NumberFormatOptions>): string;
798
+
799
+ /**
800
+ * Format date with locale-specific pattern
801
+ */
802
+ export declare function formatDateLocale(date: Date | string | number, options?: Partial<DateFormatOptions>): string;
803
+
478
804
  /**
479
805
  * Format number to money string
480
806
  */
@@ -497,6 +823,11 @@ export declare function formatNumber(value: number, options?: {
497
823
  suffix?: string;
498
824
  }): string;
499
825
 
826
+ /**
827
+ * Format number with locale-specific separators
828
+ */
829
+ export declare function formatNumberLocale(value: number, decimals?: number, options?: Partial<NumberFormatOptions>): string;
830
+
500
831
  /**
501
832
  * Format time to string
502
833
  */
@@ -512,11 +843,86 @@ export declare function generateId(prefix?: string): string;
512
843
  */
513
844
  export declare function get<T = any>(obj: Record<string, any>, path: string, defaultValue?: T): T;
514
845
 
846
+ /**
847
+ * Get region-specific date format
848
+ */
849
+ export declare function getDateFormat(region?: string): DateFormatOptions;
850
+
851
+ /**
852
+ * Get DevTools state (for external access)
853
+ */
854
+ export declare function getDevtoolsState(): {
855
+ enabled: boolean;
856
+ directiveCount: number;
857
+ pluginCount: number;
858
+ eventCount: number;
859
+ };
860
+
861
+ /**
862
+ * Get performance metrics for a specific directive
863
+ */
864
+ export declare function getDirectiveMetrics(directive: string): PerformanceMetric[];
865
+
866
+ /**
867
+ * Get current locale
868
+ */
869
+ export declare function getLocale(): string;
870
+
871
+ /**
872
+ * Get locale display name
873
+ */
874
+ export declare function getLocaleDisplayName(locale: string, displayLocale?: string): string;
875
+
876
+ /**
877
+ * Get most frequently called directives
878
+ */
879
+ export declare function getMostFrequentDirectives(limit?: number): DirectivePerformance[];
880
+
881
+ /**
882
+ * Get region-specific number format
883
+ */
884
+ export declare function getNumberFormat(region?: string): NumberFormatOptions;
885
+
886
+ /**
887
+ * Get all performance metrics
888
+ */
889
+ export declare function getPerformanceMetrics(): PerformanceMetric[];
890
+
891
+ /**
892
+ * Get performance report for all directives
893
+ */
894
+ export declare function getPerformanceReport(): DirectivePerformance[];
895
+
515
896
  /**
516
897
  * Get current configuration
517
898
  */
518
899
  export declare function getPermissionConfig(): PermissionConfig | null;
519
900
 
901
+ /**
902
+ * Get or create the global plugin manager
903
+ */
904
+ export declare function getPluginManager(config?: PluginConfig): PluginManager;
905
+
906
+ /**
907
+ * Get or create the global plugin registry
908
+ */
909
+ export declare function getPluginRegistry(registryUrl?: string): PluginRegistry;
910
+
911
+ /**
912
+ * Get slowest directives
913
+ */
914
+ export declare function getSlowestDirectives(limit?: number): DirectivePerformance[];
915
+
916
+ /**
917
+ * Get all supported regions
918
+ */
919
+ export declare function getSupportedRegions(): string[];
920
+
921
+ /**
922
+ * Get timezone info
923
+ */
924
+ export declare function getTimezoneInfo(): TimezoneInfo;
925
+
520
926
  /**
521
927
  * Get current Vue version
522
928
  */
@@ -556,6 +962,44 @@ export declare interface HotkeyDefinition {
556
962
  disabled?: boolean | Ref<boolean>;
557
963
  }
558
964
 
965
+ /**
966
+ * i18n instance type
967
+ */
968
+ export declare interface I18nInstance {
969
+ locale: string;
970
+ fallbackLocale: string;
971
+ messages: I18nMessages;
972
+ setLocale: (locale: string) => void;
973
+ t: (key: string, params?: Record<string, any>) => string;
974
+ }
975
+
976
+ /**
977
+ * i18n type definitions
978
+ */
979
+ /**
980
+ * Locale messages structure
981
+ */
982
+ export declare interface I18nMessages {
983
+ directives: Record<string, DirectiveMessages>;
984
+ errors: ErrorMessages;
985
+ warnings: WarningMessages;
986
+ help: Record<string, string>;
987
+ }
988
+
989
+ /**
990
+ * i18n options
991
+ */
992
+ export declare interface I18nOptions {
993
+ locale?: string;
994
+ fallbackLocale?: string;
995
+ messages: Record<string, I18nMessages>;
996
+ }
997
+
998
+ /**
999
+ * Show an info message
1000
+ */
1001
+ export declare function info(message: string, params?: Record<string, any>): void;
1002
+
559
1003
  /**
560
1004
  * Intersect event handler
561
1005
  */
@@ -576,6 +1020,11 @@ export declare function isBoolean(value: unknown): value is boolean;
576
1020
  */
577
1021
  export declare const isBrowser: () => boolean;
578
1022
 
1023
+ /**
1024
+ * Check if DevTools is available
1025
+ */
1026
+ export declare function isDevtoolsAvailable(): boolean;
1027
+
579
1028
  /**
580
1029
  * Check if value is empty
581
1030
  */
@@ -596,6 +1045,11 @@ export declare function isNumber(value: unknown): value is number;
596
1045
  */
597
1046
  export declare function isObject(value: unknown): value is Record<string, any>;
598
1047
 
1048
+ /**
1049
+ * Check if performance monitoring is enabled
1050
+ */
1051
+ export declare function isPerformanceEnabled(): boolean;
1052
+
599
1053
  /**
600
1054
  * Check if value is a Promise
601
1055
  */
@@ -631,11 +1085,42 @@ export declare function isVue3(): boolean;
631
1085
  */
632
1086
  export declare type ItemSizeFunction = (index: number) => number;
633
1087
 
1088
+ export declare const jaJP: I18nMessages;
1089
+
634
1090
  /**
635
1091
  * Lazy loading state
636
1092
  */
637
1093
  export declare type LazyState = 'pending' | 'loading' | 'loaded' | 'error';
638
1094
 
1095
+ /**
1096
+ * Locale info
1097
+ */
1098
+ export declare interface LocaleInfo {
1099
+ /** Locale code (e.g., 'zh-CN') */
1100
+ locale: string;
1101
+ /** Language code (e.g., 'zh') */
1102
+ language: string;
1103
+ /** Region/country code (e.g., 'CN') */
1104
+ region: string | null;
1105
+ /** Script code (e.g., 'Hant') */
1106
+ script: string | null;
1107
+ /** Browser detected locale */
1108
+ browserLocale: string;
1109
+ /** System timezone */
1110
+ timezone: string;
1111
+ }
1112
+
1113
+ /**
1114
+ * Unified warning/error system for Directix directives
1115
+ *
1116
+ * Provides structured, localized error messages with:
1117
+ * - Directive name context
1118
+ * - Parameter validation messages
1119
+ * - Stack trace in development mode
1120
+ * - Warning levels (debug, info, warn, error)
1121
+ */
1122
+ declare type LogLevel = 'debug' | 'info' | 'warn' | 'error';
1123
+
639
1124
  /**
640
1125
  * Lottie animation state
641
1126
  */
@@ -646,11 +1131,38 @@ export declare type LottieAnimationState = 'playing' | 'paused' | 'stopped';
646
1131
  */
647
1132
  export declare function lowercaseText(text: string, firstOnly?: boolean): string;
648
1133
 
1134
+ /**
1135
+ * Performance measurement helper
1136
+ * Use this to wrap directive lifecycle methods
1137
+ */
1138
+ export declare function measurePerformance<T>(directive: string, phase: 'mount' | 'update' | 'unmount', fn: () => T, metadata?: Record<string, any>): T;
1139
+
1140
+ /**
1141
+ * Async performance measurement helper
1142
+ */
1143
+ export declare function measurePerformanceAsync<T>(directive: string, phase: 'mount' | 'update' | 'unmount', fn: () => Promise<T>, metadata?: Record<string, any>): Promise<T>;
1144
+
649
1145
  /**
650
1146
  * Mutation change handler
651
1147
  */
652
1148
  export declare type MutationHandler = (mutations: MutationRecord[], observer: MutationObserver) => void;
653
1149
 
1150
+ /**
1151
+ * Number format options per region
1152
+ */
1153
+ export declare interface NumberFormatOptions {
1154
+ /** Decimal separator */
1155
+ decimalSeparator: string;
1156
+ /** Thousands separator */
1157
+ thousandsSeparator: string;
1158
+ /** Currency symbol */
1159
+ currencySymbol: string;
1160
+ /** Currency position ('before' or 'after') */
1161
+ currencyPosition: 'before' | 'after';
1162
+ /** Decimal places for currency */
1163
+ currencyDecimals: number;
1164
+ }
1165
+
654
1166
  /**
655
1167
  * Pan gesture event data
656
1168
  */
@@ -669,6 +1181,15 @@ export declare interface PanEvent {
669
1181
  velocity: number;
670
1182
  }
671
1183
 
1184
+ /**
1185
+ * Parse locale string into components
1186
+ */
1187
+ export declare function parseLocale(locale: string): {
1188
+ language: string;
1189
+ region: string | null;
1190
+ script: string | null;
1191
+ };
1192
+
672
1193
  /**
673
1194
  * Parse formatted money string to number
674
1195
  */
@@ -697,6 +1218,61 @@ export declare function parseTargetTime(target: Date | number | string): number;
697
1218
  */
698
1219
  export declare function parseTime(arg?: string): number | null;
699
1220
 
1221
+ /**
1222
+ * Performance configuration
1223
+ */
1224
+ export declare interface PerformanceConfig {
1225
+ /** Enable performance monitoring */
1226
+ enabled: boolean;
1227
+ /** Maximum metrics to store */
1228
+ maxMetrics: number;
1229
+ /** Sample rate (0-1) */
1230
+ sampleRate: number;
1231
+ /** Warn threshold in ms */
1232
+ warnThreshold: number;
1233
+ }
1234
+
1235
+ /**
1236
+ * Performance Monitoring
1237
+ *
1238
+ * Provides performance metrics and monitoring for Directix directives.
1239
+ */
1240
+ /**
1241
+ * Performance metric types
1242
+ */
1243
+ export declare interface PerformanceMetric {
1244
+ /** Metric name */
1245
+ name: string;
1246
+ /** Directive name */
1247
+ directive: string;
1248
+ /** Duration in milliseconds */
1249
+ duration: number;
1250
+ /** Timestamp */
1251
+ timestamp: number;
1252
+ /** Additional metadata */
1253
+ metadata?: Record<string, any>;
1254
+ }
1255
+
1256
+ /**
1257
+ * Performance statistics
1258
+ */
1259
+ export declare interface PerformanceStats {
1260
+ /** Total calls */
1261
+ totalCalls: number;
1262
+ /** Average duration */
1263
+ averageDuration: number;
1264
+ /** Min duration */
1265
+ minDuration: number;
1266
+ /** Max duration */
1267
+ maxDuration: number;
1268
+ /** P50 (median) */
1269
+ p50: number;
1270
+ /** P95 */
1271
+ p95: number;
1272
+ /** P99 */
1273
+ p99: number;
1274
+ }
1275
+
700
1276
  /**
701
1277
  * Permission configuration
702
1278
  */
@@ -728,6 +1304,250 @@ export declare interface PinchEvent {
728
1304
  isFinal: boolean;
729
1305
  }
730
1306
 
1307
+ /**
1308
+ * Plugin category
1309
+ */
1310
+ export declare type PluginCategory = 'event' | 'visibility' | 'scroll' | 'form' | 'ui' | 'security' | 'observer' | 'gesture' | 'other';
1311
+
1312
+ /**
1313
+ * Plugin configuration
1314
+ */
1315
+ export declare interface PluginConfig {
1316
+ /** Enable debug mode */
1317
+ debug?: boolean;
1318
+ /** Plugin registry URL */
1319
+ registryUrl?: string;
1320
+ /** Auto-load official plugins */
1321
+ autoLoadOfficial?: boolean;
1322
+ }
1323
+
1324
+ /**
1325
+ * Plugin context - provides utilities for plugins
1326
+ */
1327
+ export declare interface PluginContext {
1328
+ /** Vue app instance */
1329
+ app: App;
1330
+ /** Register a directive */
1331
+ registerDirective: (name: string, directive: Directive) => void;
1332
+ /** Register a composable */
1333
+ registerComposable: (name: string, composable: any) => void;
1334
+ /** Get an existing directive */
1335
+ getDirective: (name: string) => Directive | undefined;
1336
+ /** Show a warning */
1337
+ warn: (message: string) => void;
1338
+ /** Show an error */
1339
+ error: (message: string) => void;
1340
+ /** Plugin metadata */
1341
+ meta: PluginMeta;
1342
+ }
1343
+
1344
+ /**
1345
+ * Plugin hook types
1346
+ */
1347
+ export declare type PluginHook = 'beforeInstall' | 'afterInstall' | 'beforeUninstall' | 'afterUninstall';
1348
+
1349
+ /**
1350
+ * Plugin hook callback
1351
+ */
1352
+ export declare type PluginHookCallback = (plugin: DirectixPlugin, ctx: PluginContext) => void | Promise<void>;
1353
+
1354
+ /**
1355
+ * Plugin info for DevTools
1356
+ */
1357
+ export declare interface PluginInfo {
1358
+ name: string;
1359
+ version: string;
1360
+ description?: string;
1361
+ enabled: boolean;
1362
+ registeredAt: number;
1363
+ }
1364
+
1365
+ /**
1366
+ * Plugin manager class
1367
+ */
1368
+ export declare class PluginManager {
1369
+ private plugins;
1370
+ private hooks;
1371
+ private directives;
1372
+ private composables;
1373
+ private extensions;
1374
+ private app;
1375
+ private config;
1376
+ constructor(config?: PluginConfig);
1377
+ /**
1378
+ * Get the plugin registry instance
1379
+ */
1380
+ getRegistry(): PluginRegistry;
1381
+ /**
1382
+ * Set the Vue app instance
1383
+ */
1384
+ setApp(app: App): void;
1385
+ /**
1386
+ * Register a plugin
1387
+ */
1388
+ register(plugin: DirectixPlugin): Promise<void>;
1389
+ /**
1390
+ * Unregister a plugin
1391
+ */
1392
+ unregister(name: string): Promise<void>;
1393
+ /**
1394
+ * Check if a plugin is registered
1395
+ */
1396
+ has(name: string): boolean;
1397
+ /**
1398
+ * Get a registered plugin
1399
+ */
1400
+ get(name: string): DirectixPlugin | undefined;
1401
+ /**
1402
+ * Get all registered plugins
1403
+ */
1404
+ getAll(): DirectixPlugin[];
1405
+ /**
1406
+ * Register a hook
1407
+ */
1408
+ onHook(hook: PluginHook, callback: PluginHookCallback): void;
1409
+ /**
1410
+ * Remove a hook
1411
+ */
1412
+ offHook(hook: PluginHook, callback: PluginHookCallback): void;
1413
+ /**
1414
+ * Register a directive extension
1415
+ */
1416
+ extendDirective(extension: DirectiveExtension): void;
1417
+ /**
1418
+ * Get extensions for a directive
1419
+ */
1420
+ getExtensions(directiveName: string): DirectiveExtension[];
1421
+ /**
1422
+ * Get a registered directive
1423
+ */
1424
+ getDirective(name: string): Directive | undefined;
1425
+ /**
1426
+ * Get a registered composable
1427
+ */
1428
+ getComposable(name: string): any;
1429
+ /**
1430
+ * Create plugin context
1431
+ */
1432
+ private createContext;
1433
+ /**
1434
+ * Fire hooks
1435
+ */
1436
+ private fireHooks;
1437
+ }
1438
+
1439
+ /**
1440
+ * Plugin metadata
1441
+ */
1442
+ export declare interface PluginMeta {
1443
+ /** Plugin name */
1444
+ name: string;
1445
+ /** Plugin version */
1446
+ version: string;
1447
+ /** Plugin description */
1448
+ description?: string;
1449
+ /** Author name */
1450
+ author?: string;
1451
+ /** License */
1452
+ license?: string;
1453
+ /** Repository URL */
1454
+ repository?: string;
1455
+ /** Keywords for discovery */
1456
+ keywords?: string[];
1457
+ }
1458
+
1459
+ /**
1460
+ * Plugin registry class
1461
+ */
1462
+ export declare class PluginRegistry {
1463
+ private registryUrl;
1464
+ private cache;
1465
+ private cacheTime;
1466
+ private cacheTTL;
1467
+ constructor(registryUrl?: string);
1468
+ /**
1469
+ * Fetch plugin registry data
1470
+ */
1471
+ private fetchData;
1472
+ /**
1473
+ * Set registry data directly (useful for testing or local development)
1474
+ */
1475
+ setData(data: PluginRegistryData): void;
1476
+ /**
1477
+ * Get all plugins from the registry
1478
+ */
1479
+ getAll(): Promise<PluginRegistryEntry[]>;
1480
+ /**
1481
+ * Get a plugin by name
1482
+ */
1483
+ getByName(name: string): Promise<PluginRegistryEntry | undefined>;
1484
+ /**
1485
+ * Search plugins by query
1486
+ */
1487
+ search(query: string): Promise<PluginRegistryEntry[]>;
1488
+ /**
1489
+ * Get plugins by category
1490
+ */
1491
+ getByCategory(category: PluginCategory): Promise<PluginRegistryEntry[]>;
1492
+ /**
1493
+ * Get registry metadata
1494
+ */
1495
+ getMeta(): Promise<{
1496
+ version: number;
1497
+ updated: string;
1498
+ count: number;
1499
+ }>;
1500
+ /**
1501
+ * Install a plugin from the registry
1502
+ *
1503
+ * Note: This is a helper for programmatic installation.
1504
+ * For production use, install the package with your package manager first.
1505
+ */
1506
+ install(name: string, manager: PluginManager): Promise<void>;
1507
+ }
1508
+
1509
+ /**
1510
+ * Plugin registry data structure
1511
+ */
1512
+ export declare interface PluginRegistryData {
1513
+ /** Registry version */
1514
+ version: number;
1515
+ /** Last updated date */
1516
+ updated: string;
1517
+ /** Plugin list */
1518
+ plugins: PluginRegistryEntry[];
1519
+ }
1520
+
1521
+ /**
1522
+ * Plugin registry entry
1523
+ */
1524
+ export declare interface PluginRegistryEntry {
1525
+ /** Plugin name */
1526
+ name: string;
1527
+ /** Plugin version */
1528
+ version: string;
1529
+ /** Plugin description */
1530
+ description: string;
1531
+ /** NPM package name */
1532
+ package: string;
1533
+ /** Author */
1534
+ author: string;
1535
+ /** Keywords */
1536
+ keywords: string[];
1537
+ /** Category */
1538
+ category?: PluginCategory;
1539
+ /** Download count */
1540
+ downloads?: number;
1541
+ /** GitHub stars */
1542
+ stars?: number;
1543
+ /** Repository URL */
1544
+ repository?: string;
1545
+ /** Homepage URL */
1546
+ homepage?: string;
1547
+ /** License */
1548
+ license?: string;
1549
+ }
1550
+
731
1551
  /**
732
1552
  * Position type
733
1553
  */
@@ -776,6 +1596,16 @@ export declare type PullRefreshState = 'idle' | 'pulling' | 'ready' | 'loading'
776
1596
  */
777
1597
  export declare function quickPrint(target: string | HTMLElement, options?: UsePrintOptions): Promise<void>;
778
1598
 
1599
+ /**
1600
+ * Reset the global plugin manager
1601
+ */
1602
+ export declare function resetPluginManager(): void;
1603
+
1604
+ /**
1605
+ * Reset the global plugin registry
1606
+ */
1607
+ export declare function resetPluginRegistry(): void;
1608
+
779
1609
  /**
780
1610
  * Reset Vue version (useful for testing)
781
1611
  */
@@ -839,16 +1669,41 @@ export declare interface ScrollInfo {
839
1669
  */
840
1670
  export declare function set(obj: Record<string, any>, path: string, value: any): void;
841
1671
 
1672
+ /**
1673
+ * Set current locale
1674
+ */
1675
+ export declare function setLocale(locale: string): void;
1676
+
842
1677
  /**
843
1678
  * Set Vue version explicitly (for cases where auto-detection fails)
844
1679
  */
845
1680
  export declare function setVueVersion(version: VueVersion): void;
846
1681
 
1682
+ /**
1683
+ * Set development mode
1684
+ */
1685
+ export declare function setWarningDevMode(dev: boolean): void;
1686
+
1687
+ /**
1688
+ * Set i18n translation function
1689
+ */
1690
+ export declare function setWarningI18n(t: (key: string, params?: Record<string, any>) => string): void;
1691
+
1692
+ /**
1693
+ * Set global log level
1694
+ */
1695
+ export declare function setWarningLevel(level: LogLevel): void;
1696
+
847
1697
  /**
848
1698
  * Skeleton animation type
849
1699
  */
850
1700
  export declare type SkeletonAnimation = 'wave' | 'pulse' | 'none';
851
1701
 
1702
+ /**
1703
+ * Start a performance measurement
1704
+ */
1705
+ export declare function startMeasure(directive: string, phase: 'mount' | 'update' | 'unmount'): string;
1706
+
852
1707
  /**
853
1708
  * Check if Clipboard API is supported
854
1709
  */
@@ -884,6 +1739,13 @@ export declare type SwipeDirection = 'left' | 'right' | 'up' | 'down';
884
1739
  */
885
1740
  export declare type SwipeHandler = (direction: SwipeDirection, event: Event) => void;
886
1741
 
1742
+ /**
1743
+ * Translate a message key
1744
+ * @param key - Dot-notation key like 'directives.debounce.invalid_wait'
1745
+ * @param params - Interpolation parameters
1746
+ */
1747
+ export declare function t(key: string, params?: Record<string, any>): string;
1748
+
887
1749
  /**
888
1750
  * Simple throttle function wrapper
889
1751
  *
@@ -910,6 +1772,27 @@ export declare function throttleFn<T extends (...args: any[]) => any>(fn: T, wai
910
1772
  trailing?: boolean;
911
1773
  }): ComposableThrottledFunction<T>;
912
1774
 
1775
+ /**
1776
+ * Timezone and locale utilities
1777
+ *
1778
+ * Provides timezone-aware formatting and locale detection for Directix.
1779
+ */
1780
+ /**
1781
+ * Timezone info
1782
+ */
1783
+ export declare interface TimezoneInfo {
1784
+ /** Timezone identifier (e.g., 'Asia/Shanghai') */
1785
+ id: string;
1786
+ /** UTC offset in hours */
1787
+ offset: number;
1788
+ /** Offset string (e.g., '+08:00') */
1789
+ offsetString: string;
1790
+ /** Whether DST is active */
1791
+ isDST: boolean;
1792
+ /** Locale timezone name */
1793
+ name: string;
1794
+ }
1795
+
913
1796
  /**
914
1797
  * Tooltip placement
915
1798
  */
@@ -942,6 +1825,16 @@ export declare interface TouchGestureEvent {
942
1825
  event: TouchEvent;
943
1826
  }
944
1827
 
1828
+ /**
1829
+ * Register a directive for DevTools tracking
1830
+ */
1831
+ export declare function trackDirective(name: string, info?: Partial<DirectiveInfo>): void;
1832
+
1833
+ /**
1834
+ * Register a plugin for DevTools tracking
1835
+ */
1836
+ export declare function trackPlugin(info: PluginInfo): void;
1837
+
945
1838
  /**
946
1839
  * Trim position
947
1840
  */
@@ -975,6 +1868,16 @@ export declare type TruncatePosition = 'start' | 'middle' | 'end';
975
1868
  */
976
1869
  export declare function truncateText(text: string, maxLength: number, ellipsis?: string): string;
977
1870
 
1871
+ /**
1872
+ * Unregister a directive from DevTools tracking
1873
+ */
1874
+ export declare function untrackDirective(name: string): void;
1875
+
1876
+ /**
1877
+ * Unregister a plugin from DevTools tracking
1878
+ */
1879
+ export declare function untrackPlugin(name: string): void;
1880
+
978
1881
  /**
979
1882
  * Transform text to uppercase
980
1883
  */
@@ -6466,6 +7369,66 @@ export declare const vVisible: Directive;
6466
7369
  */
6467
7370
  export declare const vWatermark: Directive;
6468
7371
 
7372
+ /**
7373
+ * Show a warning message
7374
+ */
7375
+ export declare function warn(options: WarningOptions): void;
7376
+
7377
+ export declare function warn(message: string, params?: Record<string, any>): void;
7378
+
7379
+ /**
7380
+ * Deprecation warning
7381
+ */
7382
+ export declare function warnDeprecated(feature: string, alternative: string): void;
7383
+
7384
+ /**
7385
+ * Global warning messages
7386
+ */
7387
+ declare interface WarningMessages {
7388
+ deprecated: string;
7389
+ experimental: string;
7390
+ performance: string;
7391
+ fallback: string;
7392
+ }
7393
+
7394
+ declare interface WarningOptions {
7395
+ /** Directive name */
7396
+ directive?: string;
7397
+ /** Message key or raw message */
7398
+ message: string;
7399
+ /** Additional context parameters */
7400
+ params?: Record<string, any>;
7401
+ /** Log level */
7402
+ level?: LogLevel;
7403
+ /** Stack trace (only in development) */
7404
+ stack?: boolean;
7405
+ }
7406
+
7407
+ /**
7408
+ * Parameter validation warning
7409
+ */
7410
+ export declare function warnInvalidParam(directive: string, param: string, value: any, expected: string): void;
7411
+
7412
+ /**
7413
+ * Missing parameter warning
7414
+ */
7415
+ export declare function warnMissingParam(directive: string, param: string): void;
7416
+
7417
+ /**
7418
+ * Feature not supported warning
7419
+ */
7420
+ export declare function warnNotSupported(feature: string): void;
7421
+
7422
+ /**
7423
+ * SSR not supported warning
7424
+ */
7425
+ export declare function warnSSRNotSupported(directive: string): void;
7426
+
7427
+ /**
7428
+ * Create a performance monitor decorator for directives
7429
+ */
7430
+ export declare function withPerformanceMonitoring<T extends Record<string, any>>(directiveName: string, directive: T): T;
7431
+
6469
7432
  /**
6470
7433
  * Utility function to check if text would be truncated in a container
6471
7434
  *
@@ -6476,4 +7439,6 @@ export declare const vWatermark: Directive;
6476
7439
  */
6477
7440
  export declare function wouldTextTruncate(text: string, containerWidth: number, fontSize?: number): boolean;
6478
7441
 
7442
+ export declare const zhCN: I18nMessages;
7443
+
6479
7444
  export { }