Merge pull request #21739 from tai2/ignore-styles

[ignore-styles] new package
This commit is contained in:
Armando Aguirre
2017-12-01 15:58:10 -08:00
committed by GitHub
4 changed files with 63 additions and 0 deletions

View File

@@ -0,0 +1,15 @@
import register, { DEFAULT_EXTENSIONS, oldHandlers, noOp, restore } from 'ignore-styles';
register(['.css'], (module, filename) => {}); // $ExpectType void
register(['.css']); // $ExpectType void
register(undefined, (module, filename) => {}); // $ExpectType void
register([1], (module, filename) => {}); // $ExpectError
register(['.css'], 1); // $ExpectError
DEFAULT_EXTENSIONS[0]; // $ExpectType string
oldHandlers['.css']; // $ExpectType Handler
noOp(); // $ExpectType void
restore(); // $ExpectType void

24
types/ignore-styles/index.d.ts vendored Normal file
View File

@@ -0,0 +1,24 @@
// Type definitions for ignore-styles 5.0
// Project: https://github.com/bkonkle/ignore-styles
// Definitions by: Taiju Muto <https://github.com/tai2>
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
// TypeScript Version: 2.4
/// <reference types='node' />
export type Handler = (m: NodeModule, filename: string) => any;
export const DEFAULT_EXTENSIONS: string[];
export let oldHandlers: {
[ext: string]: Handler
};
export function noOp(): void;
export function restore(): void;
export default function register(
extensions?: string[],
handler?: Handler
): void;

View File

@@ -0,0 +1,23 @@
{
"compilerOptions": {
"module": "commonjs",
"lib": [
"es6"
],
"noImplicitAny": true,
"noImplicitThis": true,
"strictFunctionTypes": true,
"strictNullChecks": true,
"baseUrl": "../",
"typeRoots": [
"../"
],
"types": [],
"noEmit": true,
"forceConsistentCasingInFileNames": true
},
"files": [
"index.d.ts",
"ignore-styles-tests.ts"
]
}

View File

@@ -0,0 +1 @@
{ "extends": "dtslint/dt.json" }