vuetty 0.3.3 → 0.4.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
@@ -50,8 +50,52 @@ export interface VuettyOptions {
50
50
  [key: string]: any;
51
51
  }
52
52
 
53
+ export interface RunExternalAppOptions {
54
+ preserveAlternateBuffer?: boolean;
55
+ cwd?: string;
56
+ env?: Record<string, string>;
57
+ [key: string]: any;
58
+ }
59
+
60
+ export interface MemoryStats {
61
+ timestamp: number;
62
+ caches: Record<string, any>;
63
+ nodeTree: Record<string, any>;
64
+ viewport: Record<string, any>;
65
+ process: Record<string, any>;
66
+ }
67
+
53
68
  export class Vuetty {
54
69
  constructor(options?: VuettyOptions);
70
+
71
+ use(plugin: any, ...options: any[]): this;
72
+ createApp(rootComponent: Component, rootProps?: Record<string, any> | null): any;
73
+ mount(): this;
74
+ unmount(): this;
75
+ render(): void;
76
+
77
+ enableMouseTracking(): void;
78
+ disableMouseTracking(): void;
79
+ toggleMouseTracking(): void;
80
+
81
+ scrollUp(lines?: number): void;
82
+ scrollDown(lines?: number): void;
83
+ scrollToTop(): void;
84
+ scrollToBottom(): void;
85
+ pageUp(): void;
86
+ pageDown(): void;
87
+
88
+ provideRouter(router: any): void;
89
+ runExternalApp(command: string, args?: string[], options?: RunExternalAppOptions): any;
90
+
91
+ registerClickHandler(componentId: string, handler: (event: any) => void): void;
92
+ unregisterClickHandler(componentId: string): void;
93
+
94
+ clear(): void;
95
+ getOutput(): string;
96
+ getMemoryStats(): MemoryStats;
97
+ clearAllCaches(): MemoryStats;
98
+
55
99
  [key: string]: any;
56
100
  }
57
101
 
@@ -330,6 +374,7 @@ export interface TextInputProps extends BoxProps, Pick<StyleProps, 'color' | 'bg
330
374
  pattern?: RegExp;
331
375
  required?: boolean;
332
376
  maxLength?: number;
377
+ pasteLongThreshold?: number;
333
378
  disabled?: boolean;
334
379
  readonly?: boolean;
335
380
  }
@@ -366,6 +411,29 @@ export interface ListComponentProps extends BoxProps, Pick<StyleProps, 'color' |
366
411
  highlightColor?: string;
367
412
  }
368
413
 
414
+ export interface VirtualListSlotProps<T = any> {
415
+ item: T | null;
416
+ index: number;
417
+ loading: boolean;
418
+ error: any | null;
419
+ }
420
+
421
+ export interface VirtualListProps<T = any> extends BoxProps, Pick<StyleProps, 'color' | 'bg'> {
422
+ count: number;
423
+ itemHeight?: number;
424
+ height: number;
425
+ getItem: (index: number) => T | Promise<T>;
426
+ keyExtractor?: (item: T, index: number) => string | number;
427
+ overscan?: number;
428
+ cacheBuffer?: number | null;
429
+ disabled?: boolean;
430
+ focusColor?: string;
431
+ emptyText?: string;
432
+ loadingText?: string;
433
+ autoScrollToBottom?: boolean;
434
+ maxItems?: number | null;
435
+ }
436
+
369
437
  export interface CheckboxProps extends BoxProps, Pick<StyleProps, 'color' | 'bg' | 'bold' | 'dim'> {
370
438
  modelValue?: any[];
371
439
  options?: Array<ListItem | string | number>;
@@ -579,6 +647,7 @@ export const Gradient: DefineComponent<GradientProps>;
579
647
  export const Button: DefineComponent<ButtonComponentProps>;
580
648
  export const Tree: DefineComponent<TreeProps>;
581
649
  export const List: DefineComponent<ListComponentProps>;
650
+ export const VirtualList: DefineComponent<VirtualListProps>;
582
651
  export const Tabs: DefineComponent<TabsProps>;
583
652
  export const CodeDiff: DefineComponent<CodeDiffProps>;
584
653