Brunobkr/llama.cpp_AlgMor24_github
ΩFFFΣLLIa • llama.cpp • AlgMor24 ██████╗ ███████╗███████╗███████╗██╗ ██╗ ██╗ █████╗ ██╔═══██╗██╔════╝██╔════╝██╔════╝██║ ██║ ██║██╔══██╗ ██║ ██║█████╗ █████╗ █████╗ ██║ ██║ ██║███████║ ██║ ██║██╔══╝ ██╔══╝ ██╔══╝ ██║ ██║ ██║██╔══██║ ╚██████╔╝██║ ██║ ███████╗███████╗███████╗██║██║ ██║ ╚═════╝ ╚═╝ ╚═╝ ╚══════╝╚══════╝╚══════╝╚═╝╚═╝ ╚═╝ High-Performance LLM / VLM Inference & Autonomous Agentic Ecosystem… See the full description on the dataset page: https://huggingface.co/datasets/Brunobkr/llama.cpp_AlgMor24_github.
03.1k
1import { M as ModuleDefinitionDurationsDiagnostic, U as UntrackedModuleDefinitionDiagnostic, S as SerializedTestSpecification, a as ModuleDefinitionDiagnostic, b as ModuleDefinitionLocation, c as SourceModuleDiagnostic, d as SourceModuleLocations } from './chunks/browser.d.BcoexmFG.js';2export { B as BrowserTesterOptions } from './chunks/browser.d.BcoexmFG.js';3import './chunks/global.d.DVsSRdQ5.js';4import { File, TestAnnotation, TestArtifact, TaskResultPack, TaskEventPack, Test, TaskPopulated } from '@vitest/runner';5export { CancelReason, ImportDuration, OnTestFailedHandler, OnTestFinishedHandler, RunMode, Task as RunnerTask, TaskBase as RunnerTaskBase, TaskEventPack as RunnerTaskEventPack, TaskResult as RunnerTaskResult, TaskResultPack as RunnerTaskResultPack, Test as RunnerTestCase, File as RunnerTestFile, Suite as RunnerTestSuite, SuiteAPI, SuiteCollector, SuiteFactory, SuiteOptions, TaskCustomOptions, TaskMeta, TaskState, TestAPI, TestAnnotation, TestAnnotationArtifact, TestArtifact, TestArtifactBase, TestArtifactLocation, TestArtifactRegistry, TestAttachment, TestContext, TestFunction, TestOptions, VitestRunnerConfig as TestRunnerConfig, TestTags, VitestRunner as VitestTestRunner, afterAll, afterEach, aroundAll, aroundEach, beforeAll, beforeEach, describe, it, onTestFailed, onTestFinished, recordArtifact, suite, test } from '@vitest/runner';6import { Awaitable } from '@vitest/utils';7export { ParsedStack, SerializedError, TestError } from '@vitest/utils';8import { b as BirpcReturn } from './chunks/worker.d.ZpHpO4yb.js';9export { C as ContextRPC, c as ContextTestEnvironment, T as TestExecutionMethod, W as WorkerGlobalState } from './chunks/worker.d.ZpHpO4yb.js';10import { b as SerializedRootConfig, F as FakeTimerInstallOpts, R as RuntimeOptions } from './chunks/config.d.A1h_Y6Jt.js';11export { c as RuntimeConfig, S as SerializedConfig, a as SerializedCoverageConfig } from './chunks/config.d.A1h_Y6Jt.js';12import { U as UserConsoleLog, L as LabelColor, M as ModuleGraphData, P as ProvidedContext } from './chunks/traces.d.D2T_R8rx.js';13export { a as AfterSuiteRunMeta } from './chunks/traces.d.D2T_R8rx.js';14import { ExpectStatic, MatcherState, SyncExpectationResult, AsyncExpectationResult, ExpectationResult } from '@vitest/expect';15export { Assertion, AsymmetricMatchersContaining, DeeplyAllowMatchers, ExpectPollOptions, ExpectStatic, JestAssertion, RawMatcherFn as Matcher, ExpectationResult as MatcherResult, MatcherState, Matchers, chai } from '@vitest/expect';16import { DomainSnapshotAdapter } from '@vitest/snapshot';17export { SnapshotData, SnapshotMatchOptions, SnapshotResult, SnapshotSerializer, SnapshotStateOptions, SnapshotSummary, SnapshotUpdateState, UncheckedSnapshot } from '@vitest/snapshot';18import { spyOn, fn, MaybeMockedDeep, MaybeMocked, MaybePartiallyMocked, MaybePartiallyMockedDeep, MockInstance } from '@vitest/spy';19export { Mock, MockContext, MockInstance, MockResult, MockResultIncomplete, MockResultReturn, MockResultThrow, MockSettledResult, MockSettledResultFulfilled, MockSettledResultIncomplete, MockSettledResultRejected, Mocked, MockedClass, MockedFunction, MockedObject } from '@vitest/spy';20import { Disposable } from 'vitest/optional-runtime-types.js';21import { ModuleMockFactoryWithHelper, ModuleMockOptions } from '@vitest/mocker';22export { b as bench } from './chunks/suite.d.udJtyAgw.js';23export { V as EvaluatedModules } from './chunks/evaluatedModules.d.BxJ5omdx.js';24export { NodeBenchmarkRunner as BenchmarkRunner, VitestTestRunner as TestRunner } from './runners.js';25export { a as BenchFunction, b as Benchmark, c as BenchmarkAPI, B as BenchmarkResult } from './chunks/benchmark.d.DAaHLpsq.js';26export { ExpectTypeOf, expectTypeOf } from 'expect-type';27export { a as RunnerRPC, R as RuntimeRPC } from './chunks/rpc.d.B_8sPU0w.js';28export { DiffOptions } from '@vitest/utils/diff';29export { Bench as BenchFactory, Options as BenchOptions, Task as BenchTask, TaskResult as BenchTaskResult } from 'tinybench';30import '@vitest/pretty-format';31import 'vite/module-runner';32import './chunks/environment.d.CrsxCzP1.js';33import '@vitest/runner/utils';34 35interface SourceMap {36 file: string;37 mappings: string;38 names: string[];39 sources: string[];40 sourcesContent?: string[];41 version: number;42 toString: () => string;43 toUrl: () => string;44}45interface ExternalResult {46 source?: string;47}48interface TransformResultWithSource {49 code: string;50 map: SourceMap | {51 mappings: "";52 } | null;53 etag?: string;54 deps?: string[];55 dynamicDeps?: string[];56 source?: string;57 transformTime?: number;58 modules?: ModuleDefinitionDurationsDiagnostic[];59 untrackedModules?: UntrackedModuleDefinitionDiagnostic[];60}61interface WebSocketHandlers {62 getFiles: () => File[];63 getTestFiles: () => Promise<SerializedTestSpecification[]>;64 getPaths: () => string[];65 getConfig: () => SerializedRootConfig;66 /**67 * @deprecated Use `getConfig().projects` instead.68 */69 getResolvedProjectLabels: () => {70 name: string;71 color?: LabelColor;72 }[];73 getModuleGraph: (projectName: string, id: string, browser?: boolean) => Promise<ModuleGraphData>;74 getTransformResult: (projectName: string, id: string, testFileId: string, browser?: boolean) => Promise<TransformResultWithSource | undefined>;75 getExternalResult: (id: string, testFileId: string) => Promise<ExternalResult | undefined>;76 readTestFile: (id: string) => Promise<string | null>;77 saveTestFile: (id: string, content: string) => Promise<void>;78 rerun: (files: string[], resetTestNamePattern?: boolean) => Promise<void>;79 rerunTask: (id: string) => Promise<void>;80 updateSnapshot: (file?: File) => Promise<void>;81 getUnhandledErrors: () => unknown[];82}83interface WebSocketEvents {84 onCollected?: (files?: File[]) => Awaitable<void>;85 onFinished?: (files: File[], errors: unknown[], coverage?: unknown, executionTime?: number) => Awaitable<void>;86 onTestAnnotate?: (testId: string, annotation: TestAnnotation) => Awaitable<void>;87 onTestArtifactRecord?: (testId: string, artifact: TestArtifact) => Awaitable<void>;88 onTaskUpdate?: (packs: TaskResultPack[], events: TaskEventPack[]) => Awaitable<void>;89 onUserConsoleLog?: (log: UserConsoleLog) => Awaitable<void>;90 onPathsCollected?: (paths?: string[]) => Awaitable<void>;91 onSpecsCollected?: (specs?: SerializedTestSpecification[], startTime?: number) => Awaitable<void>;92 onFinishedReportCoverage: () => void;93}94type WebSocketRPC = BirpcReturn<WebSocketEvents, WebSocketHandlers>;95 96declare function createExpect(test?: Test | TaskPopulated): ExpectStatic;97declare const globalExpect: ExpectStatic;98declare const assert: Chai.Assert;99declare const should: () => Chai.Should;100 101/**102* Gives access to injected context provided from the main thread.103* This usually returns a value provided by `globalSetup` or an external library.104*/105declare function inject<T extends keyof ProvidedContext & string>(key: T): ProvidedContext[T];106 107/**108* Composable snapshot matcher helpers for building custom snapshot matchers109* with `expect.extend`.110*111* @experimental112* @see https://vitest.dev/guide/snapshot.html#custom-snapshot-matchers113*/114declare const Snapshots: {115 /**116 * Composable for building custom snapshot matchers via `expect.extend`.117 * Call with `this` bound to the matcher state. Returns `{ pass, message }`118 * compatible with the custom matcher return contract.119 *120 * @example121 * ```ts122 * import { Snapshots } from 'vitest/runtime'123 *124 * expect.extend({125 * toMatchTrimmedSnapshot(received: string) {126 * return Snapshots.toMatchSnapshot.call(this, received.slice(0, 10))127 * },128 * })129 * ```130 *131 * @experimental132 * @see https://vitest.dev/guide/snapshot.html#custom-snapshot-matchers133 */134 toMatchSnapshot(this: MatcherState, received: unknown, propertiesOrHint?: object | string, hint?: string): SyncExpectationResult;135 /**136 * Composable for building custom inline snapshot matchers via `expect.extend`.137 * Call with `this` bound to the matcher state. Returns `{ pass, message }`138 * compatible with the custom matcher return contract.139 *140 * @example141 * ```ts142 * import { Snapshots } from 'vitest/runtime'143 *144 * expect.extend({145 * toMatchTrimmedInlineSnapshot(received: string, inlineSnapshot?: string) {146 * return Snapshots.toMatchInlineSnapshot.call(this, received.slice(0, 10), inlineSnapshot)147 * },148 * })149 * ```150 *151 * @experimental152 * @see https://vitest.dev/guide/snapshot.html#custom-snapshot-matchers153 */154 toMatchInlineSnapshot(this: MatcherState, received: unknown, propertiesOrInlineSnapshot?: object | string, inlineSnapshotOrHint?: string, hint?: string): SyncExpectationResult;155 /**156 * Composable for building custom file snapshot matchers via `expect.extend`.157 * Call with `this` bound to the matcher state. Returns a `Promise<{ pass, message }>`158 * compatible with the custom matcher return contract.159 *160 * @example161 * ```ts162 * import { Snapshots } from 'vitest/runtime'163 *164 * expect.extend({165 * async toMatchTrimmedFileSnapshot(received: string, file: string) {166 * return Snapshots.toMatchFileSnapshot.call(this, received.slice(0, 10), file)167 * },168 * })169 * ```170 *171 * @experimental172 * @see https://vitest.dev/guide/snapshot.html#custom-snapshot-matchers173 */174 toMatchFileSnapshot(this: MatcherState, received: unknown, filepath: string, hint?: string): AsyncExpectationResult;175 /**176 * Composable for building custom domain-based snapshot matchers via `expect.extend`.177 *178 * Call this from a matcher and pass the domain adapter that defines capture,179 * rendering, parsing, and semantic matching behavior.180 *181 * @experimental182 */183 toMatchDomainSnapshot(this: MatcherState, domain: DomainSnapshotAdapter<any, any>, received: unknown): ExpectationResult;184 /**185 * Composable for building custom domain-based inline snapshot matchers via `expect.extend`.186 *187 * Call this from a matcher and pass the domain adapter that defines capture,188 * rendering, parsing, and semantic matching behavior.189 *190 * @experimental191 */192 toMatchDomainInlineSnapshot(this: MatcherState, domain: DomainSnapshotAdapter<any, any>, received: unknown, inlineSnapshot?: string): ExpectationResult;193};194 195type WaitForCallback<T> = () => T | Promise<T>;196interface WaitForOptions {197 /**198 * @description Time in ms between each check callback199 * @default 50ms200 */201 interval?: number;202 /**203 * @description Time in ms after which the throw a timeout error204 * @default 1000ms205 */206 timeout?: number;207}208declare function waitFor<T>(callback: WaitForCallback<T>, options?: number | WaitForOptions): Promise<T>;209type WaitUntilCallback<T> = () => T | Promise<T>;210interface WaitUntilOptions extends Pick<WaitForOptions, "interval" | "timeout"> {}211type Truthy<T> = T extends false | "" | 0 | null | undefined ? never : T;212declare function waitUntil<T>(callback: WaitUntilCallback<T>, options?: number | WaitUntilOptions): Promise<Truthy<T>>;213 214type ESModuleExports = Record<string, unknown>;215interface VitestUtils {216 /**217 * Checks if fake timers are enabled.218 */219 isFakeTimers: () => boolean;220 /**221 * This method wraps all further calls to timers until [`vi.useRealTimers()`](https://vitest.dev/api/vi#vi-userealtimers) is called.222 */223 useFakeTimers: (config?: FakeTimerInstallOpts) => VitestUtils;224 /**225 * Restores mocked timers to their original implementations. All timers that were scheduled before will be discarded.226 */227 useRealTimers: () => VitestUtils;228 /**229 * This method will call every timer that was initiated after [`vi.useFakeTimers`](https://vitest.dev/api/vi#vi-usefaketimers) call.230 * It will not fire any timer that was initiated during its call.231 */232 runOnlyPendingTimers: () => VitestUtils;233 /**234 * This method will asynchronously call every timer that was initiated after [`vi.useFakeTimers`](https://vitest.dev/api/vi#vi-usefaketimers) call, even asynchronous ones.235 * It will not fire any timer that was initiated during its call.236 */237 runOnlyPendingTimersAsync: () => Promise<VitestUtils>;238 /**239 * This method will invoke every initiated timer until the timer queue is empty. It means that every timer called during `runAllTimers` will be fired.240 * If you have an infinite interval, it will throw after 10,000 tries (can be configured with [`fakeTimers.loopLimit`](https://vitest.dev/config/faketimers#faketimers-looplimit)).241 */242 runAllTimers: () => VitestUtils;243 /**244 * This method will asynchronously invoke every initiated timer until the timer queue is empty. It means that every timer called during `runAllTimersAsync` will be fired even asynchronous timers.245 * If you have an infinite interval, it will throw after 10 000 tries (can be configured with [`fakeTimers.loopLimit`](https://vitest.dev/config/faketimers#faketimers-looplimit)).246 */247 runAllTimersAsync: () => Promise<VitestUtils>;248 /**249 * Calls every microtask that was queued by `process.nextTick`. This will also run all microtasks scheduled by themselves.250 */251 runAllTicks: () => VitestUtils;252 /**253 * This method will invoke every initiated timer until the specified number of milliseconds is passed or the queue is empty - whatever comes first.254 */255 advanceTimersByTime: (ms: number) => VitestUtils;256 /**257 * This method will invoke every initiated timer until the specified number of milliseconds is passed or the queue is empty - whatever comes first. This will include and await asynchronously set timers.258 */259 advanceTimersByTimeAsync: (ms: number) => Promise<VitestUtils>;260 /**261 * Will call next available timer. Useful to make assertions between each timer call. You can chain call it to manage timers by yourself.262 */263 advanceTimersToNextTimer: () => VitestUtils;264 /**265 * Will call next available timer and wait until it's resolved if it was set asynchronously. Useful to make assertions between each timer call.266 */267 advanceTimersToNextTimerAsync: () => Promise<VitestUtils>;268 /**269 * Similar to [`vi.advanceTimersByTime`](https://vitest.dev/api/vi#vi-advancetimersbytime), but will advance timers by the milliseconds needed to execute callbacks currently scheduled with `requestAnimationFrame`.270 */271 advanceTimersToNextFrame: () => VitestUtils;272 /**273 * Get the number of waiting timers.274 */275 getTimerCount: () => number;276 /**277 * If fake timers are enabled, this method simulates a user changing the system clock (will affect date related API like `hrtime`, `performance.now` or `new Date()`) - however, it will not fire any timers.278 * If fake timers are not enabled, this method will only mock `Date.*` and `new Date()` calls.279 */280 setSystemTime: (time: number | string | Date) => VitestUtils;281 /**282 * Returns mocked current date. If date is not mocked the method will return `null`.283 */284 getMockedSystemTime: () => Date | null;285 /**286 * When using `vi.useFakeTimers`, `Date.now` calls are mocked. If you need to get real time in milliseconds, you can call this function.287 */288 getRealSystemTime: () => number;289 /**290 * Removes all timers that are scheduled to run. These timers will never run in the future.291 */292 clearAllTimers: () => VitestUtils;293 /**294 * Controls how fake timers are advanced.295 * @param mode The mode to use for advancing timers.296 * - `manual`: The default behavior. Timers will only advance when you call one of `vi.advanceTimers...()` methods.297 * - `nextTimerAsync`: Timers will be advanced automatically to the next available timer after each macrotask.298 * - `interval`: Timers are advanced automatically by a specified interval.299 * @param interval The interval in milliseconds to use when `mode` is `'interval'`.300 */301 setTimerTickMode: ((mode: "manual" | "nextTimerAsync") => VitestUtils) & ((mode: "interval", interval?: number) => VitestUtils);302 /**303 * Creates a spy on a method or getter/setter of an object similar to [`vi.fn()`](https://vitest.dev/api/vi#vi-fn). It returns a [mock function](https://vitest.dev/api/mock).304 * @example305 * ```ts306 * const cart = {307 * getApples: () => 42308 * }309 *310 * const spy = vi.spyOn(cart, 'getApples').mockReturnValue(10)311 *312 * expect(cart.getApples()).toBe(10)313 * expect(spy).toHaveBeenCalled()314 * expect(spy).toHaveReturnedWith(10)315 * ```316 */317 spyOn: typeof spyOn;318 /**319 * Creates a spy on a function, though can be initiated without one. Every time a function is invoked, it stores its call arguments, returns, and instances. Also, you can manipulate its behavior with [methods](https://vitest.dev/api/mock).320 *321 * If no function is given, mock will return `undefined`, when invoked.322 * @example323 * ```ts324 * const getApples = vi.fn(() => 0)325 *326 * getApples()327 *328 * expect(getApples).toHaveBeenCalled()329 * expect(getApples).toHaveReturnedWith(0)330 *331 * getApples.mockReturnValueOnce(5)332 *333 * expect(getApples()).toBe(5)334 * expect(getApples).toHaveNthReturnedWith(2, 5)335 * ```336 */337 fn: typeof fn;338 /**339 * Wait for the callback to execute successfully. If the callback throws an error or returns a rejected promise it will continue to wait until it succeeds or times out.340 *341 * This is very useful when you need to wait for some asynchronous action to complete, for example, when you start a server and need to wait for it to start.342 * @example343 * ```ts344 * const server = createServer()345 *346 * await vi.waitFor(347 * () => {348 * if (!server.isReady)349 * throw new Error('Server not started')350 *351 * console.log('Server started')352 * }, {353 * timeout: 500, // default is 1000354 * interval: 20, // default is 50355 * }356 * )357 * ```358 */359 waitFor: typeof waitFor;360 /**361 * Wraps a function to create an assertion helper. When an assertion fails inside the helper,362 * the error stack trace will point to where the helper was called, not inside the helper itself.363 * Works with both synchronous and asynchronous functions, and supports `expect.soft()`.364 *365 * @example366 * ```ts367 * const myEqual = vi.defineHelper((x, y) => {368 * expect(x).toEqual(y)369 * })370 *371 * test('example', () => {372 * myEqual('left', 'right') // Error points to this line373 * })374 * ```375 * Example output:376 * ```377 * FAIL example.test.ts > example378 * AssertionError: expected 'left' to deeply equal 'right'379 *380 * Expected: "right"381 * Received: "left"382 *383 * ❯ example.test.ts:6:3384 * 4| test('example', () => {385 * 5| myEqual('left', 'right')386 * | ^387 * 6| })388 * ```389 * @param fn The assertion function to wrap390 * @returns A wrapped function with the same signature391 */392 defineHelper: <F extends (...args: any) => any>(fn: F) => F;393 /**394 * This is similar to [`vi.waitFor`](https://vitest.dev/api/vi#vi-waitfor), but if the callback throws any errors, execution is immediately interrupted and an error message is received.395 *396 * If the callback returns a falsy value, the next check will continue until a truthy value is returned. This is useful when you need to wait for something to exist before taking the next step.397 * @example398 * ```ts399 * const element = await vi.waitUntil(400 * () => document.querySelector('.element'),401 * {402 * timeout: 500, // default is 1000403 * interval: 20, // default is 50404 * }405 * )406 *407 * // do something with the element408 * expect(element.querySelector('.element-child')).toBeTruthy()409 * ```410 */411 waitUntil: typeof waitUntil;412 /**413 * Run the factory before imports are evaluated. You can return a value from the factory414 * to reuse it inside your [`vi.mock`](https://vitest.dev/api/vi#vi-mock) factory and tests.415 *416 * If used with [`vi.mock`](https://vitest.dev/api/vi#vi-mock), both will be hoisted in the order they are defined in.417 */418 hoisted: <T>(factory: () => T) => T;419 /**420 * Mocks every import call to the module even if it was already statically imported.421 *422 * The call to `vi.mock` is hoisted to the top of the file, so you don't have access to variables declared in the global file scope423 * unless they are defined with [`vi.hoisted`](https://vitest.dev/api/vi#vi-hoisted) before this call.424 *425 * Mocking algorithm is described in [documentation](https://vitest.dev/guide/mocking/modules).426 * @param path Path to the module. Can be aliased, if your Vitest config supports it427 * @param factory Mocked module factory. The result of this function will be an exports object428 */429 mock(path: string, factory?: ModuleMockFactoryWithHelper | ModuleMockOptions): void;430 mock<T>(module: Promise<T>, factory?: ModuleMockFactoryWithHelper<T> | ModuleMockOptions): void;431 /**432 * Removes module from mocked registry. All calls to import will return the original module even if it was mocked before.433 *434 * This call is hoisted to the top of the file, so it will only unmock modules that were defined in `setupFiles`, for example.435 * @param path Path to the module. Can be aliased, if your Vitest config supports it436 */437 unmock(path: string): void;438 unmock(module: Promise<unknown>): void;439 /**440 * Mocks every subsequent [dynamic import](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/import) call.441 *442 * Unlike [`vi.mock`](https://vitest.dev/api/vi#vi-mock), this method will not mock statically imported modules because it is not hoisted to the top of the file.443 *444 * Mocking algorithm is described in [documentation](https://vitest.dev/guide/mocking/modules).445 * @param path Path to the module. Can be aliased, if your Vitest config supports it446 * @param factory Mocked module factory. The result of this function will be an exports object447 *448 * @returns A disposable object that calls {@link doUnmock()} when disposed449 */450 doMock(path: string, factory?: ModuleMockFactoryWithHelper | ModuleMockOptions): Disposable;451 doMock<T>(module: Promise<T>, factory?: ModuleMockFactoryWithHelper<T> | ModuleMockOptions): Disposable;452 /**453 * Removes module from mocked registry. All subsequent calls to import will return original module.454 *455 * Unlike [`vi.unmock`](https://vitest.dev/api/vi#vi-unmock), this method is not hoisted to the top of the file.456 * @param path Path to the module. Can be aliased, if your Vitest config supports it457 */458 doUnmock(path: string): void;459 doUnmock(module: Promise<unknown>): void;460 /**461 * Imports module, bypassing all checks if it should be mocked.462 * Can be useful if you want to mock module partially.463 * @example464 * ```ts465 * vi.mock('./example.js', async () => {466 * const axios = await vi.importActual<typeof import('./example.js')>('./example.js')467 *468 * return { ...axios, get: vi.fn() }469 * })470 * ```471 * @param path Path to the module. Can be aliased, if your config supports it472 */473 importActual: <T = ESModuleExports>(path: string) => Promise<T>;474 /**475 * Imports a module with all of its properties and nested properties mocked.476 *477 * Mocking algorithm is described in [documentation](https://vitest.dev/guide/mocking/modules).478 * @example479 * ```ts480 * const example = await vi.importMock<typeof import('./example.js')>('./example.js')481 * example.calc.mockReturnValue(10)482 * expect(example.calc()).toBe(10)483 * ```484 * @param path Path to the module. Can be aliased, if your config supports it485 * @returns Fully mocked module486 */487 importMock: <T = ESModuleExports>(path: string) => Promise<MaybeMockedDeep<T>>;488 /**489 * Deeply mocks properties and methods of a given object490 * in the same way as `vi.mock()` mocks module exports.491 *492 * @example493 * ```ts494 * const original = {495 * simple: () => 'value',496 * nested: {497 * method: () => 'real'498 * },499 * prop: 'foo',500 * }501 *502 * const mocked = vi.mockObject(original)503 * expect(mocked.simple()).toBe(undefined)504 * expect(mocked.nested.method()).toBe(undefined)505 * expect(mocked.prop).toBe('foo')506 *507 * mocked.simple.mockReturnValue('mocked')508 * mocked.nested.method.mockReturnValue('mocked nested')509 *510 * expect(mocked.simple()).toBe('mocked')511 * expect(mocked.nested.method()).toBe('mocked nested')512 *513 * const spied = vi.mockObject(original, { spy: true })514 * expect(spied.simple()).toBe('value')515 * expect(spied.simple).toHaveBeenCalled()516 * expect(spied.simple.mock.results[0]).toEqual({ type: 'return', value: 'value' })517 * ```518 *519 * @param value - The object to be mocked520 * @returns A deeply mocked version of the input object521 */522 mockObject: <T>(value: T, options?: ModuleMockOptions) => MaybeMockedDeep<T>;523 /**524 * Type helper for TypeScript. Just returns the object that was passed.525 *526 * When `partial` is `true` it will expect a `Partial<T>` as a return value. By default, this will only make TypeScript believe that527 * the first level values are mocked. You can pass down `{ partial: true, deep: true }` to make nested objects also partial recursively.528 * @example529 * ```ts530 * import example from './example.js'531 * vi.mock('./example.js')532 *533 * test('1 + 1 equals 10' async () => {534 * vi.mocked(example.calc).mockReturnValue(10)535 * expect(example.calc(1, '+', 1)).toBe(10)536 * })537 * ```538 * @param item Anything that can be mocked539 * @param deep If the object is deeply mocked540 * @param options If the object is partially or deeply mocked541 */542 mocked: (<T>(item: T, deep?: false) => MaybeMocked<T>) & (<T>(item: T, deep: true) => MaybeMockedDeep<T>) & (<T>(item: T, options: {543 partial?: false;544 deep?: false;545 }) => MaybeMocked<T>) & (<T>(item: T, options: {546 partial?: false;547 deep: true;548 }) => MaybeMockedDeep<T>) & (<T>(item: T, options: {549 partial: true;550 deep?: false;551 }) => MaybePartiallyMocked<T>) & (<T>(item: T, options: {552 partial: true;553 deep: true;554 }) => MaybePartiallyMockedDeep<T>) & (<T>(item: T) => MaybeMocked<T>);555 /**556 * Checks that a given parameter is a mock function. If you are using TypeScript, it will also narrow down its type.557 */558 isMockFunction: (fn: any) => fn is MockInstance;559 /**560 * Calls [`.mockClear()`](https://vitest.dev/api/mock#mockclear) on every mocked function.561 *562 * This will only empty `.mock` state, it will not affect mock implementations.563 *564 * This is useful if you need to clean up mocks between different assertions within a test.565 */566 clearAllMocks: () => VitestUtils;567 /**568 * Calls [`.mockReset()`](https://vitest.dev/api/mock#mockreset) on every mocked function.569 *570 * This will empty `.mock` state, reset "once" implementations, and reset each mock's base implementation to its original.571 *572 * This is useful when you want to reset all mocks to their original states.573 */574 resetAllMocks: () => VitestUtils;575 /**576 * Calls [`.mockRestore()`](https://vitest.dev/api/mock#mockrestore) on every mocked function.577 *578 * This will empty `.mock` state, restore all original mock implementations, and restore original descriptors of spied-on objects.579 *580 * This is useful for inter-test cleanup and/or removing mocks created by [`vi.spyOn(...)`](https://vitest.dev/api/vi#vi-spyon).581 */582 restoreAllMocks: () => VitestUtils;583 /**584 * Makes value available on global namespace.585 * Useful, if you want to have global variables available, like `IntersectionObserver`.586 * You can return it back to original value with `vi.unstubAllGlobals`, or by enabling `unstubGlobals` config option.587 */588 stubGlobal: (name: string | symbol | number, value: unknown) => VitestUtils;589 /**590 * Changes the value of `import.meta.env` and `process.env`.591 * You can return it back to original value with `vi.unstubAllEnvs`, or by enabling `unstubEnvs` config option.592 */593 stubEnv: <T extends string>(name: T, value: T extends "PROD" | "DEV" | "SSR" ? boolean : string | undefined) => VitestUtils;594 /**595 * Reset the value to original value that was available before first `vi.stubGlobal` was called.596 */597 unstubAllGlobals: () => VitestUtils;598 /**599 * Reset environmental variables to the ones that were available before first `vi.stubEnv` was called.600 */601 unstubAllEnvs: () => VitestUtils;602 /**603 * Resets modules registry by clearing the cache of all modules. This allows modules to be reevaluated when reimported.604 * Top-level imports cannot be re-evaluated. Might be useful to isolate modules where local state conflicts between tests.605 *606 * This method does not reset mocks registry. To clear mocks registry, use [`vi.unmock`](https://vitest.dev/api/vi#vi-unmock) or [`vi.doUnmock`](https://vitest.dev/api/vi#vi-dounmock).607 */608 resetModules: () => VitestUtils;609 /**610 * Wait for all imports to load. Useful, if you have a synchronous call that starts611 * importing a module that you cannot await otherwise.612 * Will also wait for new imports, started during the wait.613 */614 dynamicImportSettled: () => Promise<void>;615 /**616 * Updates runtime config. You can only change values that are used when executing tests.617 */618 setConfig: (config: RuntimeOptions) => void;619 /**620 * If config was changed with `vi.setConfig`, this will reset it to the original state().621 */622 resetConfig: () => void;623}624declare const vitest: VitestUtils;625declare const vi: VitestUtils;626 627interface AssertType {628 <T>(value: T): void;629}630declare const assertType: AssertType;631 632interface BrowserUI {633 setCurrentFileId: (fileId: string) => void;634 setIframeViewport: (width: number, height: number) => Promise<void>;635}636 637declare namespace Experimental {638 export { ModuleDefinitionDiagnostic, ModuleDefinitionDurationsDiagnostic, ModuleDefinitionLocation, SourceModuleDiagnostic, SourceModuleLocations, UntrackedModuleDefinitionDiagnostic };639}640 641export { Experimental, LabelColor, ModuleGraphData, ProvidedContext, SerializedRootConfig, SerializedTestSpecification, Snapshots, UserConsoleLog, assert, assertType, createExpect, globalExpect as expect, inject, should, vi, vitest };642export type { AssertType, BrowserUI, ExternalResult, TransformResultWithSource, VitestUtils, WebSocketEvents, WebSocketHandlers, WebSocketRPC };643 