@types/insert-module-globals
Advanced tools
Comparing version 7.0.3 to 7.0.4
@@ -1,6 +0,1 @@ | ||
// Type definitions for insert-module-globals 7.0 | ||
// Project: https://github.com/browserify/insert-module-globals | ||
// Definitions by: Leonard Thieu <https://github.com/leonard-thieu> | ||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped | ||
/// <reference types="node" /> | ||
@@ -7,0 +2,0 @@ |
{ | ||
"name": "@types/insert-module-globals", | ||
"version": "7.0.3", | ||
"version": "7.0.4", | ||
"description": "TypeScript definitions for insert-module-globals", | ||
@@ -10,4 +10,4 @@ "homepage": "https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/insert-module-globals", | ||
"name": "Leonard Thieu", | ||
"url": "https://github.com/leonard-thieu", | ||
"githubUsername": "leonard-thieu" | ||
"githubUsername": "leonard-thieu", | ||
"url": "https://github.com/leonard-thieu" | ||
} | ||
@@ -26,4 +26,4 @@ ], | ||
}, | ||
"typesPublisherContentHash": "5b27a16196872ab7f9e4b71e5c2714e16f2f4ab1c67db8d920df359901d2803e", | ||
"typesPublisherContentHash": "80fbf8eca8d7abc6cf3c9f98da78185faf511eeab84e96209e21e45b718f7067", | ||
"typeScriptVersion": "4.5" | ||
} |
@@ -9,9 +9,74 @@ # Installation | ||
Files were exported from https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/insert-module-globals. | ||
## [index.d.ts](https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/insert-module-globals/index.d.ts) | ||
````ts | ||
/// <reference types="node" /> | ||
import * as stream from "stream"; | ||
export = InsertModuleGlobals; | ||
interface InsertModuleGlobals { | ||
/** | ||
* Return a transform stream inserter for the filename file that will accept a javascript file as input and | ||
* will output the file with a closure around the contents as necessary to define extra builtins. | ||
*/ | ||
(file: string, opts?: InsertModuleGlobals.Options): stream.Transform; | ||
/** | ||
* Defaults | ||
*/ | ||
readonly vars: { | ||
process(file: string): string; | ||
global(): string; | ||
"Buffer.isBuffer"(file: string): string; | ||
Buffer(): string; | ||
__filename(file: string, basedir: string): string; | ||
__dirname(file: string, basedir: string): string; | ||
}; | ||
} | ||
declare const InsertModuleGlobals: InsertModuleGlobals; | ||
declare namespace InsertModuleGlobals { | ||
interface Options { | ||
/** | ||
* When opts.always is true, wrap every file with all the global variables without parsing. | ||
* This is handy because parsing the scope can take a long time, so you can prioritize fast builds over saving bytes in the final output. | ||
* When opts.always is truthy but not true, avoid parsing but perform a quick test to determine if wrapping should be skipped. | ||
*/ | ||
always?: boolean | undefined; | ||
/** | ||
* Use opts.vars to override the default inserted variables, or set opts.vars[name] to undefined to not insert a variable which would otherwise be inserted. | ||
* | ||
* opts.vars properties with a . in their name will be executed instead of the parent object if ONLY that property is used. | ||
* For example, "Buffer.isBuffer" will mask "Buffer" only when there is a Buffer.isBuffer() call in a file and no other references to Buffer. | ||
*/ | ||
vars?: VarsOption | undefined; | ||
/** | ||
* If opts.debug is true, an inline source map will be generated to compensate for the extra lines. | ||
*/ | ||
debug?: boolean | undefined; | ||
basedir?: string | undefined; | ||
} | ||
interface VarsOption { | ||
[name: string]: InsertFunction | undefined; | ||
} | ||
type InsertFunction = (file: string, basedir: string) => VariableConfig | string; | ||
interface VariableConfig { | ||
id: string; | ||
source: string; | ||
suffix?: string | undefined; | ||
} | ||
} | ||
```` | ||
### Additional Details | ||
* Last updated: Tue, 26 Sep 2023 14:36:22 GMT | ||
* Last updated: Wed, 18 Oct 2023 01:17:35 GMT | ||
* Dependencies: [@types/node](https://npmjs.com/package/@types/node) | ||
* Global values: none | ||
# Credits | ||
These definitions were written by [Leonard Thieu](https://github.com/leonard-thieu). |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
7434
82
53