summaryrefslogtreecommitdiff
path: root/includes/external/matrix/node_modules/matrix-events-sdk/lib/events/PollStartEvent.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-events-sdk/lib/events/PollStartEvent.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-events-sdk/lib/events/PollStartEvent.d.ts')
-rw-r--r--includes/external/matrix/node_modules/matrix-events-sdk/lib/events/PollStartEvent.d.ts71
1 files changed, 71 insertions, 0 deletions
diff --git a/includes/external/matrix/node_modules/matrix-events-sdk/lib/events/PollStartEvent.d.ts b/includes/external/matrix/node_modules/matrix-events-sdk/lib/events/PollStartEvent.d.ts
new file mode 100644
index 0000000..2e85560
--- /dev/null
+++ b/includes/external/matrix/node_modules/matrix-events-sdk/lib/events/PollStartEvent.d.ts
@@ -0,0 +1,71 @@
+import { KNOWN_POLL_KIND, M_POLL_START_EVENT_CONTENT, POLL_ANSWER } from "./poll_types";
+import { IPartialEvent } from "../IPartialEvent";
+import { MessageEvent } from "./MessageEvent";
+import { EventType } from "../utility/events";
+import { ExtensibleEvent } from "./ExtensibleEvent";
+/**
+ * Represents a poll answer. Note that this is represented as a subtype and is
+ * not registered as a parsable event - it is implied for usage exclusively
+ * within the PollStartEvent parsing.
+ */
+export declare class PollAnswerSubevent extends MessageEvent {
+ /**
+ * The answer ID.
+ */
+ readonly id: string;
+ constructor(wireFormat: IPartialEvent<POLL_ANSWER>);
+ serialize(): IPartialEvent<object>;
+ /**
+ * Creates a new PollAnswerSubevent from ID and text.
+ * @param {string} id The answer ID (unique within the poll).
+ * @param {string} text The text.
+ * @returns {PollAnswerSubevent} The representative answer.
+ */
+ static from(id: string, text: string): PollAnswerSubevent;
+}
+/**
+ * Represents a poll start event.
+ */
+export declare class PollStartEvent extends ExtensibleEvent<M_POLL_START_EVENT_CONTENT> {
+ /**
+ * The question being asked, as a MessageEvent node.
+ */
+ readonly question: MessageEvent;
+ /**
+ * The interpreted kind of poll. Note that this will infer a value that is known to the
+ * SDK rather than verbatim - this means unknown types will be represented as undisclosed
+ * polls.
+ *
+ * To get the raw kind, use rawKind.
+ */
+ readonly kind: KNOWN_POLL_KIND;
+ /**
+ * The true kind as provided by the event sender. Might not be valid.
+ */
+ readonly rawKind: string;
+ /**
+ * The maximum number of selections a user is allowed to make.
+ */
+ readonly maxSelections: number;
+ /**
+ * The possible answers for the poll.
+ */
+ readonly answers: PollAnswerSubevent[];
+ /**
+ * Creates a new PollStartEvent from a pure format. Note that the event is *not*
+ * parsed here: it will be treated as a literal m.poll.start primary typed event.
+ * @param {IPartialEvent<M_POLL_START_EVENT_CONTENT>} wireFormat The event.
+ */
+ constructor(wireFormat: IPartialEvent<M_POLL_START_EVENT_CONTENT>);
+ isEquivalentTo(primaryEventType: EventType): boolean;
+ serialize(): IPartialEvent<object>;
+ /**
+ * Creates a new PollStartEvent from question, answers, and metadata.
+ * @param {string} question The question to ask.
+ * @param {string} answers The answers. Should be unique within each other.
+ * @param {KNOWN_POLL_KIND|string} kind The kind of poll.
+ * @param {number} maxSelections The maximum number of selections. Must be 1 or higher.
+ * @returns {PollStartEvent} The representative poll start event.
+ */
+ static from(question: string, answers: string[], kind: KNOWN_POLL_KIND | string, maxSelections?: number): PollStartEvent;
+}