-
Notifications
You must be signed in to change notification settings - Fork 253
/
Copy pathxep0118.ts
45 lines (41 loc) · 1.28 KB
/
xep0118.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
40
41
42
43
44
45
// ====================================================================
// XEP-0108: User Tune
// --------------------------------------------------------------------
// Source: https://xmpp.org/extensions/xep-0118.html
// Version: 1.2 (2008-01-30)
// ====================================================================
import { childInteger, childText, DefinitionOptions, pubsubItemContentAliases } from '../jxt';
import { NS_TUNE } from '../Namespaces';
import { PubsubItemContent } from './';
export interface UserTune extends PubsubItemContent {
itemType?: typeof NS_TUNE;
artist?: string;
length?: number;
rating?: number;
source?: string;
title?: string;
track?: string;
uri?: string;
}
const Protocol: DefinitionOptions = {
aliases: [
{
impliedType: true,
path: 'tune'
},
...pubsubItemContentAliases()
],
element: 'tune',
fields: {
artist: childText(null, 'artist'),
length: childInteger(null, 'length'),
rating: childInteger(null, 'rating'),
source: childText(null, 'source'),
title: childText(null, 'title'),
track: childText(null, 'track'),
uri: childText(null, 'uri')
},
namespace: NS_TUNE,
type: NS_TUNE
};
export default Protocol;