Skip to content

Commit 57cc34b

Browse files
author
codeliner
committed
Add cody response types
1 parent 559b09c commit 57cc34b

1 file changed

Lines changed: 18 additions & 0 deletions

File tree

packages/cody-types/src/index.ts

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,23 @@
11
import {List, Map} from "immutable";
22

3+
export type ReplyCallback<T = any> = (reply: T) => Promise<CodyResponse>;
4+
5+
export interface CodyResponse {
6+
cody: string | string[];
7+
details?: string | string[];
8+
type?: CodyResponseType;
9+
reply?: ReplyCallback;
10+
}
11+
12+
export enum CodyResponseType {
13+
Info = 'Info',
14+
Error = 'Error',
15+
Warning = 'Warning',
16+
Question = 'Question',
17+
SyncRequired = 'SyncRequired',
18+
Empty= 'Empty',
19+
}
20+
321
export type NodeMap = Map<string, Node>;
422
export type NodeId = string;
523
export type NodeName = string;

0 commit comments

Comments
 (0)