mirror of
https://github.com/gosticks/DefinitelyTyped.git
synced 2026-10-06 15:57:13 +00:00
feat: add types for @rollup/plugin-virtual (#42688)
* feat: add types for @rollup/plugin-virtual * chore: rm 'node' from 'types' * chore: set typescript version to 2.9 * chore: set typescript version to 3.7 * chore: fix lint issues
This commit is contained in:
+21
@@ -0,0 +1,21 @@
|
||||
// Type definitions for @rollup/plugin-virtual 2.0
|
||||
// Project: https://github.com/rollup/plugins/tree/master/packages/virtual#readme
|
||||
// Definitions by: ed eustace <https://github.com/ahum>
|
||||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
||||
// TypeScript Version: 3.7
|
||||
|
||||
/// <reference types="node" />
|
||||
|
||||
import { Plugin } from 'rollup';
|
||||
|
||||
declare namespace virtual {
|
||||
interface Options {
|
||||
[filePath: string]: string;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* A Rollup plugin which loads virtual modules from memory.
|
||||
*/
|
||||
declare function virtual(options?: virtual.Options): Plugin;
|
||||
export = virtual;
|
||||
@@ -0,0 +1,6 @@
|
||||
{
|
||||
"private": true,
|
||||
"dependencies": {
|
||||
"rollup": "^1.31.1"
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,6 @@
|
||||
import virtual = require('@rollup/plugin-virtual');
|
||||
|
||||
virtual(); // $ExpectType Plugin
|
||||
|
||||
const options: virtual.Options = { 'path/to/file': '//hi' };
|
||||
virtual(options); // $ExpectType Plugin
|
||||
@@ -0,0 +1,26 @@
|
||||
{
|
||||
"compilerOptions": {
|
||||
"module": "commonjs",
|
||||
"lib": [
|
||||
"es6"
|
||||
],
|
||||
"noImplicitAny": true,
|
||||
"noImplicitThis": true,
|
||||
"strictFunctionTypes": true,
|
||||
"strictNullChecks": true,
|
||||
"baseUrl": "../",
|
||||
"typeRoots": [
|
||||
"../"
|
||||
],
|
||||
"types": [],
|
||||
"noEmit": true,
|
||||
"forceConsistentCasingInFileNames": true,
|
||||
"paths" : {
|
||||
"@rollup/plugin-virtual": ["rollup__plugin-virtual"]
|
||||
}
|
||||
},
|
||||
"files": [
|
||||
"index.d.ts",
|
||||
"rollup__plugin-virtual-tests.ts"
|
||||
]
|
||||
}
|
||||
@@ -0,0 +1 @@
|
||||
{ "extends": "dtslint/dt.json" }
|
||||
Reference in New Issue
Block a user