summaryrefslogtreecommitdiff
path: root/includes/external/matrix/node_modules/matrix-widget-api/lib/models/WidgetEventCapability.d.ts
blob: c0fbcdb46d04a37c4ab24772bed8f2b91cd2f76b (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
import { Capability } from "..";
export declare enum EventKind {
    Event = "event",
    State = "state_event",
    ToDevice = "to_device"
}
export declare enum EventDirection {
    Send = "send",
    Receive = "receive"
}
export declare class WidgetEventCapability {
    readonly direction: EventDirection;
    readonly eventType: string;
    readonly kind: EventKind;
    readonly keyStr: string | null;
    readonly raw: string;
    private constructor();
    matchesAsStateEvent(direction: EventDirection, eventType: string, stateKey: string | null): boolean;
    matchesAsToDeviceEvent(direction: EventDirection, eventType: string): boolean;
    matchesAsRoomEvent(direction: EventDirection, eventType: string, msgtype?: string | null): boolean;
    static forStateEvent(direction: EventDirection, eventType: string, stateKey?: string): WidgetEventCapability;
    static forToDeviceEvent(direction: EventDirection, eventType: string): WidgetEventCapability;
    static forRoomEvent(direction: EventDirection, eventType: string): WidgetEventCapability;
    static forRoomMessageEvent(direction: EventDirection, msgtype?: string): WidgetEventCapability;
    /**
     * Parses a capabilities request to find all the event capability requests.
     * @param {Iterable<Capability>} capabilities The capabilities requested/to parse.
     * @returns {WidgetEventCapability[]} An array of event capability requests. May be empty, but never null.
     */
    static findEventCapabilities(capabilities: Iterable<Capability>): WidgetEventCapability[];
}