File tree Expand file tree Collapse file tree 1 file changed +42
-0
lines changed Expand file tree Collapse file tree 1 file changed +42
-0
lines changed Original file line number Diff line number Diff line change 1+ // This is currently held in this repo as a testbed, but it should be migrated
2+ // to the zulip-js repo for broader use and tagged in a version bump at some
3+ // point soon.
4+ declare module "zulip-js" {
5+ export type ClientConfiguration =
6+ | { zuliprc : string }
7+ | {
8+ realm : string ;
9+ username : string ;
10+ apiKey ?: string ;
11+ } ;
12+
13+ export type ApiParameters = Record < string , any > ;
14+ // This type can be narrowed once this file lives in zulip-js appropriately,
15+ // as Language Server Protocol is indicating hover-for-type support in that
16+ // repo on Response objects, including fields like json() and status.
17+ export type UntypedApiCall = ( _ : ApiParameters ) => Promise < any > ;
18+
19+ export type Client = {
20+ messages : ClientMessages ;
21+ } ;
22+
23+ export type ClientMessages = {
24+ deleteById : UntypedApiCall ;
25+ deleteReactionById : UntypedApiCall ;
26+ flags : ClientMessagesFlags ;
27+ getById : UntypedApiCall ;
28+ getHistoryById : UntypedApiCall ;
29+ render : UntypedApiCall ;
30+ retrieve : UntypedApiCall ;
31+ send : UntypedApiCall ;
32+ update : UntypedApiCall ;
33+ } ;
34+
35+ export type ClientMessagesFlags = {
36+ add : UntypedApiCall ;
37+ remove : UntypedApiCall ;
38+ } ;
39+
40+ async function zulipInit ( arguments_ : ClientConfiguration ) : Promise < Client > ;
41+ export default zulipInit ;
42+ }
You can’t perform that action at this time.
0 commit comments