matrix-moderation-widget

A widget for moderating with mjolnir. Highly WIP. Use at your own risk!
git clone git://archive.git.mtrnord.blog/MTRNord/matrix-moderation-widget.git
Log | Files | Refs | README | LICENSE

windowExt.ts (2052B)


      1 import { WidgetApi } from "matrix-widget-api";
      2 
      3 declare global {
      4     interface Window { widget_api: WidgetApi; }
      5 }
      6 
      7 export const M_POLICY_RULE_USER = "m.policy.rule.user";
      8 export const M_POLICY_RULE_SERVER = "m.policy.rule.server";
      9 export const M_POLICY_RULE_ROOM = "m.policy.rule.room";
     10 export const M_POLICY_RULE_USER_OLD = "org.matrix.mjolnir.rule.user";
     11 export const M_POLICY_RULE_SERVER_OLD = "org.matrix.mjolnir.rule.server";
     12 export const M_POLICY_RULE_ROOM_OLD = "org.matrix.mjolnir.rule.room";
     13 export const M_POLICY_RULE_USER_ALT = "m.room.rule.user";
     14 export const M_POLICY_RULE_SERVER_ALT = "m.room.rule.server";
     15 export const M_POLICY_RULE_ROOM_ALT = "m.room.rule.room";
     16 export const CANONICAL_ALIAS = "m.room.canonical_alias";
     17 export const ORG_MATRIX_MJOLNIR_SHORTCODE = "org.matrix.mjolnir.shortcode";
     18 export const M_TEXT = "m.text";
     19 export const M_ROOM_MEMBER = "m.room.member";
     20 export const M_ROOM_POWERLEVELS = "m.room.power_levels";
     21 export const DEV_NORDGEDANKEN_MJOLNIR_BANLISTS = "dev.nordgedanken.mjolnir_banlists";
     22 
     23 export type RuleEvent = {
     24     sender: string;
     25     state_key: string;
     26     event_id: string;
     27     room_id: string;
     28     content?: {
     29         entity: string;
     30         reason: string;
     31         recommendation: string;
     32     };
     33 };
     34 
     35 export type MembershipEvent = {
     36     sender: string;
     37     state_key: string;
     38     event_id: string;
     39     room_id: string;
     40     content?: {
     41         membership: string;
     42         reason?: string;
     43         avatar_url?: string;
     44         displayname?: string;
     45     };
     46 };
     47 
     48 export type CanonicalAliasEvent = {
     49     sender: string;
     50     state_key: string;
     51     event_id: string;
     52     room_id: string;
     53     content?: {
     54         alias: string;
     55     };
     56 };
     57 
     58 export type ShortcodeEvent = {
     59     sender: string;
     60     state_key: string;
     61     event_id: string;
     62     room_id: string;
     63     content?: {
     64         shortcode: string;
     65     };
     66 };
     67 
     68 export type MJjolnirBanlists = {
     69     sender: string;
     70     state_key: string;
     71     event_id: string;
     72     room_id: string;
     73     content?: {
     74         banlists:
     75         { [key: string]: string; };
     76     };
     77 };