mirror of
https://github.com/zhigang1992/DefinitelyTyped.git
synced 2026-05-30 18:43:21 +08:00
Merge pull request #21739 from tai2/ignore-styles
[ignore-styles] new package
This commit is contained in:
15
types/ignore-styles/ignore-styles-tests.ts
Normal file
15
types/ignore-styles/ignore-styles-tests.ts
Normal 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
24
types/ignore-styles/index.d.ts
vendored
Normal 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;
|
||||
23
types/ignore-styles/tsconfig.json
Normal file
23
types/ignore-styles/tsconfig.json
Normal 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"
|
||||
]
|
||||
}
|
||||
1
types/ignore-styles/tslint.json
Normal file
1
types/ignore-styles/tslint.json
Normal file
@@ -0,0 +1 @@
|
||||
{ "extends": "dtslint/dt.json" }
|
||||
Reference in New Issue
Block a user