Skip to content

Commit bd99db5

Browse files
authored
Module for types (#58)
* remove ambient declaration and export necessary things * remove CbDictionary type
1 parent 5d776ac commit bd99db5

1 file changed

Lines changed: 12 additions & 16 deletions

File tree

index.d.ts

Lines changed: 12 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -8,22 +8,20 @@
88

99
// TODO: change all the occurences where we use CbCallback<any> to supply the actual type that is returned
1010

11-
declare module "clearblade-js-client" {
12-
interface ClearBlade {
13-
new (): IClearBlade;
11+
interface ClearBlade {
12+
new (): IClearBlade;
1413

15-
MESSAGING_QOS_AT_MOST_ONCE: MessagingQOS.MESSAGING_QOS_AT_MOST_ONCE;
16-
MESSAGING_QOS_AT_LEAST_ONCE: MessagingQOS.MESSAGING_QOS_AT_LEAST_ONCE;
17-
MESSAGING_QOS_EXACTLY_ONCE: MessagingQOS.MESSAGING_QOS_EXACTLY_ONCE;
14+
MESSAGING_QOS_AT_MOST_ONCE: MessagingQOS.MESSAGING_QOS_AT_MOST_ONCE;
15+
MESSAGING_QOS_AT_LEAST_ONCE: MessagingQOS.MESSAGING_QOS_AT_LEAST_ONCE;
16+
MESSAGING_QOS_EXACTLY_ONCE: MessagingQOS.MESSAGING_QOS_EXACTLY_ONCE;
1817

19-
request(options: RequestOptions, callback: CbCallback<any>): void;
20-
getMessageTopic(
21-
destinationName: string,
22-
callbackDict: CbDictionary<string, Function>
23-
): string;
24-
}
25-
export var ClearBlade: ClearBlade;
18+
request(options: RequestOptions, callback: CbCallback<any>): void;
19+
getMessageTopic(
20+
destinationName: string,
21+
callbackDict: { string?: Function }
22+
): string;
2623
}
24+
export var ClearBlade: ClearBlade;
2725

2826
declare enum MessagingQOS {
2927
MESSAGING_QOS_AT_MOST_ONCE = 0,
@@ -86,9 +84,7 @@ interface InvocationContext {
8684
invocationContext: any;
8785
}
8886

89-
type CbDictionary<K extends string, T> = { [P in K]?: T };
90-
91-
interface IClearBlade {
87+
export interface IClearBlade {
9288
systemKey: string;
9389
systemSecret: string;
9490
masterSecret: string;

0 commit comments

Comments
 (0)