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
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
|
import { MBeaconEventContent, MBeaconInfoContent, MBeaconInfoEventContent } from "./@types/beacon";
import { LocationAssetType, LocationEventWireContent, MLocationEventContent, MLocationContent, LegacyLocationEventContent } from "./@types/location";
import { MRoomTopicEventContent } from "./@types/topic";
import { IContent } from "./models/event";
/**
* Generates the content for a HTML Message event
* @param body - the plaintext body of the message
* @param htmlBody - the HTML representation of the message
* @returns
*/
export declare function makeHtmlMessage(body: string, htmlBody: string): IContent;
/**
* Generates the content for a HTML Notice event
* @param body - the plaintext body of the notice
* @param htmlBody - the HTML representation of the notice
* @returns
*/
export declare function makeHtmlNotice(body: string, htmlBody: string): IContent;
/**
* Generates the content for a HTML Emote event
* @param body - the plaintext body of the emote
* @param htmlBody - the HTML representation of the emote
* @returns
*/
export declare function makeHtmlEmote(body: string, htmlBody: string): IContent;
/**
* Generates the content for a Plaintext Message event
* @param body - the plaintext body of the emote
* @returns
*/
export declare function makeTextMessage(body: string): IContent;
/**
* Generates the content for a Plaintext Notice event
* @param body - the plaintext body of the notice
* @returns
*/
export declare function makeNotice(body: string): IContent;
/**
* Generates the content for a Plaintext Emote event
* @param body - the plaintext body of the emote
* @returns
*/
export declare function makeEmoteMessage(body: string): IContent;
/** Location content helpers */
export declare const getTextForLocationEvent: (uri: string | undefined, assetType: LocationAssetType, timestamp?: number, description?: string | null) => string;
/**
* Generates the content for a Location event
* @param uri - a geo:// uri for the location
* @param timestamp - the timestamp when the location was correct (milliseconds since the UNIX epoch)
* @param description - the (optional) label for this location on the map
* @param assetType - the (optional) asset type of this location e.g. "m.self"
* @param text - optional. A text for the location
*/
export declare const makeLocationContent: (text?: string, uri?: string, timestamp?: number, description?: string | null, assetType?: LocationAssetType) => LegacyLocationEventContent & MLocationEventContent;
/**
* Parse location event content and transform to
* a backwards compatible modern m.location event format
*/
export declare const parseLocationEvent: (wireEventContent: LocationEventWireContent) => MLocationEventContent;
/**
* Topic event helpers
*/
export type MakeTopicContent = (topic: string, htmlTopic?: string) => MRoomTopicEventContent;
export declare const makeTopicContent: MakeTopicContent;
export type TopicState = {
text: string;
html?: string;
};
export declare const parseTopicContent: (content: MRoomTopicEventContent) => TopicState;
/**
* Beacon event helpers
*/
export type MakeBeaconInfoContent = (timeout: number, isLive?: boolean, description?: string, assetType?: LocationAssetType, timestamp?: number) => MBeaconInfoEventContent;
export declare const makeBeaconInfoContent: MakeBeaconInfoContent;
export type BeaconInfoState = MBeaconInfoContent & {
assetType?: LocationAssetType;
timestamp?: number;
};
/**
* Flatten beacon info event content
*/
export declare const parseBeaconInfoContent: (content: MBeaconInfoEventContent) => BeaconInfoState;
export type MakeBeaconContent = (uri: string, timestamp: number, beaconInfoEventId: string, description?: string) => MBeaconEventContent;
export declare const makeBeaconContent: MakeBeaconContent;
export type BeaconLocationState = Omit<MLocationContent, "uri"> & {
uri?: string;
timestamp?: number;
};
export declare const parseBeaconContent: (content: MBeaconEventContent) => BeaconLocationState;
//# sourceMappingURL=content-helpers.d.ts.map
|