mirror of
https://github.com/gosticks/DefinitelyTyped.git
synced 2025-10-16 12:05:41 +00:00
Add types for npm-cache-filename (#37866)
This commit is contained in:
parent
2ab45d486e
commit
37f050d65d
9
types/npm-cache-filename/index.d.ts
vendored
Normal file
9
types/npm-cache-filename/index.d.ts
vendored
Normal file
@ -0,0 +1,9 @@
|
||||
// Type definitions for npm-cache-filename 1.0
|
||||
// Project: https://github.com/npm/npm-cache-filename
|
||||
// Definitions by: Florian Keller <https://github.com/ffflorian>
|
||||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
||||
|
||||
declare function cf(root: string): (url: string) => string;
|
||||
declare function cf(root: string, url: string): string;
|
||||
|
||||
export = cf;
|
||||
6
types/npm-cache-filename/npm-cache-filename-tests.ts
Normal file
6
types/npm-cache-filename/npm-cache-filename-tests.ts
Normal file
@ -0,0 +1,6 @@
|
||||
import cf = require('npm-cache-filename');
|
||||
|
||||
cf('/tmp/cache', 'https://registry.npmjs.org:1234/foo/bar'); // $ExpectType string
|
||||
|
||||
const getFile = cf('/tmp/cache');
|
||||
getFile('https://registry.npmjs.org:1234/foo/bar'); // $ExpectType string
|
||||
23
types/npm-cache-filename/tsconfig.json
Normal file
23
types/npm-cache-filename/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",
|
||||
"npm-cache-filename-tests.ts"
|
||||
]
|
||||
}
|
||||
1
types/npm-cache-filename/tslint.json
Normal file
1
types/npm-cache-filename/tslint.json
Normal file
@ -0,0 +1 @@
|
||||
{ "extends": "dtslint/dt.json" }
|
||||
Loading…
Reference in New Issue
Block a user