mirror of
https://github.com/gosticks/DefinitelyTyped.git
synced 2026-08-12 21:10:23 +00:00
Add types for path-type
This commit is contained in:
Vendored
+15
@@ -0,0 +1,15 @@
|
||||
// Type definitions for path-type 3.0
|
||||
// Project: https://github.com/sindresorhus/path-type#readme
|
||||
// Definitions by: BendingBender <https://github.com/BendingBender>
|
||||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
||||
|
||||
export const file: PathTypeFn;
|
||||
export const dir: PathTypeFn;
|
||||
export const symlink: PathTypeFn;
|
||||
|
||||
export const fileSync: PathTypeSyncFn;
|
||||
export const dirSync: PathTypeSyncFn;
|
||||
export const symlinkSync: PathTypeSyncFn;
|
||||
|
||||
export type PathTypeFn = (path: string) => Promise<boolean>;
|
||||
export type PathTypeSyncFn = (path: string) => boolean;
|
||||
@@ -0,0 +1,15 @@
|
||||
import pathType = require('path-type');
|
||||
|
||||
// $ExpectType Promise<boolean>
|
||||
pathType.file('package.json');
|
||||
// $ExpectType Promise<boolean>
|
||||
pathType.dir('package.json');
|
||||
// $ExpectType Promise<boolean>
|
||||
pathType.symlink('package.json');
|
||||
|
||||
// $ExpectType boolean
|
||||
pathType.fileSync('package.json');
|
||||
// $ExpectType boolean
|
||||
pathType.dirSync('package.json');
|
||||
// $ExpectType boolean
|
||||
pathType.symlinkSync('package.json');
|
||||
@@ -0,0 +1,23 @@
|
||||
{
|
||||
"compilerOptions": {
|
||||
"module": "commonjs",
|
||||
"lib": [
|
||||
"es6"
|
||||
],
|
||||
"noImplicitAny": true,
|
||||
"noImplicitThis": true,
|
||||
"strictNullChecks": true,
|
||||
"strictFunctionTypes": true,
|
||||
"baseUrl": "../",
|
||||
"typeRoots": [
|
||||
"../"
|
||||
],
|
||||
"types": [],
|
||||
"noEmit": true,
|
||||
"forceConsistentCasingInFileNames": true
|
||||
},
|
||||
"files": [
|
||||
"index.d.ts",
|
||||
"path-type-tests.ts"
|
||||
]
|
||||
}
|
||||
@@ -0,0 +1 @@
|
||||
{ "extends": "dtslint/dt.json" }
|
||||
Reference in New Issue
Block a user