@types/tape
Advanced tools
Comparing version 5.6.5 to 5.7.0
/// <reference types="node" /> | ||
import Through = require("@ljharb/through"); | ||
import mockProperty = require("mock-property"); | ||
@@ -267,5 +268,68 @@ /** | ||
teardown(callback: () => void | Promise<void>): void; | ||
captureFn<X extends SyncOrAsyncCallback>(this: Test, original: X): WrappedFn<X>; | ||
// eslint-disable-next-line @definitelytyped/no-unnecessary-generics | ||
capture<T extends SyncOrAsyncCallback>( | ||
this: Test, | ||
obj: Record<PropertyKey, unknown> | unknown[], | ||
method: PropertyKey, | ||
implementation?: T, | ||
): WrapResults; | ||
intercept( | ||
obj: Record<PropertyKey, unknown> | unknown[], | ||
property: PropertyKey, | ||
desc?: PropertyDescriptor, | ||
): InterceptResults; | ||
} | ||
export type SyncCallback = (...args: unknown[]) => unknown; | ||
export type SyncOrAsyncCallback = (...args: unknown[]) => unknown; | ||
export interface ReturnCall { | ||
args: unknown[]; | ||
receiver: {}; | ||
returned: unknown; | ||
} | ||
export interface ThrowCall { | ||
args: unknown[]; | ||
receiver: {}; | ||
threw: true; | ||
} | ||
export interface Call { | ||
type: "get" | "set"; | ||
success: boolean; | ||
value: unknown; | ||
args: unknown[]; | ||
receiver: unknown; | ||
} | ||
export type RestoreFunction = ReturnType<typeof mockProperty>; | ||
export interface WrapResults { | ||
(): WrappedCall[]; | ||
restore?: RestoreFunction; | ||
} | ||
export interface WrappedFn<T extends SyncOrAsyncCallback> { | ||
(this: ThisParameterType<T>, ...args: Parameters<T>): ReturnType<T>; | ||
calls?: WrappedCall[]; | ||
} | ||
export interface WrapObject<T extends SyncOrAsyncCallback> { | ||
__proto__: null; | ||
wrapped: WrappedFn<T>; | ||
calls: WrappedCall[]; | ||
results: WrapResults; | ||
} | ||
export type WrappedCall = ReturnCall | ThrowCall; | ||
export interface InterceptResults { | ||
(): Call[]; | ||
restore: RestoreFunction; | ||
} | ||
} | ||
export = tape; |
{ | ||
"name": "@types/tape", | ||
"version": "5.6.5", | ||
"version": "5.7.0", | ||
"description": "TypeScript definitions for tape", | ||
@@ -56,7 +56,8 @@ "homepage": "https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/tape", | ||
"@types/node": "*", | ||
"@ljharb/through": "*" | ||
"@ljharb/through": "*", | ||
"mock-property": "*" | ||
}, | ||
"peerDependencies": {}, | ||
"typesPublisherContentHash": "0c08168cb0435022da363a8d7f46f19766c92669398446fb9e3fd86e3d2e3336", | ||
"typesPublisherContentHash": "1326a5c2585088003459d11b2fdfc0d1bf77682f94cf30e6076590a5f74fe4cc", | ||
"typeScriptVersion": "5.0" | ||
} |
@@ -11,6 +11,6 @@ # Installation | ||
### Additional Details | ||
* Last updated: Wed, 27 Nov 2024 01:29:49 GMT | ||
* Dependencies: [@ljharb/through](https://npmjs.com/package/@ljharb/through), [@types/node](https://npmjs.com/package/@types/node) | ||
* Last updated: Fri, 13 Dec 2024 22:02:20 GMT | ||
* Dependencies: [@ljharb/through](https://npmjs.com/package/@ljharb/through), [@types/node](https://npmjs.com/package/@types/node), [mock-property](https://npmjs.com/package/mock-property) | ||
# Credits | ||
These definitions were written by [Bart van der Schoor](https://github.com/Bartvds), [Haoqun Jiang](https://github.com/sodatea), [Dennis Schwartz](https://github.com/DennisSchwartz), [Michael Henretty](https://github.com/mikehenrty), [Rafał Ostrowski](https://github.com/rostrowski), and [Jordan Harband](https://github.com/ljharb). |
Wildcard dependency
QualityPackage has a dependency with a floating version range. This can cause issues if the dependency publishes a new major version.
Found 1 instance in 1 package
18117
334
3
2
+ Addedmock-property@*
+ Addedfunctions-have-names@1.2.3(transitive)
+ Addedisarray@2.0.5(transitive)
+ Addedmock-property@1.1.0(transitive)
+ Addedobject-inspect@1.13.4(transitive)