UNPKG

1.29 kBTypeScriptView Raw
1import { AnnotatedCommit } from './annotated-commit';
2import { Repository } from './repository';
3import { Strarray } from './str-array';
4import { CheckoutOptions } from './checkout-options';
5import { Commit } from './commit';
6import { Tag } from './tag';
7
8export namespace Reset {
9 const enum TYPE {
10 SOFT = 1,
11 MIXED = 2,
12 HARD = 3,
13 }
14}
15
16export class Reset {
17 /**
18 * Look up a refs's commit.
19 */
20 static reset(
21 repo: Repository,
22 target: Commit | Tag,
23 resetType: Reset.TYPE,
24 checkoutOpts?: CheckoutOptions,
25 ): Promise<void>;
26 /**
27 * Look up a refs's commit.
28 */
29 static default(repo: Repository, target: Commit | Tag, pathspecs: Strarray | string | string[]): Promise<number>;
30 /**
31 * Sets the current head to the specified commit oid and optionally resets the index and working tree to match.
32 * This behaves like reset but takes an annotated commit, which lets you specify which extended sha syntax string was specified by a user, allowing for more exact reflog messages.
33 * See the documentation for reset.
34 */
35 static fromAnnotated(
36 repo: Repository,
37 commit: AnnotatedCommit,
38 resetType: number,
39 checkoutOpts: CheckoutOptions,
40 ): number;
41}