本文整理匯總了TypeScript中@connection/Connection.interface.IConnection類的典型用法代碼示例。如果您正苦於以下問題:TypeScript interface.IConnection類的具體用法?TypeScript interface.IConnection怎麽用?TypeScript interface.IConnection使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。
在下文中一共展示了interface.IConnection類的3個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的TypeScript代碼示例。
示例1: publishBookmarks
private publishBookmarks(storageElement: JQuery<Element>) {
let pubSubService = this.connection.getPubSubService();
let item = $build('item', {
id: 'current'
}).cnode(storageElement.get(0));
return pubSubService.publish(NS.get('BOOKMARKS'), item, this.getOptionForm());
}
示例2: getBookmarks
private async getBookmarks(): Promise<JQuery<Element>> {
let pubSubService = this.connection.getPubSubService();
let bookmarkNode = await pubSubService.getAllItems(NS.get('BOOKMARKS'));
let storageElement = $(bookmarkNode).find(NS.getFilter('BOOKMARKS', 'storage'));
if (storageElement.length !== 1) {
throw new Error('Could not retrieve bookmarks.');
}
return storageElement;
}
示例3: resolve
formElement.find('.jsxc-js-close').click((ev) => {
ev.preventDefault();
let cancelRoomPromise = connection.getMUCService()
.cancelRoomConfiguration(contact.getJid())
.then(() => {
Log.debug('Room configuration canceled');
dialog.close();
return CANCELED;
});
resolve(cancelRoomPromise);
});