mirror of
https://github.com/zhigang1992/DefinitelyTyped.git
synced 2026-04-23 21:00:01 +08:00
Move all packages to a types directory
This commit is contained in:
27
types/webpack-validator/index.d.ts
vendored
Normal file
27
types/webpack-validator/index.d.ts
vendored
Normal file
@@ -0,0 +1,27 @@
|
||||
// Type definitions for webpack-validator v2.2.6
|
||||
// Project: https://github.com/js-dxtools/webpack-validator
|
||||
// Definitions by: Simon Hartcher <https://github.com/deevus>
|
||||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
||||
|
||||
///<reference types="webpack" />
|
||||
|
||||
declare module "webpack-validator" {
|
||||
import {Configuration} from "webpack";
|
||||
|
||||
interface ValidationOptions {
|
||||
"no-root-files-node-modules-nameclash"?: boolean;
|
||||
"loader-enforce-include-or-exclude"?: boolean;
|
||||
"loader-prefer-include"?: boolean;
|
||||
}
|
||||
|
||||
/**
|
||||
* Validate your webpack configs with joi
|
||||
*/
|
||||
function Validate(config: Configuration): Configuration;
|
||||
/**
|
||||
* Validate your webpack configs with joi
|
||||
*/
|
||||
function Validate(config: Configuration, options: ValidationOptions): Configuration;
|
||||
|
||||
export = Validate;
|
||||
}
|
||||
22
types/webpack-validator/tsconfig.json
Normal file
22
types/webpack-validator/tsconfig.json
Normal file
@@ -0,0 +1,22 @@
|
||||
{
|
||||
"compilerOptions": {
|
||||
"module": "commonjs",
|
||||
"lib": [
|
||||
"es6"
|
||||
],
|
||||
"noImplicitAny": true,
|
||||
"noImplicitThis": true,
|
||||
"strictNullChecks": false,
|
||||
"baseUrl": "../",
|
||||
"typeRoots": [
|
||||
"../"
|
||||
],
|
||||
"types": [],
|
||||
"noEmit": true,
|
||||
"forceConsistentCasingInFileNames": true
|
||||
},
|
||||
"files": [
|
||||
"index.d.ts",
|
||||
"webpack-validator-tests.ts"
|
||||
]
|
||||
}
|
||||
15
types/webpack-validator/webpack-validator-tests.ts
Normal file
15
types/webpack-validator/webpack-validator-tests.ts
Normal file
@@ -0,0 +1,15 @@
|
||||
import {Configuration} from "webpack";
|
||||
import validate = require("webpack-validator");
|
||||
|
||||
const a: Configuration = {
|
||||
entry: "test"
|
||||
}
|
||||
|
||||
const b = validate(a);
|
||||
const c = validate(b, {
|
||||
"no-root-files-node-modules-nameclash": true
|
||||
});
|
||||
const d = validate(b, {
|
||||
"loader-enforce-include-or-exclude": false,
|
||||
"loader-prefer-include": true
|
||||
});
|
||||
Reference in New Issue
Block a user