-
-
Notifications
You must be signed in to change notification settings - Fork 84
/
cspell.cache.ts
50 lines (41 loc) · 993 Bytes
/
cspell.cache.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
/**
* Proposed CSpell Cache file.
* To be stored at `./.cspell/cache/cache.json`
*/
export interface CSpellCache {
version: Version;
signature: Hash;
files: CachedFile[];
}
export type Version = '0.1';
/**
* Hash used. Starts with hash id. i.e. `sha1-` or `sha512-`.
*/
export type Hash = string;
export type UriRelPath = string;
export enum IssueCode {
UnknownWord = 1 << 0,
ForbiddenWord = 1 << 1,
KnownIssue = 1 << 2,
ALL = IssueCode.UnknownWord | IssueCode.ForbiddenWord | IssueCode.KnownIssue,
}
export interface CachedFile {
hash: Hash;
path: UriRelPath;
issues: Issue[];
}
export type Issue = IssueEntry | IssueLine;
export interface IssueEntry {
line: number;
character: number;
code: IssueCode;
text: string;
len: number;
}
export type IssueLine = [
line: IssueEntry['line'],
character: IssueEntry['character'],
code: IssueEntry['code'],
text: IssueEntry['text'],
len: IssueEntry['len']
];