Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@types/rewire

Package Overview
Dependencies
Maintainers
1
Versions
14
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@types/rewire

TypeScript definitions for rewire

  • 2.5.30
  • ts4.5
  • ts4.6
  • ts4.7
  • ts4.8
  • ts4.9
  • ts5.0
  • ts5.1
  • ts5.2
  • ts5.3
  • ts5.4
  • ts5.5
  • ts5.6
  • ts5.7
  • ts5.8
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
35K
increased by7.19%
Maintainers
1
Weekly downloads
 
Created
Source

Installation

npm install --save @types/rewire

Summary

This package contains type definitions for rewire (https://github.com/jhnns/rewire).

Details

Files were exported from https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/rewire.

index.d.ts

declare namespace RewireInterfaces {
    interface RewiredModule {
        /**
         * Takes all enumerable keys of obj as variable names and sets the values respectively. Returns a function which can be called to revert the change.
         */
        __set__(obj: { [variable: string]: any }): () => void;
        /**
         * Sets the internal variable name to the given value. Returns a function which can be called to revert the change.
         */
        __set__(name: string, value: any): () => void;
        /**
         * Returns the private variable with the given name.
         */
        __get__<T = any>(name: string): T;
        /**
         * Returns a function which - when being called - sets obj, executes the given callback and reverts obj. If callback returns a promise, obj is only reverted after
         * the promise has been resolved or rejected. For your convenience the returned function passes the received promise through.
         */
        __with__(obj: { [variable: string]: any }): (callback: () => any) => any;
    }
}

/**
 * Returns a rewired version of the module found at filename. Use rewire() exactly like require().
 */
declare function rewire<T = { [key: string]: any }>(filename: string): RewireInterfaces.RewiredModule & T;
export = rewire;

Additional Details

  • Last updated: Tue, 07 Nov 2023 15:11:36 GMT
  • Dependencies: none

Credits

These definitions were written by Borislav Zhivkov, and Federico Caselli.

FAQs

Package last updated on 07 Nov 2023

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc