-
-
Notifications
You must be signed in to change notification settings - Fork 3
/
index.d.ts
78 lines (61 loc) · 1.54 KB
/
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
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
import {MergeExclusive} from 'type-fest';
export interface BaseOptions {
/**
The tag name of the release.
*/
readonly tag?: string;
/**
The branch name or commit SHA to point the release's tag at, if the tag doesn't already exist.
Default: The default branch.
*/
readonly target?: string;
/**
The title of the release.
GitHub shows the `tag` name when not specified.
*/
readonly title?: string;
/**
The description text of the release.
*/
readonly body?: string;
/**
Whether the release should be marked as a pre-release.
@default false
*/
readonly isPrerelease?: boolean;
}
export interface RepoUrlOptions extends BaseOptions {
/**
The full URL to the repo.
*/
readonly repoUrl: string;
}
export interface UserRepoOptions extends BaseOptions {
/**
GitHub username or organization.
*/
readonly user: string;
/**
GitHub repo.
*/
readonly repo: string;
}
export type Options = MergeExclusive<RepoUrlOptions, UserRepoOptions>;
/**
Generate a URL for opening a new GitHub release with prefilled tag, body, and other fields.
@returns A URL string.
@example
```
import newGithubReleaseUrl from 'new-github-release-url';
import open from 'open';
const url = newGithubReleaseUrl({
user: 'sindresorhus',
repo: 'new-github-release-url',
body: '\n\n\n---\nI\'m a human. Please be nice.'
});
//=> 'https://github.com/sindresorhus/new-github-release-url/releases/new?body=%0A%0A%0A---%0AI%27m+a+human.+Please+be+nice.'
// Then open it
await open(url);
```
*/
export default function newGithubReleaseUrl(options: Options): string;