forked from legastero/stanza
-
Notifications
You must be signed in to change notification settings - Fork 0
/
xep0071.ts
39 lines (34 loc) · 1.05 KB
/
xep0071.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
// ====================================================================
// XEP-0071: XHTML-IM
// --------------------------------------------------------------------
// Source: https://xmpp.org/extensions/xep-0071.html
// Version: 1.5.4 (2018-03-08)
// ====================================================================
import {
childAlternateLanguageRawElement,
childLanguageRawElement,
DefinitionOptions,
JSONElement,
LanguageSet,
XMLElement
} from '../jxt';
import { NS_XHTML, NS_XHTML_IM } from '../Namespaces';
declare module './' {
export interface Message {
html?: XHTMLIM;
}
}
export interface XHTMLIM {
body?: XMLElement;
alternateLanguageBodies?: LanguageSet<JSONElement | string>;
}
const Protocol: DefinitionOptions = {
element: 'html',
fields: {
alternateLanguageBodies: childAlternateLanguageRawElement(NS_XHTML, 'body', 'xhtmlim'),
body: childLanguageRawElement(NS_XHTML, 'body', 'xhtmlim')
},
namespace: NS_XHTML_IM,
path: 'message.html'
};
export default Protocol;