From 633c92eae865e957121e08de634aeee11a8b3992 Mon Sep 17 00:00:00 2001 From: RaindropsSys Date: Mon, 24 Apr 2023 14:03:36 +0200 Subject: Updated 18 files, added 1692 files and deleted includes/system/compare.inc (automated) --- .../matrix-events-sdk/lib/ExtensibleEvents.d.ts | 74 ++++++++++++++++++++++ 1 file changed, 74 insertions(+) create mode 100644 includes/external/matrix/node_modules/matrix-events-sdk/lib/ExtensibleEvents.d.ts (limited to 'includes/external/matrix/node_modules/matrix-events-sdk/lib/ExtensibleEvents.d.ts') diff --git a/includes/external/matrix/node_modules/matrix-events-sdk/lib/ExtensibleEvents.d.ts b/includes/external/matrix/node_modules/matrix-events-sdk/lib/ExtensibleEvents.d.ts new file mode 100644 index 0000000..3103c2f --- /dev/null +++ b/includes/external/matrix/node_modules/matrix-events-sdk/lib/ExtensibleEvents.d.ts @@ -0,0 +1,74 @@ +import { IPartialEvent } from "./IPartialEvent"; +import { ExtensibleEvent } from "./events/ExtensibleEvent"; +import { Optional } from "./types"; +import { NamespacedValue } from "./NamespacedValue"; +export declare type EventInterpreter = (wireEvent: IPartialEvent) => Optional; +/** + * Utility class for parsing and identifying event types in a renderable form. An + * instance of this class can be created to change rendering preference depending + * on use-case. + */ +export declare class ExtensibleEvents { + private static _defaultInstance; + private interpreters; + private _unknownInterpretOrder; + constructor(); + /** + * Gets the default instance for all extensible event parsing. + */ + static get defaultInstance(): ExtensibleEvents; + /** + * Gets the order the internal processor will use for unknown primary + * event types. + */ + get unknownInterpretOrder(): NamespacedValue[]; + /** + * Sets the order the internal processor will use for unknown primary + * event types. + * @param {NamespacedValue[]} val The parsing order. + */ + set unknownInterpretOrder(val: NamespacedValue[]); + /** + * Gets the order the internal processor will use for unknown primary + * event types. + */ + static get unknownInterpretOrder(): NamespacedValue[]; + /** + * Sets the order the internal processor will use for unknown primary + * event types. + * @param {NamespacedValue[]} val The parsing order. + */ + static set unknownInterpretOrder(val: NamespacedValue[]); + /** + * Registers a primary event type interpreter. Note that the interpreter might be + * called with non-primary events if the event is being parsed as a fallback. + * @param {NamespacedValue} wireEventType The event type. + * @param {EventInterpreter} interpreter The interpreter. + */ + registerInterpreter(wireEventType: NamespacedValue, interpreter: EventInterpreter): void; + /** + * Registers a primary event type interpreter. Note that the interpreter might be + * called with non-primary events if the event is being parsed as a fallback. + * @param {NamespacedValue} wireEventType The event type. + * @param {EventInterpreter} interpreter The interpreter. + */ + static registerInterpreter(wireEventType: NamespacedValue, interpreter: EventInterpreter): void; + /** + * Parses an event, trying the primary event type first. If the primary type is not known + * then the content will be inspected to find the most suitable fallback. + * + * If the parsing failed or was a completely unknown type, this will return falsy. + * @param {IPartialEvent} wireFormat The event to parse. + * @returns {Optional} The parsed extensible event. + */ + parse(wireFormat: IPartialEvent): Optional; + /** + * Parses an event, trying the primary event type first. If the primary type is not known + * then the content will be inspected to find the most suitable fallback. + * + * If the parsing failed or was a completely unknown type, this will return falsy. + * @param {IPartialEvent} wireFormat The event to parse. + * @returns {Optional} The parsed extensible event. + */ + static parse(wireFormat: IPartialEvent): Optional; +} -- cgit