UNPKG

1.44 kBTypeScriptView Raw
1import { CheckoutOptions } from "./checkout-options";
2import { Oid } from "./oid";
3import { Repository } from "./repository";
4import { Signature } from "./signature";
5
6export namespace Stash {
7 const enum APPLY_FLAGS {
8 APPLY_DEFAULT = 0,
9 APPLY_REINSTATE_INDEX = 1,
10 }
11
12 const enum APPLY_PROGRESS {
13 NONE = 0,
14 LOADING_STASH = 1,
15 ANALYZE_INDEX = 2,
16 ANALYZE_MODIFIED = 3,
17 ANALYZE_UNTRACKED = 4,
18 CHECKOUT_UNTRACKED = 5,
19 CHECKOUT_MODIFIED = 6,
20 DONE = 7,
21 }
22
23 const enum FLAGS {
24 DEFAULT = 0,
25 KEEP_INDEX = 1,
26 INCLUDE_UNTRACKED = 2,
27 INCLUDE_IGNORED = 4,
28 }
29}
30
31export interface StashApplyOptions {
32 version?: number | undefined;
33 flags?: number | undefined;
34 checkoutOptions?: CheckoutOptions | undefined;
35 progressCb?: Function | undefined;
36 progressPayload?: any;
37}
38
39export class Stash {
40 static apply(repo: Repository, index: number, options?: StashApplyOptions): Promise<number>;
41 static applyInitOptions(opts: StashApplyOptions, version: number): number;
42 static drop(repo: Repository, index: number): Promise<number>;
43 static foreach(repo: Repository, callback?: Function): Promise<number>;
44 static pop(repo: Repository, index: number, options?: StashApplyOptions): Promise<number>;
45 static save(repo: Repository, stasher: Signature, message: string, flags: number): Promise<Oid>;
46}