forked from github/vscode-codeql
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathinterface-types.ts
More file actions
111 lines (91 loc) · 2.47 KB
/
interface-types.ts
File metadata and controls
111 lines (91 loc) · 2.47 KB
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
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
import * as sarif from 'sarif';
import { ResolvableLocationValue } from 'semmle-bqrs';
/**
* Only ever show this many results per run in interpreted results.
*/
export const INTERPRETED_RESULTS_PER_RUN_LIMIT = 100;
/**
* Only ever show this many rows in a raw result table.
*/
export const RAW_RESULTS_LIMIT = 10000;
export interface DatabaseInfo {
name: string;
databaseUri: string;
}
export interface PreviousExecution {
queryName: string;
time: string;
databaseName: string;
durationSeconds: number;
}
export interface Interpretation {
sourceLocationPrefix: string;
numTruncatedResults: number;
sarif: sarif.Log;
}
export interface ResultsInfo {
resultsPath: string;
interpretedResultsPath: string;
}
export interface SortedResultSetInfo {
resultsPath: string;
sortState: SortState;
}
export type SortedResultsMap = { [resultSet: string]: SortedResultSetInfo };
/**
* A message to indicate that the results are being updated.
*
* As a result of receiving this message, listeners might want to display a loading indicator.
*/
export interface ResultsUpdatingMsg {
t: 'resultsUpdating';
}
export interface SetStateMsg {
t: 'setState';
resultsPath: string;
sortedResultsMap: SortedResultsMap;
interpretation: undefined | Interpretation;
database: DatabaseInfo;
kind?: string;
/**
* Whether to keep displaying the old results while rendering the new results.
*
* This is useful to prevent properties like scroll state being lost when rendering the sorted results after sorting a column.
*/
shouldKeepOldResultsWhileRendering: boolean;
};
/** Advance to the next or previous path no in the path viewer */
export interface NavigatePathMsg {
t: 'navigatePath',
/** 1 for next, -1 for previous */
direction: number;
}
export type IntoResultsViewMsg = ResultsUpdatingMsg | SetStateMsg | NavigatePathMsg;
export type FromResultsViewMsg = ViewSourceFileMsg | ToggleDiagnostics | ChangeSortMsg | ResultViewLoaded;
interface ViewSourceFileMsg {
t: 'viewSourceFile';
loc: ResolvableLocationValue;
databaseUri: string;
};
interface ToggleDiagnostics {
t: 'toggleDiagnostics';
databaseUri: string;
resultsPath: string;
visible: boolean;
kind?: string;
};
interface ResultViewLoaded {
t: 'resultViewLoaded';
};
export enum SortDirection {
asc, desc
}
export interface SortState {
columnIndex: number;
direction: SortDirection;
}
interface ChangeSortMsg {
t: 'changeSort';
resultSetName: string;
sortState?: SortState;
}