summaryrefslogtreecommitdiff
path: root/includes/external/matrix/node_modules/matrix-events-sdk/lib/NamespacedMap.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/NamespacedMap.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/NamespacedMap.d.ts')
-rw-r--r--includes/external/matrix/node_modules/matrix-events-sdk/lib/NamespacedMap.d.ts55
1 files changed, 55 insertions, 0 deletions
diff --git a/includes/external/matrix/node_modules/matrix-events-sdk/lib/NamespacedMap.d.ts b/includes/external/matrix/node_modules/matrix-events-sdk/lib/NamespacedMap.d.ts
new file mode 100644
index 0000000..461f528
--- /dev/null
+++ b/includes/external/matrix/node_modules/matrix-events-sdk/lib/NamespacedMap.d.ts
@@ -0,0 +1,55 @@
+import { NamespacedValue } from "./NamespacedValue";
+import { Optional } from "./types";
+declare type NS = NamespacedValue<string, string>;
+/**
+ * A `Map` implementation which accepts a NamespacedValue as a key, and arbitrary value. The
+ * namespaced value must be a string type.
+ */
+export declare class NamespacedMap<V> {
+ protected internalMap: Map<string, V>;
+ /**
+ * Creates a new map with optional seed data.
+ * @param {Array<[NS, V]>} initial The seed data.
+ */
+ constructor(initial?: [NS, V][]);
+ /**
+ * Gets a value from the map. If the value does not exist under
+ * either namespace option, falsy is returned.
+ * @param {NS} key The key.
+ * @returns {Optional<V>} The value, or falsy.
+ */
+ get(key: NS): Optional<V>;
+ /**
+ * Sets a value in the map.
+ * @param {NS} key The key.
+ * @param {V} val The value.
+ */
+ set(key: NS, val: V): void;
+ /**
+ * Determines if any of the valid namespaced values are present
+ * in the map.
+ * @param {NS} key The key.
+ * @returns {boolean} True if present.
+ */
+ has(key: NS): boolean;
+ /**
+ * Removes all the namespaced values from the map.
+ * @param {NS} key The key.
+ */
+ delete(key: NS): void;
+ /**
+ * Determines if the map contains a specific namespaced value
+ * instead of the parent NS type.
+ * @param {string} key The key.
+ * @returns {boolean} True if present.
+ */
+ hasNamespaced(key: string): boolean;
+ /**
+ * Gets a specific namespaced value from the map instead of the
+ * parent NS type. Returns falsy if not found.
+ * @param {string} key The key.
+ * @returns {Optional<V>} The value, or falsy.
+ */
+ getNamespaced(key: string): Optional<V>;
+}
+export {};