/
index.d.ts
23 lines (18 loc) · 683 Bytes
/
index.d.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
/**
Shortens a GitHub URL string.
@param anchor An HTMLAnchorElement
@param url The GitHub URL to shorten.
@returns The shortened URL in HTML as a string
@example https://github.com/nodejs/node/tree/v0.12/doc becomes nodejs/node@<code>v0.12</code>
*/
declare function shortenRepoUrl(url: string, currentUrl?: string): string;
declare namespace shortenRepoUrl {
/**
Shortens a GitHub URL in a DOM anchor.
@param anchor An HTMLAnchorElement
@param url The GitHub URL to shorten.
@example https://github.com/nodejs/node/tree/v0.12/doc becomes nodejs/node@<code>v0.12</code>
*/
const applyToLink: (anchor: HTMLAnchorElement, url?: string) => void;
}
export = shortenRepoUrl;