aboutsummaryrefslogtreecommitdiffstats
path: root/web_src/js/types.ts
blob: 317719fad5c95f3d8b2218a021cbbceb6230c896 (plain)
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
export type MentionValue = {
  key: string,
  value: string,
  name: string,
  fullname: string,
  avatar: string,
}

export type Config = {
  appUrl: string,
  appSubUrl: string,
  assetVersionEncoded: string,
  assetUrlPrefix: string,
  runModeIsProd: boolean,
  customEmojis: Record<string, string>,
  csrfToken: string,
  pageData: Record<string, any>,
  notificationSettings: Record<string, any>,
  enableTimeTracking: boolean,
  mentionValues?: MentionValue[],
  mermaidMaxSourceCharacters: number,
  i18n: Record<string, string>,
}

export type Intent = 'error' | 'warning' | 'info';

export type RequestData = string | FormData | URLSearchParams;

export type RequestOpts = {
  data?: RequestData,
} & RequestInit;

export type IssuePathInfo = {
  ownerName: string,
  repoName: string,
  pathType: string,
  indexString?: string,
}

export type IssuePageInfo = {
  repoLink: string,
  repoId: number,
  issueNumber: number,
  issueDependencySearchType: string,
}

export type Issue = {
  id: number;
  number: number;
  title: string;
  state: 'open' | 'closed';
  pull_request?: {
    draft: boolean;
    merged: boolean;
  };
};

export type FomanticInitFunction = {
  settings?: Record<string, any>,
  (...args: any[]): any,
}