interface BridgeController {
    onAliasQueried?: ((alias, roomId) => PossiblePromise<void>);
    onAliasQuery?: ((alias, aliasLocalpart) => PossiblePromise<null | void | {
        creationOpts?: Record<string, unknown>;
        remote?: RemoteRoom;
        roomId?: string;
    }>);
    onEphemeralEvent?: ((request) => void);
    onEvent: ((request, context?) => void);
    onLog?: ((text, isError) => void);
    onUserQuery?: ((matrixUser) => PossiblePromise<null | void | {
        name?: string;
        remote?: RemoteUser;
        url?: string;
    }>);
    thirdPartyLookup?: {
        protocols: string[];
        getLocation?(protocol, fields): PossiblePromise<ThirdpartyLocationResponse[]>;
        getProtocol?(protocol): PossiblePromise<ThirdpartyProtocolResponse>;
        getUser?(protocol, fields): PossiblePromise<ThirdpartyUserResponse[]>;
        parseLocation?(alias): PossiblePromise<ThirdpartyLocationResponse[]>;
        parseUser?(userid): PossiblePromise<ThirdpartyLocationResponse[]>;
    };
    userActivityTracker?: UserActivityTracker;
}

Properties

onAliasQueried?: ((alias, roomId) => PossiblePromise<void>)

The bridge will invoke this function when a room has been created via onAliasQuery.

Type declaration

    • (alias, roomId): PossiblePromise<void>
    • The bridge will invoke this function when a room has been created via onAliasQuery.

      Parameters

      • alias: string
      • roomId: string

      Returns PossiblePromise<void>

onAliasQuery?: ((alias, aliasLocalpart) => PossiblePromise<null | void | {
    creationOpts?: Record<string, unknown>;
    remote?: RemoteRoom;
    roomId?: string;
}>)

The bridge will invoke this function when queried via onAliasQuery. If not supplied, no rooms will be provisioned on alias queries. Provisioned rooms will automatically be stored in the associated roomStore.

Type declaration

    • (alias, aliasLocalpart): PossiblePromise<null | void | {
          creationOpts?: Record<string, unknown>;
          remote?: RemoteRoom;
          roomId?: string;
      }>
    • The bridge will invoke this function when queried via onAliasQuery. If not supplied, no rooms will be provisioned on alias queries. Provisioned rooms will automatically be stored in the associated roomStore.

      Parameters

      • alias: string
      • aliasLocalpart: string

      Returns PossiblePromise<null | void | {
          creationOpts?: Record<string, unknown>;
          remote?: RemoteRoom;
          roomId?: string;
      }>

onEphemeralEvent?: ((request) => void)

The bridge will invoke this when a typing, read reciept or presence event is received from the HS. This will only work with the bridgeEncryption configuration set.

Type declaration

    • (request): void
    • The bridge will invoke this when a typing, read reciept or presence event is received from the HS. This will only work with the bridgeEncryption configuration set.

      Returns void

onEvent: ((request, context?) => void)

The bridge will invoke when an event has been received from the HS.

Type declaration

    • (request, context?): void
    • The bridge will invoke when an event has been received from the HS.

      Parameters

      Returns void

onLog?: ((text, isError) => void)

Invoked when logging. Defaults to a function which logs to the console.

Type declaration

    • (text, isError): void
    • Invoked when logging. Defaults to a function which logs to the console.

      Parameters

      • text: string
      • isError: boolean

      Returns void

onUserQuery?: ((matrixUser) => PossiblePromise<null | void | {
    name?: string;
    remote?: RemoteUser;
    url?: string;
}>)

The bridge will invoke this function when queried via onUserQuery. If not supplied, no users will be provisioned on user queries. Provisioned users will automatically be stored in the associated userStore.

Type declaration

    • (matrixUser): PossiblePromise<null | void | {
          name?: string;
          remote?: RemoteUser;
          url?: string;
      }>
    • The bridge will invoke this function when queried via onUserQuery. If not supplied, no users will be provisioned on user queries. Provisioned users will automatically be stored in the associated userStore.

      Parameters

      Returns PossiblePromise<null | void | {
          name?: string;
          remote?: RemoteUser;
          url?: string;
      }>

thirdPartyLookup?: {
    protocols: string[];
    getLocation?(protocol, fields): PossiblePromise<ThirdpartyLocationResponse[]>;
    getProtocol?(protocol): PossiblePromise<ThirdpartyProtocolResponse>;
    getUser?(protocol, fields): PossiblePromise<ThirdpartyUserResponse[]>;
    parseLocation?(alias): PossiblePromise<ThirdpartyLocationResponse[]>;
    parseUser?(userid): PossiblePromise<ThirdpartyLocationResponse[]>;
}

If supplied, the bridge will respond to third-party entity lookups using the contained helper functions.

Type declaration

  • protocols: string[]
  • getLocation?:function
    • Parameters

      • protocol: string
      • fields: Record<string, string | string[]>

      Returns PossiblePromise<ThirdpartyLocationResponse[]>

  • getProtocol?:function
    • Parameters

      • protocol: string

      Returns PossiblePromise<ThirdpartyProtocolResponse>

  • getUser?:function
    • Parameters

      • protocol: string
      • fields: Record<string, string | string[]>

      Returns PossiblePromise<ThirdpartyUserResponse[]>

  • parseLocation?:function
    • Parameters

      • alias: string

      Returns PossiblePromise<ThirdpartyLocationResponse[]>

  • parseUser?:function
    • Parameters

      • userid: string

      Returns PossiblePromise<ThirdpartyLocationResponse[]>

userActivityTracker?: UserActivityTracker

Generated using TypeDoc