UNPKG

1.75 kBTypeScriptView Raw
1import { RepoContext } from "../context/SdmContext";
2import { SdmGoalEvent } from "../goal/SdmGoalEvent";
3/**
4 * Represents a vote on a approval request
5 */
6export declare enum GoalApprovalRequestVote {
7 /**
8 * Voter decided to abstain from voting
9 */
10 Abstain = "abstain",
11 /**
12 * Voter decided to grant the approval request
13 */
14 Granted = "granted",
15 /**
16 * Voter decided to deny the approval request
17 */
18 Denied = "denied"
19}
20/**
21 * Result from executing GoalApprovalRequestVoter
22 */
23export interface GoalApprovalRequestVoteResult {
24 /**
25 * The vote
26 */
27 vote: GoalApprovalRequestVote;
28 /**
29 * Optional text describing why the decision was being made
30 */
31 reason?: string;
32}
33/**
34 * Invocation of a GoalApprovalRequestVoter
35 */
36export interface GoalApprovalRequestVoterInvocation extends RepoContext {
37 /**
38 * Goal that was requested for approval
39 */
40 goal: SdmGoalEvent;
41}
42/**
43 * Voter on a request to approve a goal
44 */
45export declare type GoalApprovalRequestVoter = (garvi: GoalApprovalRequestVoterInvocation) => Promise<GoalApprovalRequestVoteResult>;
46/**
47 * Decide resulting vote on a set of votes
48 */
49export declare type GoalApprovalRequestVoteDecisionManager = (...votes: GoalApprovalRequestVoteResult[]) => GoalApprovalRequestVote;
50/**
51 * Default GoalApprovalRequestVoteDecisionManager that decides unanimously on votes.
52 * One denied vote will deny the approval request; all granted votes with grant the request.
53 * All other votes with result in an abstained approval request.
54 * @param votes
55 */
56export declare const UnanimousGoalApprovalRequestVoteDecisionManager: GoalApprovalRequestVoteDecisionManager;
57//# sourceMappingURL=goalApprovalRequestVote.d.ts.map
\No newline at end of file