UNPKG

1.49 kBTypeScriptView Raw
1import { ConvenientHunk } from './convenient-hunk';
2import { DiffFile } from './diff-file';
3
4export class ConvenientPatch {
5 /**
6 * Old attributes of the file
7 */
8 oldFile(): DiffFile;
9 /**
10 * New attributes of the file
11 */
12 newFile(): DiffFile;
13 /**
14 * The number of hunks in this patch
15 */
16 size(): number;
17 /**
18 * The hunks in this patch
19 */
20 hunks(): Promise<ConvenientHunk[]>;
21 /**
22 * The status of this patch (unmodified, added, deleted)
23 */
24 status(): number;
25 /**
26 * The line statistics of this patch (#contexts, #added, #deleted)
27 */
28 lineStats(): any;
29 /**
30 * Is this an unmodified patch?
31 */
32 isUnmodified(): boolean;
33 /**
34 * Is this an added patch?
35 */
36 isAdded(): boolean;
37 /**
38 * Is this a deleted patch?
39 */
40 isDeleted(): boolean;
41 /**
42 * Is this an modified patch
43 */
44 isModified(): boolean;
45 /**
46 * Is this a renamed patch?
47 */
48 isRenamed(): boolean;
49 /**
50 * Is this a copied patch?
51 */
52 isCopied(): boolean;
53 /**
54 * Is this an ignored patch?
55 */
56 isIgnored(): boolean;
57 /**
58 * Is this an untracked patch?
59 */
60 isUntracked(): boolean;
61 /**
62 * Is this a type change?
63 */
64 isTypeChange(): boolean;
65 /**
66 * Is this an undreadable patch?
67 */
68 isUnreadable(): boolean;
69 /**
70 * Is this a conflicted patch?
71 */
72 isConflicted(): boolean;
73}