-
Notifications
You must be signed in to change notification settings - Fork 8
/
macro.d.ts
47 lines (45 loc) · 1.16 KB
/
macro.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
/**
* A Babel plugin macro giving access to git information at compile time.
*/
declare module "react-git-info/macro" {
/**
* Information about a git commit.
*/
export interface GitCommitInformation {
/**
* Date of the commit as a string in strict ISO 8601 format.
*/
readonly date: string;
/**
* Full hash of the latest commit on the active branch.
*/
readonly hash: string;
/**
* Raw commit message.
*/
readonly message: string;
/**
* Abbreviated commit hash with length defined as `core.abbrev` in
* {@link https://git-scm.com/docs/git-config | git-config}.
*/
readonly shortHash: string;
}
export interface GitInformation {
/**
* Tags pointing to the current commit.
*/
readonly tags: string[];
/**
* The current git branch. `undefined` if the repository is in a detached HEAD state.
*/
readonly branch?: string;
/**
* Information about the commit pointed to by `HEAD`.
*/
readonly commit: GitCommitInformation;
}
/**
* Returns information about the current Git state.
*/
export default function GitInfo(): GitInformation;
}