mirror of
https://github.com/gosticks/DefinitelyTyped.git
synced 2026-10-04 06:47:03 +00:00
Merge pull request #32524 from Kocal/feat/add-type-for-rollup-plugin-node-builtins
feat: add typings for rollup-plugin-node-builtins
This commit is contained in:
+16
@@ -0,0 +1,16 @@
|
||||
// Type definitions for rollup-plugin-node-builtins 2.1
|
||||
// Project: https://github.com/calvinmetcalf/rollup-plugin-node-builtins#readme
|
||||
// Definitions by: Hugo Alliaume <https://github.com/Kocal>
|
||||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
||||
// TypeScript Version: 2.3
|
||||
|
||||
/// <reference types="node" />
|
||||
|
||||
import { Plugin } from 'rollup';
|
||||
|
||||
export interface Options {
|
||||
crypto?: boolean;
|
||||
fs?: boolean;
|
||||
}
|
||||
|
||||
export default function builtins(options?: Options): Plugin;
|
||||
@@ -0,0 +1,6 @@
|
||||
{
|
||||
"private": true,
|
||||
"dependencies": {
|
||||
"rollup": "^0.63.4"
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,16 @@
|
||||
import builtins from 'rollup-plugin-node-builtins';
|
||||
|
||||
// No options (default)
|
||||
(() => {
|
||||
// $ExpectType Plugin
|
||||
builtins();
|
||||
})();
|
||||
|
||||
// With `crypto` and `fs` enabled
|
||||
(() => {
|
||||
// $ExpectType Plugin
|
||||
builtins({
|
||||
crypto: true,
|
||||
fs: true,
|
||||
});
|
||||
})();
|
||||
@@ -0,0 +1,23 @@
|
||||
{
|
||||
"compilerOptions": {
|
||||
"module": "commonjs",
|
||||
"lib": [
|
||||
"es6"
|
||||
],
|
||||
"noImplicitAny": true,
|
||||
"noImplicitThis": true,
|
||||
"strictNullChecks": true,
|
||||
"strictFunctionTypes": true,
|
||||
"baseUrl": "../",
|
||||
"typeRoots": [
|
||||
"../"
|
||||
],
|
||||
"types": [],
|
||||
"noEmit": true,
|
||||
"forceConsistentCasingInFileNames": true
|
||||
},
|
||||
"files": [
|
||||
"index.d.ts",
|
||||
"rollup-plugin-node-builtins-tests.ts"
|
||||
]
|
||||
}
|
||||
@@ -0,0 +1 @@
|
||||
{ "extends": "dtslint/dt.json" }
|
||||
Reference in New Issue
Block a user