diff --git a/index.d.ts b/index.d.ts new file mode 100644 index 0000000..6b3ae48 --- /dev/null +++ b/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; +} diff --git a/package.json b/package.json index a708f57..3021dba 100644 --- a/package.json +++ b/package.json @@ -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", @@ -16,7 +17,8 @@ "test": "xo && ava" }, "files": [ - "index.js" + "index.js", + "index.d.ts" ], "keywords": [ "find",