@types/istanbul-lib-hook
TypeScript icon, indicating that this package has built-in type declarations

2.0.4 • Public • Published

Installation

npm install --save @types/istanbul-lib-hook

Summary

This package contains type definitions for istanbul-lib-hook (https://istanbul.js.org).

Details

Files were exported from https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/istanbul-lib-hook.

index.d.ts

export interface Options {
    verbose: boolean;
}

export interface HookRequireOptions extends Options {
    extensions: string[];
    postLoadHook(filename: string): void;
}

export function hookRequire(
    matcher: Matcher,
    transformer: Transformer,
    options?: Partial<HookRequireOptions>,
): () => void;

export function hookCreateScript(
    matcher: Matcher,
    transformer: Transformer,
    options?: Partial<Options>,
): void;

export function unhookCreateScript(): void;

export function hookRunInThisContext(
    matcher: Matcher,
    transformer: Transformer,
    options?: Partial<Options>,
): void;

export function unhookRunInThisContext(): void;

export function hookRunInContext(
    matcher: Matcher,
    transformer: Transformer,
    options?: Partial<HookRunInContextOptions>,
): void;

export function unhookRunInContext(): void;

export function unloadRequireCache(matcher: Matcher): void;

export type Matcher = (filename: string) => boolean;
export type Transformer = (code: string, options: TransformerOptions) => string;

export interface TransformerOptions {
    filename: string;
}

export interface HookRunInContextOptions extends Options {
    coverageVariable: string;
}

Additional Details

  • Last updated: Tue, 07 Nov 2023 03:09:37 GMT
  • Dependencies: none

Credits

These definitions were written by Jason Cheatham.

Readme

Keywords

none

Package Sidebar

Install

npm i @types/istanbul-lib-hook

Weekly Downloads

782

Version

2.0.4

License

MIT

Unpacked Size

5.01 kB

Total Files

5

Last publish

Collaborators

  • types