web 3d图形渲染器
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

30 lines
1.0 KiB

  1. /**
  2. * Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved.
  3. *
  4. * This source code is licensed under the MIT license found in the
  5. * LICENSE file in the root directory of this source tree.
  6. */
  7. /// <reference types="node" />
  8. import { Context, Script } from 'vm';
  9. import type { JestEnvironment } from '@jest/environment';
  10. import { LegacyFakeTimers, ModernFakeTimers } from '@jest/fake-timers';
  11. import type { Config, Global } from '@jest/types';
  12. import { ModuleMocker } from 'jest-mock';
  13. declare type Timer = {
  14. id: number;
  15. ref: () => Timer;
  16. unref: () => Timer;
  17. };
  18. declare class NodeEnvironment implements JestEnvironment {
  19. context: Context | null;
  20. fakeTimers: LegacyFakeTimers<Timer> | null;
  21. fakeTimersModern: ModernFakeTimers | null;
  22. global: Global.Global;
  23. moduleMocker: ModuleMocker | null;
  24. constructor(config: Config.ProjectConfig);
  25. setup(): Promise<void>;
  26. teardown(): Promise<void>;
  27. runScript<T = unknown>(script: Script): T | null;
  28. getVmContext(): Context | null;
  29. }
  30. export = NodeEnvironment;