CallTracker.d.ts 681 B

12345678910111213141516171819202122232425
  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. */
  8. export declare type Context = {
  9. object: unknown;
  10. args: Array<unknown>;
  11. returnValue?: unknown;
  12. };
  13. declare class CallTracker {
  14. track: (context: Context) => void;
  15. any: () => boolean;
  16. count: () => number;
  17. argsFor: (index: number) => Array<unknown>;
  18. all: () => Array<Context>;
  19. allArgs: () => Array<unknown>;
  20. first: () => Context;
  21. mostRecent: () => Context;
  22. reset: () => void;
  23. constructor();
  24. }
  25. export default CallTracker;