mirror of
https://github.com/gosticks/DefinitelyTyped.git
synced 2025-10-16 12:05:41 +00:00
Added new type definition for aoo-root-dir
This commit is contained in:
parent
2e4aad4d1f
commit
08d820c93b
7
types/app-root-dir/app-root-dir-tests.ts
Normal file
7
types/app-root-dir/app-root-dir-tests.ts
Normal file
@ -0,0 +1,7 @@
|
||||
import * as rootDir from 'app-root-dir'
|
||||
|
||||
let appRootPath: string
|
||||
|
||||
rootDir.set(__dirname)
|
||||
appRootPath = rootDir.get()
|
||||
|
||||
21
types/app-root-dir/index.d.ts
vendored
Normal file
21
types/app-root-dir/index.d.ts
vendored
Normal file
@ -0,0 +1,21 @@
|
||||
import { interfaceExtends } from '../babel-types/index.d'
|
||||
// Type definitions for [ app-root-dir ] [ 1.0.2 ]
|
||||
// Project : [ https://github.com/philidem/node-app-root-dir ]
|
||||
// Definitions by: shaochenyang <https://github.com/chenyang-biu>
|
||||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
||||
|
||||
interface AppRootDir {
|
||||
// Get the application's root directory
|
||||
get(): string
|
||||
/**
|
||||
* Set the application's root directory
|
||||
* this will set a global so that no matter
|
||||
* how many instances of app-root-dir module are installed,
|
||||
* they will all return the same directory
|
||||
*/
|
||||
set(dirname: string): void
|
||||
}
|
||||
|
||||
declare const AppRootDir: AppRootDir
|
||||
|
||||
export = AppRootDir
|
||||
23
types/app-root-dir/tsconfig.json
Normal file
23
types/app-root-dir/tsconfig.json
Normal file
@ -0,0 +1,23 @@
|
||||
{
|
||||
"compilerOptions": {
|
||||
"module": "commonjs",
|
||||
"lib": [
|
||||
"es6"
|
||||
],
|
||||
"noImplicitAny": true,
|
||||
"noImplicitThis": true,
|
||||
"strictNullChecks": false,
|
||||
"strictFunctionTypes": true,
|
||||
"baseUrl": "../",
|
||||
"typeRoots": [
|
||||
"../"
|
||||
],
|
||||
"types": ["node"],
|
||||
"noEmit": true,
|
||||
"forceConsistentCasingInFileNames": true
|
||||
},
|
||||
"files": [
|
||||
"index.d.ts",
|
||||
"app-root-dir-tests.ts"
|
||||
]
|
||||
}
|
||||
3
types/app-root-dir/tslint.json
Normal file
3
types/app-root-dir/tslint.json
Normal file
@ -0,0 +1,3 @@
|
||||
{
|
||||
"extends": "dtslint/dt.json"
|
||||
}
|
||||
Loading…
Reference in New Issue
Block a user