@plyaz/types 1.5.1 → 1.5.2

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.
@@ -56,32 +56,32 @@ import type * as NextLink from 'next/link';
56
56
  */
57
57
  export interface MockFS {
58
58
  /** Async read file */
59
- readFile: Vitest.MockInstance;
59
+ readFile: Vitest.Mock;
60
60
  /** Async write file */
61
- writeFile: Vitest.MockInstance;
61
+ writeFile: Vitest.Mock;
62
62
  /** Sync read file */
63
- readFileSync: Vitest.MockInstance;
63
+ readFileSync: Vitest.Mock;
64
64
  /** Sync write file */
65
- writeFileSync: Vitest.MockInstance;
65
+ writeFileSync: Vitest.Mock;
66
66
  /** Check if path exists */
67
- existsSync: Vitest.MockInstance;
67
+ existsSync: Vitest.Mock;
68
68
  /** Create directory */
69
- mkdirSync: Vitest.MockInstance;
69
+ mkdirSync: Vitest.Mock;
70
70
  /** Read directory contents */
71
- readdirSync: Vitest.MockInstance;
71
+ readdirSync: Vitest.Mock;
72
72
  /** Get file stats */
73
- statSync: Vitest.MockInstance;
73
+ statSync: Vitest.Mock;
74
74
  /** Delete file */
75
- unlinkSync: Vitest.MockInstance;
75
+ unlinkSync: Vitest.Mock;
76
76
  /** Remove file or directory */
77
- rmSync: Vitest.MockInstance;
77
+ rmSync: Vitest.Mock;
78
78
  }
79
79
  /**
80
80
  * Mock process interface matching Node.js process global
81
81
  *
82
82
  * @example
83
83
  * ```typescript
84
- * const mockProcess: Vitest.MockInstanceProcess = createMockProcess();
84
+ * const mockProcess: Vitest.MockProcess = createMockProcess();
85
85
  *
86
86
  * // Mock environment
87
87
  * mockProcess.env.NODE_ENV = 'test';
@@ -96,25 +96,25 @@ export interface MockProcess {
96
96
  /** Environment variables */
97
97
  env: Record<string, string | undefined>;
98
98
  /** Exit the process */
99
- exit: Vitest.MockInstance;
99
+ exit: Vitest.Mock;
100
100
  /** Get current working directory */
101
- cwd: Vitest.MockInstance;
101
+ cwd: Vitest.Mock;
102
102
  /** Change current directory */
103
- chdir: Vitest.MockInstance;
103
+ chdir: Vitest.Mock;
104
104
  /** Standard output stream */
105
105
  stdout: {
106
106
  /** Write to stdout */
107
- write: Vitest.MockInstance;
107
+ write: Vitest.Mock;
108
108
  };
109
109
  /** Standard error stream */
110
110
  stderr: {
111
111
  /** Write to stderr */
112
- write: Vitest.MockInstance;
112
+ write: Vitest.Mock;
113
113
  };
114
114
  /** Add event listener */
115
- on: Vitest.MockInstance;
115
+ on: Vitest.Mock;
116
116
  /** Remove event listener */
117
- removeListener: Vitest.MockInstance;
117
+ removeListener: Vitest.Mock;
118
118
  }
119
119
  /**
120
120
  * Mock crypto interface matching Node.js crypto module
@@ -135,13 +135,13 @@ export interface MockProcess {
135
135
  */
136
136
  export interface MockCrypto {
137
137
  /** Generate random bytes */
138
- randomBytes: Vitest.MockInstance;
138
+ randomBytes: Vitest.Mock;
139
139
  /** Generate random UUID */
140
- randomUUID: Vitest.MockInstance;
140
+ randomUUID: Vitest.Mock;
141
141
  /** Create hash object */
142
- createHash: Vitest.MockInstance;
142
+ createHash: Vitest.Mock;
143
143
  /** Create HMAC object */
144
- createHmac: Vitest.MockInstance;
144
+ createHmac: Vitest.Mock;
145
145
  }
146
146
  /**
147
147
  * Mock path interface matching Node.js path module
@@ -158,21 +158,21 @@ export interface MockCrypto {
158
158
  */
159
159
  export interface MockPath {
160
160
  /** Join path segments */
161
- join: Vitest.MockInstance;
161
+ join: Vitest.Mock;
162
162
  /** Resolve absolute path */
163
- resolve: Vitest.MockInstance;
163
+ resolve: Vitest.Mock;
164
164
  /** Get directory name */
165
- dirname: Vitest.MockInstance;
165
+ dirname: Vitest.Mock;
166
166
  /** Get base name */
167
- basename: Vitest.MockInstance;
167
+ basename: Vitest.Mock;
168
168
  /** Get file extension */
169
- extname: Vitest.MockInstance;
169
+ extname: Vitest.Mock;
170
170
  /** Get relative path */
171
- relative: Vitest.MockInstance;
171
+ relative: Vitest.Mock;
172
172
  /** Check if path is absolute */
173
- isAbsolute: Vitest.MockInstance;
173
+ isAbsolute: Vitest.Mock;
174
174
  /** Normalize path */
175
- normalize: Vitest.MockInstance;
175
+ normalize: Vitest.Mock;
176
176
  /** Path separator for platform */
177
177
  sep: string;
178
178
  }
@@ -192,13 +192,13 @@ export interface MockPath {
192
192
  */
193
193
  export interface MockChildProcess {
194
194
  /** Spawn a new process */
195
- spawn: Vitest.MockInstance;
195
+ spawn: Vitest.Mock;
196
196
  /** Execute command asynchronously */
197
- exec: Vitest.MockInstance;
197
+ exec: Vitest.Mock;
198
198
  /** Execute command synchronously */
199
- execSync: Vitest.MockInstance;
199
+ execSync: Vitest.Mock;
200
200
  /** Fork a child process */
201
- fork: Vitest.MockInstance;
201
+ fork: Vitest.Mock;
202
202
  }
203
203
  /**
204
204
  * Mock timers interface for testing time-dependent code
@@ -220,17 +220,17 @@ export interface MockChildProcess {
220
220
  */
221
221
  export interface MockTimers {
222
222
  /** Schedule a timeout */
223
- setTimeout: Vitest.MockInstance;
223
+ setTimeout: Vitest.Mock;
224
224
  /** Clear a timeout */
225
- clearTimeout: Vitest.MockInstance;
225
+ clearTimeout: Vitest.Mock;
226
226
  /** Schedule an interval */
227
- setInterval: Vitest.MockInstance;
227
+ setInterval: Vitest.Mock;
228
228
  /** Clear an interval */
229
- clearInterval: Vitest.MockInstance;
229
+ clearInterval: Vitest.Mock;
230
230
  /** Schedule immediate execution */
231
- setImmediate: Vitest.MockInstance;
231
+ setImmediate: Vitest.Mock;
232
232
  /** Clear immediate execution */
233
- clearImmediate: Vitest.MockInstance;
233
+ clearImmediate: Vitest.Mock;
234
234
  /** Enable fake timers */
235
235
  useFakeTimers: () => void;
236
236
  /** Restore real timers */
@@ -265,39 +265,39 @@ export interface MockTimers {
265
265
  */
266
266
  export interface MockEventEmitter {
267
267
  /** Add event listener */
268
- on: Vitest.MockInstance;
268
+ on: Vitest.Mock;
269
269
  /** Add one-time event listener */
270
- once: Vitest.MockInstance;
270
+ once: Vitest.Mock;
271
271
  /** Remove event listener */
272
- off: Vitest.MockInstance;
272
+ off: Vitest.Mock;
273
273
  /** Emit event to listeners */
274
- emit: Vitest.MockInstance;
274
+ emit: Vitest.Mock;
275
275
  /** Emit event asynchronously */
276
- emitAsync: Vitest.MockInstance;
276
+ emitAsync: Vitest.Mock;
277
277
  /** Remove specific listener */
278
- removeListener: Vitest.MockInstance;
278
+ removeListener: Vitest.Mock;
279
279
  /** Remove all listeners for event */
280
- removeAllListeners: Vitest.MockInstance;
280
+ removeAllListeners: Vitest.Mock;
281
281
  /** Alias for on() */
282
- addListener: Vitest.MockInstance;
282
+ addListener: Vitest.Mock;
283
283
  /** Get listeners for event */
284
- listeners: Vitest.MockInstance;
284
+ listeners: Vitest.Mock;
285
285
  /** Count listeners for event */
286
- listenerCount: Vitest.MockInstance;
286
+ listenerCount: Vitest.Mock;
287
287
  /** Get all event names */
288
- eventNames: Vitest.MockInstance;
288
+ eventNames: Vitest.Mock;
289
289
  /** Set max listeners limit */
290
- setMaxListeners: Vitest.MockInstance;
290
+ setMaxListeners: Vitest.Mock;
291
291
  /** Get max listeners limit */
292
- getMaxListeners: Vitest.MockInstance;
292
+ getMaxListeners: Vitest.Mock;
293
293
  /** Wait for specific event */
294
- waitForEvent: Vitest.MockInstance;
294
+ waitForEvent: Vitest.Mock;
295
295
  /** Get raw listeners array */
296
- rawListeners: Vitest.MockInstance;
296
+ rawListeners: Vitest.Mock;
297
297
  /** Prepend listener to start of list */
298
- prependListener: Vitest.MockInstance;
298
+ prependListener: Vitest.Mock;
299
299
  /** Prepend one-time listener */
300
- prependOnceListener: Vitest.MockInstance;
300
+ prependOnceListener: Vitest.Mock;
301
301
  }
302
302
  /**
303
303
  * Mock logger interface matching NestJS Logger methods
@@ -318,21 +318,21 @@ export interface MockEventEmitter {
318
318
  */
319
319
  export interface MockLogger {
320
320
  /** Log info message */
321
- log: Vitest.MockInstance;
321
+ log: Vitest.Mock;
322
322
  /** Log error message */
323
- error: Vitest.MockInstance;
323
+ error: Vitest.Mock;
324
324
  /** Log warning message */
325
- warn: Vitest.MockInstance;
325
+ warn: Vitest.Mock;
326
326
  /** Log info message */
327
- info: Vitest.MockInstance;
327
+ info: Vitest.Mock;
328
328
  /** Log debug message */
329
- debug: Vitest.MockInstance;
329
+ debug: Vitest.Mock;
330
330
  /** Log verbose message */
331
- verbose: Vitest.MockInstance;
331
+ verbose: Vitest.Mock;
332
332
  /** Set log level */
333
- setLevel: Vitest.MockInstance;
333
+ setLevel: Vitest.Mock;
334
334
  /** Get log level */
335
- getLevel: Vitest.MockInstance;
335
+ getLevel: Vitest.Mock;
336
336
  }
337
337
  /**
338
338
  * NestJS common decorators and exceptions mock interface
@@ -355,27 +355,27 @@ export interface MockLogger {
355
355
  */
356
356
  export interface NestJsCommonMocks {
357
357
  /** Injectable decorator mock */
358
- Injectable: Vitest.MockInstance;
358
+ Injectable: Vitest.Mock;
359
359
  /** Inject decorator mock */
360
- Inject: Vitest.MockInstance;
360
+ Inject: Vitest.Mock;
361
361
  /** Optional decorator mock */
362
- Optional: Vitest.MockInstance;
362
+ Optional: Vitest.Mock;
363
363
  /** Logger class mock */
364
- Logger: Vitest.MockInstance;
364
+ Logger: Vitest.Mock;
365
365
  /** HttpException class mock */
366
- HttpException: Vitest.MockInstance;
366
+ HttpException: Vitest.Mock;
367
367
  /** HTTP status codes */
368
368
  HttpStatus: Record<string, number>;
369
369
  /** BadRequestException class mock */
370
- BadRequestException: Vitest.MockInstance;
370
+ BadRequestException: Vitest.Mock;
371
371
  /** NotFoundException class mock */
372
- NotFoundException: Vitest.MockInstance;
372
+ NotFoundException: Vitest.Mock;
373
373
  /** UnauthorizedException class mock */
374
- UnauthorizedException: Vitest.MockInstance;
374
+ UnauthorizedException: Vitest.Mock;
375
375
  /** ForbiddenException class mock */
376
- ForbiddenException: Vitest.MockInstance;
376
+ ForbiddenException: Vitest.Mock;
377
377
  /** InternalServerErrorException class mock */
378
- InternalServerErrorException: Vitest.MockInstance;
378
+ InternalServerErrorException: Vitest.Mock;
379
379
  }
380
380
  /**
381
381
  * Mock CRUD service interface for testing data operations
@@ -392,15 +392,15 @@ export interface NestJsCommonMocks {
392
392
  */
393
393
  export interface CrudServiceMock {
394
394
  /** Find all entities */
395
- findAll: Vitest.MockInstance;
395
+ findAll: Vitest.Mock;
396
396
  /** Find one entity */
397
- findOne: Vitest.MockInstance;
397
+ findOne: Vitest.Mock;
398
398
  /** Create new entity */
399
- create: Vitest.MockInstance;
399
+ create: Vitest.Mock;
400
400
  /** Update existing entity */
401
- update: Vitest.MockInstance;
401
+ update: Vitest.Mock;
402
402
  /** Remove entity */
403
- remove: Vitest.MockInstance;
403
+ remove: Vitest.Mock;
404
404
  }
405
405
  /**
406
406
  * Mock NestJS testing module interface
@@ -490,7 +490,7 @@ export interface MockContextValue<T = unknown> {
490
490
  /** Current context value */
491
491
  value: T;
492
492
  /** Function to update context value */
493
- setValue: Vitest.MockInstance;
493
+ setValue: Vitest.Mock;
494
494
  }
495
495
  /**
496
496
  * Mock React context provider interface
@@ -546,17 +546,17 @@ export interface MockProvider<T = unknown> {
546
546
  */
547
547
  export interface MockRouter {
548
548
  /** Navigate to new route */
549
- push: Vitest.MockInstance;
549
+ push: Vitest.Mock;
550
550
  /** Replace current route */
551
- replace: Vitest.MockInstance;
551
+ replace: Vitest.Mock;
552
552
  /** Go back in history */
553
- back: Vitest.MockInstance;
553
+ back: Vitest.Mock;
554
554
  /** Go forward in history */
555
- forward: Vitest.MockInstance;
555
+ forward: Vitest.Mock;
556
556
  /** Refresh current page */
557
- refresh: Vitest.MockInstance;
557
+ refresh: Vitest.Mock;
558
558
  /** Prefetch route */
559
- prefetch: Vitest.MockInstance;
559
+ prefetch: Vitest.Mock;
560
560
  /** Current pathname */
561
561
  pathname: string;
562
562
  /** Query parameters */
@@ -577,7 +577,7 @@ export interface MockRouter {
577
577
  state: unknown;
578
578
  };
579
579
  /** Navigation history */
580
- history: Array<MockHistoryEntry>;
580
+ history: Array<HistoryEntry>;
581
581
  }
582
582
  /**
583
583
  * Mock React hooks interface for testing hook behavior
@@ -597,21 +597,21 @@ export interface MockRouter {
597
597
  */
598
598
  export interface MockHooks {
599
599
  /** Mock useState hook */
600
- useState: Vitest.MockInstance;
600
+ useState: Vitest.Mock;
601
601
  /** Mock useEffect hook */
602
- useEffect: Vitest.MockInstance;
602
+ useEffect: Vitest.Mock;
603
603
  /** Mock useContext hook */
604
- useContext: Vitest.MockInstance;
604
+ useContext: Vitest.Mock;
605
605
  /** Mock useReducer hook */
606
- useReducer: Vitest.MockInstance;
606
+ useReducer: Vitest.Mock;
607
607
  /** Mock useCallback hook */
608
- useCallback: Vitest.MockInstance;
608
+ useCallback: Vitest.Mock;
609
609
  /** Mock useMemo hook */
610
- useMemo: Vitest.MockInstance;
610
+ useMemo: Vitest.Mock;
611
611
  /** Mock useRef hook */
612
- useRef: Vitest.MockInstance;
612
+ useRef: Vitest.Mock;
613
613
  /** Mock useLayoutEffect hook */
614
- useLayoutEffect: Vitest.MockInstance;
614
+ useLayoutEffect: Vitest.Mock;
615
615
  }
616
616
  /**
617
617
  * Mock fetch interface for testing HTTP requests
@@ -632,7 +632,7 @@ export interface MockHooks {
632
632
  */
633
633
  export interface MockFetch {
634
634
  /** Main fetch mock function */
635
- mock: Vitest.MockInstance;
635
+ mock: Vitest.Mock;
636
636
  /** Mock successful response */
637
637
  mockResponse: (response: unknown, options?: ResponseInit) => void;
638
638
  /** Mock error response */
@@ -660,17 +660,17 @@ export interface MockFetch {
660
660
  */
661
661
  export interface MockLocalStorage {
662
662
  /** Get item from storage */
663
- getItem: Vitest.MockInstance;
663
+ getItem: Vitest.Mock;
664
664
  /** Set item in storage */
665
- setItem: Vitest.MockInstance;
665
+ setItem: Vitest.Mock;
666
666
  /** Remove item from storage */
667
- removeItem: Vitest.MockInstance;
667
+ removeItem: Vitest.Mock;
668
668
  /** Clear all storage */
669
- clear: Vitest.MockInstance;
669
+ clear: Vitest.Mock;
670
670
  /** Number of items in storage */
671
671
  length: number;
672
672
  /** Get key at index */
673
- key: Vitest.MockInstance;
673
+ key: Vitest.Mock;
674
674
  }
675
675
  /**
676
676
  * Mock IntersectionObserver instance interface
@@ -696,11 +696,11 @@ export interface MockIntersectionObserverInstance {
696
696
  /** Set of observed elements */
697
697
  elements: Set<Element>;
698
698
  /** Start observing element */
699
- observe: Vitest.MockInstance;
699
+ observe: Vitest.Mock;
700
700
  /** Stop observing element */
701
- unobserve: Vitest.MockInstance;
701
+ unobserve: Vitest.Mock;
702
702
  /** Disconnect all observations */
703
- disconnect: Vitest.MockInstance;
703
+ disconnect: Vitest.Mock;
704
704
  /** Manually trigger intersection entries */
705
705
  trigger: (entries: IntersectionObserverEntry[]) => void;
706
706
  }
@@ -722,7 +722,7 @@ export interface MockIntersectionObserverInstance {
722
722
  */
723
723
  export interface MockIntersectionObserver {
724
724
  /** IntersectionObserver constructor mock */
725
- MockIntersectionObserver: Vitest.MockInstance;
725
+ MockIntersectionObserver: Vitest.Mock;
726
726
  /** Array of observer instances */
727
727
  instances: MockIntersectionObserverInstance[];
728
728
  /** Trigger intersection for specific entries */
@@ -732,11 +732,11 @@ export interface MockIntersectionObserver {
732
732
  /** Reset all observers */
733
733
  reset: () => void;
734
734
  /** Observe element mock */
735
- observe: Vitest.MockInstance;
735
+ observe: Vitest.Mock;
736
736
  /** Unobserve element mock */
737
- unobserve: Vitest.MockInstance;
737
+ unobserve: Vitest.Mock;
738
738
  /** Disconnect observer mock */
739
- disconnect: Vitest.MockInstance;
739
+ disconnect: Vitest.Mock;
740
740
  /** Current observer callback */
741
741
  callback: ((entries: IntersectionObserverEntry[]) => void) | null;
742
742
  }
@@ -759,27 +759,27 @@ export interface MockIntersectionObserver {
759
759
  */
760
760
  export interface MockNextRouter extends Omit<NextRouter.NextRouter, 'push' | 'replace' | 'reload' | 'back' | 'forward' | 'prefetch' | 'beforePopState' | 'events'> {
761
761
  /** Navigate to new route */
762
- push: Vitest.MockInstance;
762
+ push: Vitest.Mock;
763
763
  /** Replace current route */
764
- replace: Vitest.MockInstance;
764
+ replace: Vitest.Mock;
765
765
  /** Reload current page */
766
- reload: Vitest.MockInstance;
766
+ reload: Vitest.Mock;
767
767
  /** Go back in history */
768
- back: Vitest.MockInstance;
768
+ back: Vitest.Mock;
769
769
  /** Go forward in history */
770
- forward: Vitest.MockInstance;
770
+ forward: Vitest.Mock;
771
771
  /** Prefetch route */
772
- prefetch: Vitest.MockInstance;
772
+ prefetch: Vitest.Mock;
773
773
  /** Set before pop state handler */
774
- beforePopState: Vitest.MockInstance;
774
+ beforePopState: Vitest.Mock;
775
775
  /** Router events */
776
776
  events: {
777
777
  /** Add event listener */
778
- on: Vitest.MockInstance;
778
+ on: Vitest.Mock;
779
779
  /** Remove event listener */
780
- off: Vitest.MockInstance;
780
+ off: Vitest.Mock;
781
781
  /** Emit router event */
782
- emit: Vitest.MockInstance;
782
+ emit: Vitest.Mock;
783
783
  };
784
784
  pathname: string;
785
785
  route: string;
@@ -855,23 +855,23 @@ export type MockNextApiRequest = Partial<Next.NextApiRequest> & {
855
855
  */
856
856
  export interface MockNextApiResponse {
857
857
  /** Set response status */
858
- status: Vitest.MockInstance;
858
+ status: Vitest.Mock;
859
859
  /** Send JSON response */
860
- json: Vitest.MockInstance;
860
+ json: Vitest.Mock;
861
861
  /** Send response */
862
- send: Vitest.MockInstance;
862
+ send: Vitest.Mock;
863
863
  /** Redirect response */
864
- redirect: Vitest.MockInstance;
864
+ redirect: Vitest.Mock;
865
865
  /** Set response header */
866
- setHeader: Vitest.MockInstance;
866
+ setHeader: Vitest.Mock;
867
867
  /** Get response header */
868
- getHeader: Vitest.MockInstance;
868
+ getHeader: Vitest.Mock;
869
869
  /** Remove response header */
870
- removeHeader: Vitest.MockInstance;
870
+ removeHeader: Vitest.Mock;
871
871
  /** Write to response */
872
- write: Vitest.MockInstance;
872
+ write: Vitest.Mock;
873
873
  /** End response */
874
- end: Vitest.MockInstance;
874
+ end: Vitest.Mock;
875
875
  /** Current status code */
876
876
  statusCode: number;
877
877
  /** Current status message */
@@ -928,21 +928,21 @@ export type MockGetStaticPropsContext = Next.GetStaticPropsContext;
928
928
  */
929
929
  export interface MockSearchParams {
930
930
  /** Get parameter value */
931
- get: Vitest.MockInstance;
931
+ get: Vitest.Mock;
932
932
  /** Get all values for parameter */
933
- getAll: Vitest.MockInstance;
933
+ getAll: Vitest.Mock;
934
934
  /** Check if parameter exists */
935
- has: Vitest.MockInstance;
935
+ has: Vitest.Mock;
936
936
  /** Get all parameter keys */
937
- keys: Vitest.MockInstance;
937
+ keys: Vitest.Mock;
938
938
  /** Get all parameter values */
939
- values: Vitest.MockInstance;
939
+ values: Vitest.Mock;
940
940
  /** Get all key-value entries */
941
- entries: Vitest.MockInstance;
941
+ entries: Vitest.Mock;
942
942
  /** Iterate over parameters */
943
- forEach: Vitest.MockInstance;
943
+ forEach: Vitest.Mock;
944
944
  /** Convert to string */
945
- toString: Vitest.MockInstance;
945
+ toString: Vitest.Mock;
946
946
  }
947
947
  /**
948
948
  * Mock Next.js environment variables interface
@@ -1040,19 +1040,19 @@ export interface MockHttpRequest {
1040
1040
  remotePort: number;
1041
1041
  };
1042
1042
  /** Add event listener */
1043
- on?: Vitest.MockInstance;
1043
+ on?: Vitest.Mock;
1044
1044
  /** Add one-time event listener */
1045
- once?: Vitest.MockInstance;
1045
+ once?: Vitest.Mock;
1046
1046
  /** Emit event */
1047
- emit?: Vitest.MockInstance;
1047
+ emit?: Vitest.Mock;
1048
1048
  /** Pipe to stream */
1049
- pipe?: Vitest.MockInstance;
1049
+ pipe?: Vitest.Mock;
1050
1050
  /** Unpipe from stream */
1051
- unpipe?: Vitest.MockInstance;
1051
+ unpipe?: Vitest.Mock;
1052
1052
  /** Pause stream */
1053
- pause?: Vitest.MockInstance;
1053
+ pause?: Vitest.Mock;
1054
1054
  /** Resume stream */
1055
- resume?: Vitest.MockInstance;
1055
+ resume?: Vitest.Mock;
1056
1056
  }
1057
1057
  /**
1058
1058
  * Mock HTTP response interface for testing HTTP handlers
@@ -1076,31 +1076,31 @@ export interface MockHttpResponse {
1076
1076
  /** Current status message */
1077
1077
  statusMessage: string;
1078
1078
  /** Set status code */
1079
- status: Vitest.MockInstance;
1079
+ status: Vitest.Mock;
1080
1080
  /** Send JSON response */
1081
- json: Vitest.MockInstance;
1081
+ json: Vitest.Mock;
1082
1082
  /** Send response */
1083
- send: Vitest.MockInstance;
1083
+ send: Vitest.Mock;
1084
1084
  /** Set response header */
1085
- setHeader: Vitest.MockInstance;
1085
+ setHeader: Vitest.Mock;
1086
1086
  /** Get response header */
1087
- getHeader: Vitest.MockInstance;
1087
+ getHeader: Vitest.Mock;
1088
1088
  /** Remove response header */
1089
- removeHeader: Vitest.MockInstance;
1089
+ removeHeader: Vitest.Mock;
1090
1090
  /** Write to response */
1091
- write: Vitest.MockInstance;
1091
+ write: Vitest.Mock;
1092
1092
  /** End response */
1093
- end: Vitest.MockInstance;
1093
+ end: Vitest.Mock;
1094
1094
  /** Write response head */
1095
- writeHead?: Vitest.MockInstance;
1095
+ writeHead?: Vitest.Mock;
1096
1096
  /** Redirect response */
1097
- redirect?: Vitest.MockInstance;
1097
+ redirect?: Vitest.Mock;
1098
1098
  /** Add event listener */
1099
- on?: Vitest.MockInstance;
1099
+ on?: Vitest.Mock;
1100
1100
  /** Add one-time event listener */
1101
- once?: Vitest.MockInstance;
1101
+ once?: Vitest.Mock;
1102
1102
  /** Emit event */
1103
- emit?: Vitest.MockInstance;
1103
+ emit?: Vitest.Mock;
1104
1104
  /** Whether response is finished */
1105
1105
  finished?: boolean;
1106
1106
  /** Whether headers are sent */
@@ -1121,7 +1121,7 @@ export interface MockHttpResponse {
1121
1121
  * };
1122
1122
  * ```
1123
1123
  */
1124
- export interface MockHistoryEntry {
1124
+ export interface HistoryEntry {
1125
1125
  /** URL pathname */
1126
1126
  pathname: string;
1127
1127
  /** URL search string */
@@ -1171,7 +1171,7 @@ export interface MiddlewareContext {
1171
1171
  /** Mock HTTP response */
1172
1172
  res: MockHttpResponse;
1173
1173
  /** Next function mock */
1174
- next: Vitest.MockInstance;
1174
+ next: Vitest.Mock;
1175
1175
  }
1176
1176
  /**
1177
1177
  * Options for stream piping operations
@@ -1226,11 +1226,11 @@ export interface NextLinkChildProps {
1226
1226
  */
1227
1227
  export interface ErrorHandlerMock {
1228
1228
  /** Error event handler */
1229
- onError: Vitest.MockInstance;
1229
+ onError: Vitest.Mock;
1230
1230
  /** Catch block handler */
1231
- onCatch: Vitest.MockInstance;
1231
+ onCatch: Vitest.Mock;
1232
1232
  /** Finally block handler */
1233
- onFinally: Vitest.MockInstance;
1233
+ onFinally: Vitest.Mock;
1234
1234
  /** Reset all handlers */
1235
1235
  reset: () => void;
1236
1236
  }
@@ -1322,21 +1322,21 @@ export interface TimerCallbackEntry {
1322
1322
  */
1323
1323
  export interface MockHttpServer {
1324
1324
  /** Start listening on port */
1325
- listen: Vitest.MockInstance;
1325
+ listen: Vitest.Mock;
1326
1326
  /** Close server */
1327
- close: Vitest.MockInstance;
1327
+ close: Vitest.Mock;
1328
1328
  /** Get server address */
1329
- address: Vitest.MockInstance;
1329
+ address: Vitest.Mock;
1330
1330
  /** Active connections */
1331
1331
  connections: Set<unknown>;
1332
1332
  /** Get connection count */
1333
- getConnections: Vitest.MockInstance;
1333
+ getConnections: Vitest.Mock;
1334
1334
  /** Add event listener */
1335
- on: Vitest.MockInstance;
1335
+ on: Vitest.Mock;
1336
1336
  /** Add one-time event listener */
1337
- once: Vitest.MockInstance;
1337
+ once: Vitest.Mock;
1338
1338
  /** Emit server event */
1339
- emit: Vitest.MockInstance;
1339
+ emit: Vitest.Mock;
1340
1340
  }
1341
1341
  /**
1342
1342
  * Mock readable stream interface extending EventEmitter
@@ -1498,7 +1498,7 @@ export interface NestJsModuleMock {
1498
1498
  */
1499
1499
  export type CreateStatefulCounterMockReturn = StatefulMock<{
1500
1500
  value: number;
1501
- }, Record<string, Vitest.MockInstance>>;
1501
+ }, Record<string, Vitest.Mock>>;
1502
1502
  /**
1503
1503
  * Base interface for stateful mocks with state management
1504
1504
  *
@@ -1571,7 +1571,7 @@ export interface StatefulMockOptions<TState> {
1571
1571
  /**
1572
1572
  * Type definition for createMockUseRouter function return
1573
1573
  */
1574
- export type CreateMockUseRouterReturn = Vitest.MockInstance;
1574
+ export type CreateMockUseRouterReturn = Vitest.Mock;
1575
1575
  /**
1576
1576
  * Type definition for createMockWebSocket function return
1577
1577
  */
@@ -1582,24 +1582,24 @@ export interface CreateMockWebSocketReturn {
1582
1582
  readyState: number;
1583
1583
  bufferedAmount: number;
1584
1584
  binaryType: 'blob' | 'arraybuffer';
1585
- send: Vitest.MockInstance;
1586
- close: Vitest.MockInstance;
1587
- ping: Vitest.MockInstance;
1588
- pong: Vitest.MockInstance;
1589
- terminate: Vitest.MockInstance;
1585
+ send: Vitest.Mock;
1586
+ close: Vitest.Mock;
1587
+ ping: Vitest.Mock;
1588
+ pong: Vitest.Mock;
1589
+ terminate: Vitest.Mock;
1590
1590
  messages: unknown[];
1591
1591
  simulateMessage: (data: unknown) => void;
1592
1592
  simulateError: (error: Error) => void;
1593
1593
  simulateClose: (code?: number, reason?: string) => void;
1594
1594
  simulateOpen: () => void;
1595
- on: Vitest.MockInstance;
1596
- off: Vitest.MockInstance;
1597
- emit: Vitest.MockInstance;
1598
- addListener: Vitest.MockInstance;
1599
- removeListener: Vitest.MockInstance;
1600
- removeAllListeners: Vitest.MockInstance;
1601
- listeners: Vitest.MockInstance;
1602
- listenerCount: Vitest.MockInstance;
1595
+ on: Vitest.Mock;
1596
+ off: Vitest.Mock;
1597
+ emit: Vitest.Mock;
1598
+ addListener: Vitest.Mock;
1599
+ removeListener: Vitest.Mock;
1600
+ removeAllListeners: Vitest.Mock;
1601
+ listeners: Vitest.Mock;
1602
+ listenerCount: Vitest.Mock;
1603
1603
  }
1604
1604
  /**
1605
1605
  * Type definition for middlewareUtils.createMockNextRequest function
@@ -1623,9 +1623,9 @@ export type CreateMockNextRequestFunction = (url: string, options?: {
1623
1623
  href: string;
1624
1624
  };
1625
1625
  cookies: {
1626
- get: Vitest.MockInstance;
1627
- set: Vitest.MockInstance;
1628
- delete: Vitest.MockInstance;
1626
+ get: Vitest.Mock;
1627
+ set: Vitest.Mock;
1628
+ delete: Vitest.Mock;
1629
1629
  };
1630
1630
  geo: {
1631
1631
  city: string;
@@ -1643,22 +1643,22 @@ export interface CreateMockWebSocketServerReturn {
1643
1643
  port: number;
1644
1644
  host: string;
1645
1645
  maxClients: number;
1646
- handleUpgrade: Vitest.MockInstance;
1647
- shouldHandle: Vitest.MockInstance;
1648
- close: Vitest.MockInstance;
1646
+ handleUpgrade: Vitest.Mock;
1647
+ shouldHandle: Vitest.Mock;
1648
+ close: Vitest.Mock;
1649
1649
  addClient: (client: CreateMockWebSocketReturn) => void;
1650
1650
  removeClient: (client: CreateMockWebSocketReturn) => void;
1651
1651
  simulateConnection: (clientId?: string) => CreateMockWebSocketReturn;
1652
1652
  simulateBroadcast: (data: unknown, excludeClient?: string) => void;
1653
1653
  simulateClientDisconnect: (clientId: string) => void;
1654
- on: Vitest.MockInstance;
1655
- off: Vitest.MockInstance;
1656
- emit: Vitest.MockInstance;
1657
- addListener: Vitest.MockInstance;
1658
- removeListener: Vitest.MockInstance;
1659
- removeAllListeners: Vitest.MockInstance;
1660
- listeners: Vitest.MockInstance;
1661
- listenerCount: Vitest.MockInstance;
1654
+ on: Vitest.Mock;
1655
+ off: Vitest.Mock;
1656
+ emit: Vitest.Mock;
1657
+ addListener: Vitest.Mock;
1658
+ removeListener: Vitest.Mock;
1659
+ removeAllListeners: Vitest.Mock;
1660
+ listeners: Vitest.Mock;
1661
+ listenerCount: Vitest.Mock;
1662
1662
  }
1663
1663
  /**
1664
1664
  * Console mock with advanced capture and filtering
@@ -1666,11 +1666,11 @@ export interface CreateMockWebSocketServerReturn {
1666
1666
  * @public
1667
1667
  */
1668
1668
  export interface AdvancedConsoleMock {
1669
- log: Vitest.MockInstance;
1670
- warn: Vitest.MockInstance;
1671
- error: Vitest.MockInstance;
1672
- info: Vitest.MockInstance;
1673
- debug: Vitest.MockInstance;
1669
+ log: Vitest.Mock;
1670
+ warn: Vitest.Mock;
1671
+ error: Vitest.Mock;
1672
+ info: Vitest.Mock;
1673
+ debug: Vitest.Mock;
1674
1674
  logs: string[];
1675
1675
  warnings: string[];
1676
1676
  errors: string[];
@@ -1694,256 +1694,466 @@ export interface AdvancedConsoleMock {
1694
1694
  getLastError: () => string | undefined;
1695
1695
  }
1696
1696
  /**
1697
- * Mock FormData implementation
1698
- * @interface MockFormData
1697
+ * Mock FormData implementation for testing form data handling.
1698
+ * Simulates browser FormData API for testing file uploads and form submissions.
1699
+ *
1700
+ * @example
1701
+ * ```typescript
1702
+ * const mockFormData: MockFormData = {
1703
+ * append: vi.fn(),
1704
+ * delete: vi.fn(),
1705
+ * get: vi.fn().mockReturnValue('value'),
1706
+ * getAll: vi.fn().mockReturnValue(['value1', 'value2']),
1707
+ * has: vi.fn().mockReturnValue(true),
1708
+ * set: vi.fn(),
1709
+ * entries: vi.fn(),
1710
+ * keys: vi.fn(),
1711
+ * values: vi.fn()
1712
+ * };
1713
+ *
1714
+ * // Test form data operations
1715
+ * mockFormData.append('file', new Blob(['content']));
1716
+ * mockFormData.set('field', 'value');
1717
+ * ```
1699
1718
  */
1700
1719
  export interface MockFormData {
1701
1720
  /** Append field */
1702
- append: Vitest.MockInstance;
1721
+ append: Vitest.Mock;
1703
1722
  /** Delete field */
1704
- delete: Vitest.MockInstance;
1723
+ delete: Vitest.Mock;
1705
1724
  /** Get field value */
1706
- get: Vitest.MockInstance;
1725
+ get: Vitest.Mock;
1707
1726
  /** Get all field values */
1708
- getAll: Vitest.MockInstance;
1727
+ getAll: Vitest.Mock;
1709
1728
  /** Check if field exists */
1710
- has: Vitest.MockInstance;
1729
+ has: Vitest.Mock;
1711
1730
  /** Set field value */
1712
- set: Vitest.MockInstance;
1731
+ set: Vitest.Mock;
1713
1732
  /** Iterate entries */
1714
- entries: Vitest.MockInstance;
1733
+ entries: Vitest.Mock;
1715
1734
  /** Iterate keys */
1716
- keys: Vitest.MockInstance;
1735
+ keys: Vitest.Mock;
1717
1736
  /** Iterate values */
1718
- values: Vitest.MockInstance;
1737
+ values: Vitest.Mock;
1719
1738
  }
1720
1739
  /**
1721
- * Vitest.MockInstance Axios implementation
1722
- * @interface MockAxios
1740
+ * Mock Axios implementation for testing HTTP requests.
1741
+ * Provides mocked versions of all Axios methods and interceptors.
1742
+ *
1743
+ * @example
1744
+ * ```typescript
1745
+ * const mockAxios: MockAxios = {
1746
+ * get: vi.fn().mockResolvedValue({ data: { users: [] } }),
1747
+ * post: vi.fn().mockResolvedValue({ data: { id: 1 } }),
1748
+ * put: vi.fn().mockResolvedValue({ data: { updated: true } }),
1749
+ * patch: vi.fn().mockResolvedValue({ data: { patched: true } }),
1750
+ * delete: vi.fn().mockResolvedValue({ data: { deleted: true } }),
1751
+ * head: vi.fn().mockResolvedValue({ headers: {} }),
1752
+ * options: vi.fn().mockResolvedValue({ data: ['GET', 'POST'] }),
1753
+ * interceptors: {
1754
+ * request: { use: vi.fn(), eject: vi.fn() },
1755
+ * response: { use: vi.fn(), eject: vi.fn() }
1756
+ * }
1757
+ * };
1758
+ * ```
1723
1759
  */
1724
1760
  export interface MockAxios {
1725
1761
  /** GET request */
1726
- get: Vitest.MockInstance;
1762
+ get: Vitest.Mock;
1727
1763
  /** POST request */
1728
- post: Vitest.MockInstance;
1764
+ post: Vitest.Mock;
1729
1765
  /** PUT request */
1730
- put: Vitest.MockInstance;
1766
+ put: Vitest.Mock;
1731
1767
  /** PATCH request */
1732
- patch: Vitest.MockInstance;
1768
+ patch: Vitest.Mock;
1733
1769
  /** DELETE request */
1734
- delete: Vitest.MockInstance;
1770
+ delete: Vitest.Mock;
1735
1771
  /** HEAD request */
1736
- head: Vitest.MockInstance;
1772
+ head: Vitest.Mock;
1737
1773
  /** OPTIONS request */
1738
- options: Vitest.MockInstance;
1774
+ options: Vitest.Mock;
1739
1775
  /** Request interceptors */
1740
1776
  interceptors: {
1741
1777
  request: {
1742
- use: Vitest.MockInstance;
1743
- eject: Vitest.MockInstance;
1778
+ use: Vitest.Mock;
1779
+ eject: Vitest.Mock;
1744
1780
  };
1745
1781
  response: {
1746
- use: Vitest.MockInstance;
1747
- eject: Vitest.MockInstance;
1782
+ use: Vitest.Mock;
1783
+ eject: Vitest.Mock;
1748
1784
  };
1749
1785
  };
1750
1786
  }
1751
1787
  /**
1752
- * Vitest.MockInstance Headers implementation
1753
- * @interface MockHeaders
1788
+ * Mock Headers implementation for testing HTTP headers.
1789
+ * Simulates the Fetch API Headers interface.
1790
+ *
1791
+ * @example
1792
+ * ```typescript
1793
+ * const mockHeaders: MockHeaders = {
1794
+ * append: vi.fn(),
1795
+ * delete: vi.fn(),
1796
+ * get: vi.fn().mockReturnValue('application/json'),
1797
+ * has: vi.fn().mockReturnValue(true),
1798
+ * set: vi.fn(),
1799
+ * entries: vi.fn(),
1800
+ * keys: vi.fn(),
1801
+ * values: vi.fn()
1802
+ * };
1803
+ *
1804
+ * // Test header operations
1805
+ * mockHeaders.set('Content-Type', 'application/json');
1806
+ * mockHeaders.append('Authorization', 'Bearer token');
1807
+ * ```
1754
1808
  */
1755
1809
  export interface MockHeaders {
1756
1810
  /** Append header */
1757
- append: Vitest.MockInstance;
1811
+ append: Vitest.Mock;
1758
1812
  /** Delete header */
1759
- delete: Vitest.MockInstance;
1813
+ delete: Vitest.Mock;
1760
1814
  /** Get header value */
1761
- get: Vitest.MockInstance;
1815
+ get: Vitest.Mock;
1762
1816
  /** Check if header exists */
1763
- has: Vitest.MockInstance;
1817
+ has: Vitest.Mock;
1764
1818
  /** Set header value */
1765
- set: Vitest.MockInstance;
1819
+ set: Vitest.Mock;
1766
1820
  /** Iterate entries */
1767
- entries: Vitest.MockInstance;
1821
+ entries: Vitest.Mock;
1768
1822
  /** Iterate keys */
1769
- keys: Vitest.MockInstance;
1823
+ keys: Vitest.Mock;
1770
1824
  /** Iterate values */
1771
- values: Vitest.MockInstance;
1825
+ values: Vitest.Mock;
1772
1826
  }
1773
1827
  /**
1774
- * Vitest.MockInstance Cookie manager
1775
- * @interface MockCookie
1828
+ * Mock cookie manager for testing cookie operations.
1829
+ * Provides methods for cookie manipulation in tests.
1830
+ *
1831
+ * @example
1832
+ * ```typescript
1833
+ * const mockCookie: MockCookie = {
1834
+ * get: vi.fn().mockReturnValue('sessionId=abc123'),
1835
+ * set: vi.fn(),
1836
+ * delete: vi.fn(),
1837
+ * getAll: vi.fn().mockReturnValue({ sessionId: 'abc123', theme: 'dark' }),
1838
+ * clear: vi.fn(),
1839
+ * parse: vi.fn().mockImplementation((str) => ({
1840
+ * sessionId: 'abc123'
1841
+ * })),
1842
+ * serialize: vi.fn().mockReturnValue('sessionId=abc123; Path=/; HttpOnly')
1843
+ * };
1844
+ * ```
1776
1845
  */
1777
1846
  export interface MockCookie {
1778
1847
  /** Get cookie */
1779
- get: Vitest.MockInstance;
1848
+ get: Vitest.Mock;
1780
1849
  /** Set cookie */
1781
- set: Vitest.MockInstance;
1850
+ set: Vitest.Mock;
1782
1851
  /** Delete cookie */
1783
- delete: Vitest.MockInstance;
1852
+ delete: Vitest.Mock;
1784
1853
  /** Get all cookies */
1785
- getAll: Vitest.MockInstance;
1854
+ getAll: Vitest.Mock;
1786
1855
  /** Clear cookies */
1787
- clear: Vitest.MockInstance;
1856
+ clear: Vitest.Mock;
1788
1857
  /** Parse cookie string */
1789
- parse: Vitest.MockInstance;
1858
+ parse: Vitest.Mock;
1790
1859
  /** Serialize cookie */
1791
- serialize: Vitest.MockInstance;
1860
+ serialize: Vitest.Mock;
1792
1861
  }
1793
1862
  /**
1794
- * Vitest.MockInstance Session implementation
1795
- * @interface MockSession
1863
+ * Mock session implementation for testing session management.
1864
+ * Provides methods for session storage and lifecycle.
1865
+ *
1866
+ * @example
1867
+ * ```typescript
1868
+ * const mockSession: MockSession = {
1869
+ * get: vi.fn().mockReturnValue({ userId: '123' }),
1870
+ * set: vi.fn(),
1871
+ * delete: vi.fn(),
1872
+ * clear: vi.fn(),
1873
+ * save: vi.fn().mockResolvedValue(undefined),
1874
+ * destroy: vi.fn().mockResolvedValue(undefined),
1875
+ * touch: vi.fn()
1876
+ * };
1877
+ *
1878
+ * // Test session operations
1879
+ * mockSession.set('userId', '123');
1880
+ * await mockSession.save();
1881
+ * ```
1796
1882
  */
1797
1883
  export interface MockSession {
1798
1884
  /** Get session value */
1799
- get: Vitest.MockInstance;
1885
+ get: Vitest.Mock;
1800
1886
  /** Set session value */
1801
- set: Vitest.MockInstance;
1887
+ set: Vitest.Mock;
1802
1888
  /** Delete session value */
1803
- delete: Vitest.MockInstance;
1889
+ delete: Vitest.Mock;
1804
1890
  /** Clear session */
1805
- clear: Vitest.MockInstance;
1891
+ clear: Vitest.Mock;
1806
1892
  /** Save session */
1807
- save: Vitest.MockInstance;
1893
+ save: Vitest.Mock;
1808
1894
  /** Destroy session */
1809
- destroy: Vitest.MockInstance;
1895
+ destroy: Vitest.Mock;
1810
1896
  /** Touch session */
1811
- touch: Vitest.MockInstance;
1897
+ touch: Vitest.Mock;
1812
1898
  }
1813
1899
  /**
1814
- * Vitest.MockInstance HTTP interceptor
1815
- * @interface MockInterceptor
1900
+ * Mock HTTP interceptor for testing request/response interception.
1901
+ * Allows intercepting and modifying HTTP traffic in tests.
1902
+ *
1903
+ * @example
1904
+ * ```typescript
1905
+ * const mockInterceptor: MockInterceptor = {
1906
+ * intercept: vi.fn().mockReturnThis(),
1907
+ * capture: vi.fn().mockReturnThis(),
1908
+ * reply: vi.fn().mockImplementation((status, data) => ({ status, data })),
1909
+ * status: vi.fn().mockReturnThis(),
1910
+ * headers: vi.fn().mockReturnThis()
1911
+ * };
1912
+ *
1913
+ * // Chain interceptor methods
1914
+ * mockInterceptor
1915
+ * .intercept('/api/users')
1916
+ * .status(200)
1917
+ * .reply(200, { users: [] });
1918
+ * ```
1816
1919
  */
1817
1920
  export interface MockInterceptor {
1818
1921
  /** Intercept requests */
1819
- intercept: Vitest.MockInstance;
1922
+ intercept: Vitest.Mock;
1820
1923
  /** Capture requests */
1821
- capture: Vitest.MockInstance;
1924
+ capture: Vitest.Mock;
1822
1925
  /** Reply to requests */
1823
- reply: Vitest.MockInstance;
1926
+ reply: Vitest.Mock;
1824
1927
  /** Set status code */
1825
- status: Vitest.MockInstance;
1928
+ status: Vitest.Mock;
1826
1929
  /** Set headers */
1827
- headers: Vitest.MockInstance;
1930
+ headers: Vitest.Mock;
1828
1931
  }
1829
1932
  /**
1830
- * Vitest.MockInstance OS module
1831
- * @interface MockOS
1933
+ * Mock OS module interface for testing OS-specific functionality.
1934
+ * Provides mocked versions of Node.js OS module methods.
1935
+ *
1936
+ * @example
1937
+ * ```typescript
1938
+ * const mockOS: MockOS = {
1939
+ * platform: vi.fn(() => 'darwin'),
1940
+ * arch: vi.fn(() => 'x64'),
1941
+ * cpus: vi.fn(() => [{ model: 'Intel', speed: 2400 }]),
1942
+ * totalmem: vi.fn(() => 16000000000),
1943
+ * freemem: vi.fn(() => 8000000000),
1944
+ * hostname: vi.fn(() => 'test-machine'),
1945
+ * homedir: vi.fn(() => '/home/user'),
1946
+ * tmpdir: vi.fn(() => '/tmp')
1947
+ * };
1948
+ * ```
1832
1949
  */
1833
1950
  export interface MockOS {
1834
- /** Platform info */
1835
- platform: Vitest.MockInstance<() => string>;
1836
- /** Architecture info */
1837
- arch: Vitest.MockInstance<() => string>;
1838
- /** CPU information */
1839
- cpus: Vitest.MockInstance<() => unknown[]>;
1840
- /** Memory information */
1841
- totalmem: Vitest.MockInstance<() => number>;
1842
- /** Free memory */
1843
- freemem: Vitest.MockInstance<() => number>;
1844
- /** Hostname */
1845
- hostname: Vitest.MockInstance<() => string>;
1846
- /** Home directory */
1847
- homedir: Vitest.MockInstance<() => string>;
1848
- /** Temp directory */
1849
- tmpdir: Vitest.MockInstance<() => string>;
1951
+ platform: Vitest.Mock<() => string>;
1952
+ arch: Vitest.Mock<() => string>;
1953
+ cpus: Vitest.Mock<() => unknown[]>;
1954
+ totalmem: Vitest.Mock<() => number>;
1955
+ freemem: Vitest.Mock<() => number>;
1956
+ uptime: Vitest.Mock<() => number>;
1957
+ loadavg: Vitest.Mock<() => number[]>;
1958
+ hostname: Vitest.Mock<() => string>;
1959
+ networkInterfaces: Vitest.Mock<() => unknown>;
1960
+ userInfo: Vitest.Mock<() => unknown>;
1961
+ type: Vitest.Mock<() => string>;
1962
+ release: Vitest.Mock<() => string>;
1963
+ version: Vitest.Mock<() => string>;
1964
+ homedir: Vitest.Mock<() => string>;
1965
+ tmpdir: Vitest.Mock<() => string>;
1966
+ endianness: Vitest.Mock<() => string>;
1967
+ EOL: string;
1850
1968
  }
1851
1969
  /**
1852
- * Vitest.MockInstance Cluster module
1853
- * @interface MockCluster
1970
+ * Mock Cluster module interface for testing clustered Node.js applications.
1971
+ * Provides mocked cluster management functionality.
1972
+ *
1973
+ * @example
1974
+ * ```typescript
1975
+ * const mockCluster: MockCluster = {
1976
+ * isPrimary: true,
1977
+ * isMaster: true,
1978
+ * isWorker: false,
1979
+ * workers: {},
1980
+ * fork: vi.fn().mockReturnValue({ id: 1, process: {} }),
1981
+ * setupPrimary: vi.fn(),
1982
+ * setupMaster: vi.fn(),
1983
+ * disconnect: vi.fn(),
1984
+ * settings: {},
1985
+ * schedulingPolicy: 2,
1986
+ * SCHED_NONE: 1,
1987
+ * SCHED_RR: 2
1988
+ * };
1989
+ * ```
1854
1990
  */
1855
1991
  export interface MockCluster {
1856
- /** Is primary process */
1857
1992
  isPrimary: boolean;
1858
- /** Is master process (deprecated) */
1859
1993
  isMaster: boolean;
1860
- /** Is worker process */
1861
1994
  isWorker: boolean;
1862
- /** Worker instance */
1863
- worker?: unknown;
1864
- /** All workers */
1865
- workers: Record<string, unknown>;
1866
- /** Fork new worker */
1867
- fork: Vitest.MockInstance;
1868
- /** Disconnect cluster */
1869
- disconnect: Vitest.MockInstance;
1870
- /** Setup master/primary */
1871
- setupMaster: Vitest.MockInstance;
1995
+ workers: Record<number, unknown>;
1996
+ fork: Vitest.Mock<(env?: unknown) => unknown>;
1997
+ setupPrimary: Vitest.Mock<(settings?: unknown) => void>;
1998
+ setupMaster: Vitest.Mock<(settings?: unknown) => void>;
1999
+ on: Vitest.Mock;
2000
+ once: Vitest.Mock;
2001
+ removeListener: Vitest.Mock;
2002
+ emit: Vitest.Mock;
2003
+ disconnect: Vitest.Mock<(callback?: Function) => void>;
2004
+ settings: unknown;
2005
+ schedulingPolicy: number;
2006
+ SCHED_NONE: number;
2007
+ SCHED_RR: number;
1872
2008
  }
1873
2009
  /**
1874
- * Event listener removal parameters
1875
- * @interface RemoveListenerParams
2010
+ * Parameters for removing event listeners from event emitters.
2011
+ * Used internally for event listener management.
2012
+ *
2013
+ * @example
2014
+ * ```typescript
2015
+ * const params: RemoveListenerParams = {
2016
+ * events: new Map([['click', new Set([handler1, handler2])]]),
2017
+ * onceEvents: new Map([['load', new Set([onceHandler])]]),
2018
+ * event: 'click',
2019
+ * listener: handler1,
2020
+ * emitter: mockEventEmitter
2021
+ * };
2022
+ * ```
1876
2023
  */
1877
2024
  export interface RemoveListenerParams {
1878
- /** Event listeners map */
1879
2025
  events: Map<string | symbol, Set<Function>>;
1880
- /** Once listeners map */
1881
2026
  onceEvents: Map<string | symbol, Set<Function>>;
1882
- /** Event name */
1883
2027
  event: string | symbol;
1884
- /** Listener function */
1885
2028
  listener: Function;
2029
+ emitter: MockEventEmitter;
1886
2030
  }
1887
2031
  /**
1888
- * Vitest.MockInstance File Watcher
1889
- * @interface MockFileWatcher
2032
+ * Mock file watcher interface for testing file system monitoring.
2033
+ * Simulates file watching behavior for testing file change events.
2034
+ *
2035
+ * @example
2036
+ * ```typescript
2037
+ * const watcher: MockFileWatcher = {
2038
+ * on: vi.fn(),
2039
+ * off: vi.fn(),
2040
+ * emit: vi.fn(),
2041
+ * close: vi.fn(),
2042
+ * simulateChange: (eventType, filename) => {
2043
+ * watcher.emit(eventType, filename);
2044
+ * },
2045
+ * isWatching: () => true,
2046
+ * getListenerCount: (event) => 2,
2047
+ * getAllListeners: () => new Map()
2048
+ * };
2049
+ *
2050
+ * // Simulate file change
2051
+ * watcher.simulateChange('change', 'file.txt');
2052
+ * ```
1890
2053
  */
1891
2054
  export interface MockFileWatcher {
1892
- /** Add event listener */
1893
2055
  on: ReturnType<typeof Vitest.vi.fn>;
1894
- /** Remove event listener */
1895
2056
  off: ReturnType<typeof Vitest.vi.fn>;
1896
- /** Emit event */
1897
2057
  emit: ReturnType<typeof Vitest.vi.fn>;
1898
- /** Close watcher */
1899
2058
  close: ReturnType<typeof Vitest.vi.fn>;
1900
- /** Unref watcher */
1901
- unref: ReturnType<typeof Vitest.vi.fn>;
2059
+ simulateChange: (eventType: string, filename?: string) => void;
2060
+ isWatching: () => boolean;
2061
+ getListenerCount: (event: string) => number;
2062
+ getAllListeners: () => Map<string, Set<(...args: unknown[]) => void>>;
1902
2063
  }
1903
2064
  /**
1904
- * Console mock parameters
1905
- * @interface ConsoleMockParams
2065
+ * Parameters for configuring console mocking behavior.
2066
+ * Controls how console methods are intercepted and stored.
2067
+ *
2068
+ * @example
2069
+ * ```typescript
2070
+ * const params: ConsoleMockParams = {
2071
+ * type: 'log',
2072
+ * storage: [],
2073
+ * all: [],
2074
+ * originalFn: console.log,
2075
+ * suppressTypes: ['debug'],
2076
+ * formatArguments: (args) => args.join(' '),
2077
+ * captureStackTrace: false
2078
+ * };
2079
+ * ```
1906
2080
  */
1907
2081
  export interface ConsoleMockParams {
1908
- /** Console method type */
1909
2082
  type: string;
1910
- /** Storage array */
1911
2083
  storage: string[];
1912
- /** All calls */
1913
2084
  all: Array<{
1914
2085
  type: string;
1915
2086
  args: unknown[];
1916
2087
  }>;
2088
+ originalFn: Function;
2089
+ suppressTypes: string[];
2090
+ formatArguments: (args: unknown[]) => string;
2091
+ captureStackTrace?: boolean;
1917
2092
  }
1918
2093
  /**
1919
- * Vitest.MockInstance Buffer implementation
1920
- * @interface MockBuffer
2094
+ * Mock Buffer implementation for testing buffer operations.
2095
+ * Provides mocked versions of Node.js Buffer static methods.
2096
+ *
2097
+ * @example
2098
+ * ```typescript
2099
+ * const mockBuffer: MockBuffer = {
2100
+ * from: vi.fn().mockImplementation((data) => Buffer.from(data)),
2101
+ * alloc: vi.fn().mockImplementation((size) => Buffer.alloc(size)),
2102
+ * allocUnsafe: vi.fn().mockImplementation((size) => Buffer.allocUnsafe(size)),
2103
+ * concat: vi.fn().mockImplementation((list) => Buffer.concat(list)),
2104
+ * isBuffer: vi.fn().mockReturnValue(true),
2105
+ * byteLength: vi.fn().mockReturnValue(10),
2106
+ * compare: vi.fn().mockReturnValue(0),
2107
+ * isEncoding: vi.fn().mockReturnValue(true)
2108
+ * };
2109
+ * ```
1921
2110
  */
1922
2111
  export interface MockBuffer {
1923
- /** Create buffer from data */
1924
- from: Vitest.MockInstance;
1925
- /** Allocate buffer */
1926
- alloc: Vitest.MockInstance;
1927
- /** Allocate unsafe buffer */
1928
- allocUnsafe: Vitest.MockInstance;
1929
- /** Concatenate buffers */
1930
- concat: Vitest.MockInstance;
1931
- /** Compare buffers */
1932
- compare: Vitest.MockInstance;
2112
+ from: Vitest.Mock;
2113
+ alloc: Vitest.Mock;
2114
+ allocUnsafe: Vitest.Mock;
2115
+ concat: Vitest.Mock;
2116
+ isBuffer: Vitest.Mock;
2117
+ byteLength: Vitest.Mock;
2118
+ compare: Vitest.Mock;
2119
+ isEncoding: Vitest.Mock;
1933
2120
  }
1934
2121
  /**
1935
- * Vitest.MockInstance Worker Threads
1936
- * @interface MockWorkerThreads
2122
+ * Mock Worker Threads interface for testing multi-threaded Node.js applications.
2123
+ * Provides mocked worker thread functionality.
2124
+ *
2125
+ * @example
2126
+ * ```typescript
2127
+ * const mockWorkerThreads: MockWorkerThreads = {
2128
+ * Worker: vi.fn().mockImplementation(() => ({
2129
+ * postMessage: vi.fn(),
2130
+ * terminate: vi.fn()
2131
+ * })),
2132
+ * isMainThread: true,
2133
+ * parentPort: null,
2134
+ * workerData: { task: 'process' },
2135
+ * threadId: 0,
2136
+ * resourceLimits: {},
2137
+ * getEnvironmentData: vi.fn(),
2138
+ * setEnvironmentData: vi.fn(),
2139
+ * SHARE_ENV: Symbol('SHARE_ENV'),
2140
+ * markAsUntransferable: vi.fn(),
2141
+ * moveMessagePortToContext: vi.fn(),
2142
+ * receiveMessageOnPort: vi.fn()
2143
+ * };
2144
+ * ```
1937
2145
  */
1938
2146
  export interface MockWorkerThreads {
1939
- /** Worker constructor */
1940
- Worker: Vitest.MockInstance;
1941
- /** Is main thread */
2147
+ Worker: Vitest.Mock;
1942
2148
  isMainThread: boolean;
1943
- /** Parent port */
1944
2149
  parentPort: unknown;
1945
- /** Worker data */
1946
2150
  workerData: unknown;
1947
- /** Thread ID */
1948
2151
  threadId: number;
2152
+ resourceLimits: Record<string, unknown>;
2153
+ getEnvironmentData: Vitest.Mock<() => unknown>;
2154
+ setEnvironmentData: Vitest.Mock<(key: string, value: unknown) => void>;
2155
+ SHARE_ENV: symbol;
2156
+ markAsUntransferable: Vitest.Mock<(obj: unknown) => void>;
2157
+ moveMessagePortToContext: Vitest.Mock<(port: unknown, context: unknown) => unknown>;
2158
+ receiveMessageOnPort: Vitest.Mock<(port: unknown) => unknown>;
1949
2159
  }