UNPKG

1.81 kBTypeScriptView Raw
1import { AnnotatedCommit } from "./annotated-commit";
2import { CheckoutOptions } from "./checkout-options";
3import { Index, MergeOptions, Tree } from "./index";
4import { Oid } from "./oid";
5import { RebaseOperation } from "./rebase-operation";
6import { Repository } from "./repository";
7import { Signature } from "./signature";
8
9export interface RebaseOptions<PayloadType = any> {
10 version?: number | null;
11 quiet?: number | null;
12 inmemory?: number | null;
13 rewriteNotesRef?: string | null;
14 mergeOptions?: MergeOptions | null;
15 checkoutOptions?: CheckoutOptions | null;
16 commitCreateCb?:
17 | ((
18 author: Signature,
19 committer: Signature,
20 message_encoding: string,
21 message: string,
22 tree: Tree,
23 parent_count: number,
24 parents: Oid[],
25 payload?: PayloadType,
26 ) => Oid)
27 | null;
28 payload?: PayloadType | null;
29}
30
31export class Rebase {
32 static init(
33 repo: Repository,
34 branch: AnnotatedCommit | undefined | null,
35 upstream?: AnnotatedCommit | null,
36 onto?: AnnotatedCommit | null,
37 opts?: RebaseOptions | null,
38 ): Promise<Rebase>;
39 static initOptions(opts: RebaseOptions, version: number): number;
40 static open(repo: Repository, opts?: RebaseOptions): Promise<Rebase>;
41
42 abort(): number;
43 commit(
44 author: Signature | undefined | null,
45 committer: Signature,
46 messageEncoding?: string | null,
47 message?: string | null,
48 ): Promise<Oid>;
49 finish(signature?: Signature | null): number;
50 inmemoryIndex(index: Index): number;
51 next(): Promise<RebaseOperation>;
52 operationByIndex(idx: number): RebaseOperation;
53 operationCurrent(): number;
54 operationEntrycount(): number;
55}