From 272664416ca15af46124651efb6bae3e839d2b87 Mon Sep 17 00:00:00 2001 From: Jamie Magee Date: Wed, 25 Sep 2019 21:43:01 +0200 Subject: [PATCH] feat: add typescript type definitions --- index.d.ts | 29 +++++++++++++++++++++++++++++ 1 file changed, 29 insertions(+) create mode 100644 index.d.ts diff --git a/index.d.ts b/index.d.ts new file mode 100644 index 0000000..9e53e19 --- /dev/null +++ b/index.d.ts @@ -0,0 +1,29 @@ +declare namespace githubUrlFromGit { + interface githubUrlFromGitOptions { + /** + * additional URLs that should be treated as GitHub repos + */ + extraBaseUrls?: string[]; + } + + /** + * Create a regular expression to parse GitHub URLs + * + * @param opts options for regular expression generator + */ + function re(opts?: githubUrlFromGitOptions): RegExp; +} + +/** + * Normalize Git URLs into GitHub URLs + * + * @param url Git URL to process + * @param opts options for URL parser + * @returns GitHub URL + */ +declare function githubUrlFromGit( + url: string, + opts?: githubUrlFromGit.githubUrlFromGitOptions +): string; + +export = githubUrlFromGit;