1 | import { HandlerContext } from "../../HandlerContext";
|
2 | import { Project } from "../../project/Project";
|
3 | import { EditResult, ProjectEditor } from "./projectEditor";
|
4 |
|
5 |
|
6 |
|
7 |
|
8 | export declare type EditModeFactory = (p: Project) => EditMode;
|
9 | export declare function toEditModeFactory(em: EditMode | EditModeFactory): EditModeFactory;
|
10 |
|
11 |
|
12 |
|
13 |
|
14 | export interface EditMode {
|
15 | message: string;
|
16 | |
17 |
|
18 |
|
19 |
|
20 |
|
21 |
|
22 |
|
23 | afterPersist?(p: Project, ctx: HandlerContext): Promise<any>;
|
24 | }
|
25 | export declare function isEditMode(em: any): em is EditMode;
|
26 |
|
27 |
|
28 |
|
29 | export declare enum AutoMergeMethod {
|
30 | Merge = "[auto-merge-method:merge]",
|
31 | Rebase = "[auto-merge-method:rebase]",
|
32 | Squash = "[auto-merge-method:squash]"
|
33 | }
|
34 |
|
35 |
|
36 |
|
37 | export declare enum AutoMergeMode {
|
38 | ApprovedReview = "[auto-merge:on-approve]",
|
39 | SuccessfulCheck = "[auto-merge:on-check-success]"
|
40 | }
|
41 |
|
42 |
|
43 |
|
44 | export interface BranchCommit extends EditMode {
|
45 | branch: string;
|
46 | autoMerge?: {
|
47 | mode: AutoMergeMode | string;
|
48 | method?: AutoMergeMethod;
|
49 | };
|
50 | }
|
51 |
|
52 |
|
53 |
|
54 | export declare function commitToMaster(message: string): BranchCommit;
|
55 | export declare function isBranchCommit(em: EditMode): em is BranchCommit;
|
56 |
|
57 |
|
58 |
|
59 | export declare class PullRequest implements BranchCommit {
|
60 | branch: string;
|
61 | title: string;
|
62 | body: string;
|
63 | message: string;
|
64 | constructor(branch: string, title: string, body?: string, message?: string);
|
65 | }
|
66 | export declare function isPullRequest(em: EditMode): em is PullRequest;
|
67 | /**
|
68 | * Use for edit modes that require custom persistence
|
69 | */
|
70 | export interface CustomExecutionEditMode extends EditMode {
|
71 | edit<P>(p: Project, action: ProjectEditor<P>, context: HandlerContext, parameters: P): Promise<EditResult>;
|
72 | }
|
73 | export declare function isCustomExecutionEditMode(ei: EditMode): ei is CustomExecutionEditMode;
|
74 |
|
\ | No newline at end of file |