ali-mns-sdk
Version:
The nodejs SDK for aliyun mns service
49 lines (48 loc) • 1.88 kB
TypeScript
import { Msg } from './Msg';
export interface IMNS {
listP(prefix?: string, pageSize?: number, pageMarker?: string): any;
createP(name: string, options?: any): any;
deleteP(name: string): any;
}
export interface IMNSTopic extends IMNS {
listTopicP(prefix?: string, pageSize?: number, pageMarker?: string): any;
createTopicP(name: string, options?: any): any;
deleteTopicP(name: string): any;
}
export interface IMQ {
getAttrsP(): any;
setAttrsP(options: any): any;
sendP(msg: string, priority?: number, delaySeconds?: number): any;
recvP(waitSeconds?: number): any;
peekP(): any;
deleteP(receiptHandle: string): any;
reserveP(receiptHandle: string, reserveSeconds: number): any;
}
export interface IMQBatch extends IMQ {
sendP(msg: string | Msg[], priority?: number, delaySeconds?: number): any;
recvP(waitSeconds?: number, numOfMessages?: number): any;
peekP(numOfMessages?: number): any;
deleteP(receiptHandle: string | string[]): any;
}
export interface INotifyRecv {
notifyRecv(cb: (ex: Error, msg: any) => Promise<boolean>, waitSeconds?: number): any;
notifyStopP(): any;
}
export interface INotifyRecvBatch extends INotifyRecv {
notifyRecv(cb: (ex: Error, msg: any) => Promise<boolean>, waitSeconds?: number, numOfMessages?: number): any;
}
export interface ITopic {
getAttrsP(): any;
setAttrsP(options: any): any;
listP(prefix?: string, pageSize?: number, pageMarker?: string): any;
subscribeP(name: string, endPoint: string, notifyStrategy?: string, notifyContentFormat?: string): any;
unsubscribeP(name: string): any;
publishP(msg: string, b64: boolean): any;
}
export interface ISubscription {
getAttrsP(): any;
setAttrsP(options: any): any;
}
export interface ITopicNotify {
notifyP(request: any): any;
}