summaryrefslogtreecommitdiff
path: root/includes/external/matrix/node_modules/matrix-js-sdk/lib/content-helpers.d.ts
diff options
context:
space:
mode:
authorRaindropsSys <contact@minteck.org>2023-04-24 14:03:36 +0200
committerRaindropsSys <contact@minteck.org>2023-04-24 14:03:36 +0200
commit633c92eae865e957121e08de634aeee11a8b3992 (patch)
tree09d881bee1dae0b6eee49db1dfaf0f500240606c /includes/external/matrix/node_modules/matrix-js-sdk/lib/content-helpers.d.ts
parentc4657e4509733699c0f26a3c900bab47e915d5a0 (diff)
downloadpluralconnect-633c92eae865e957121e08de634aeee11a8b3992.tar.gz
pluralconnect-633c92eae865e957121e08de634aeee11a8b3992.tar.bz2
pluralconnect-633c92eae865e957121e08de634aeee11a8b3992.zip
Updated 18 files, added 1692 files and deleted includes/system/compare.inc (automated)
Diffstat (limited to 'includes/external/matrix/node_modules/matrix-js-sdk/lib/content-helpers.d.ts')
-rw-r--r--includes/external/matrix/node_modules/matrix-js-sdk/lib/content-helpers.d.ts90
1 files changed, 90 insertions, 0 deletions
diff --git a/includes/external/matrix/node_modules/matrix-js-sdk/lib/content-helpers.d.ts b/includes/external/matrix/node_modules/matrix-js-sdk/lib/content-helpers.d.ts
new file mode 100644
index 0000000..f7b23ff
--- /dev/null
+++ b/includes/external/matrix/node_modules/matrix-js-sdk/lib/content-helpers.d.ts
@@ -0,0 +1,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 \ No newline at end of file