Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Adding TS typings. #30

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
23 changes: 23 additions & 0 deletions index.d.ts
@@ -0,0 +1,23 @@
declare module 'find-up' {
export interface FindUpOptions {
readonly cwd?: string
}

/**
* Finds the file and then returns it its path
*
* @param filename Of the path to be find
* @param options Contains the directory to start from
* @returns The filepath
*/
export function sync(filename: string | string[], options?: FindUpOptions): string | null;

/**
* Finds the file and then returns it its path
*
* @param filename Of the path to be find
* @param options Contains the directory to start from
* @returns The filepath
*/
export default function findUp(filename: string | string[], options?: FindUpOptions): Promise<string | null>;
}
4 changes: 3 additions & 1 deletion package.json
Expand Up @@ -4,6 +4,7 @@
"description": "Find a file or directory by walking up parent directories",
"license": "MIT",
"repository": "sindresorhus/find-up",
"types": "index.d.ts",
"author": {
"name": "Sindre Sorhus",
"email": "sindresorhus@gmail.com",
Expand All @@ -16,7 +17,8 @@
"test": "xo && ava"
},
"files": [
"index.js"
"index.js",
"index.d.ts"
],
"keywords": [
"find",
Expand Down