Interface CliOpts<ConfigType>

Type Parameters

  • ConfigType extends Record<string, unknown>

Hierarchy

  • CliOpts

Properties

bridgeConfig?: {
    affectsRegistration?: boolean;
    defaults: Record<string, unknown>;
    schema: string | Record<string, unknown>;
}

Bridge-specific config info. If not defined, --config option will not be present in the CLI

Type declaration

  • Optional affectsRegistration?: boolean

    If true, the config will be required when generating a registration file.

  • defaults: Record<string, unknown>

    The default options for the config file.

  • schema: string | Record<string, unknown>

    Path to a schema YAML file (string) or the parsed schema file (object).

enableLocalpart?: boolean

Enable '--localpart [-l]' to allow users to configure the bot localpart.

Default

true

enableRegistration?: boolean

Enable '--generate-registration' to allow users to generate a registration file.

Default

true

generateRegistration?: ((reg: AppServiceRegistration, cb: ((finalReg: AppServiceRegistration) => void)) => void)

Type declaration

    • (reg: AppServiceRegistration, cb: ((finalReg: AppServiceRegistration) => void)): void
    • The function called when you should generate a registration. Must be defined unless enableRegistration is false.

      Parameters

      • reg: AppServiceRegistration
      • cb: ((finalReg: AppServiceRegistration) => void)
          • (finalReg: AppServiceRegistration): void
          • Parameters

            • finalReg: AppServiceRegistration

            Returns void

      Returns void

noUrl?: boolean

Don't ask user for appservice url when generating registration.

Default

false

onConfigChanged?: ((config: ConfigType) => void)

Type declaration

    • (config: ConfigType): void
    • This function is when the config is hot-reloaded. If not defined, hot-reloading is disabled.

      You can hot-reload the bridge by sending a SIGHUP signal to the bridge.

      Parameters

      • config: ConfigType

      Returns void

registrationPath?: string

The path to write the registration file to. Users can overwrite this with -f.

Default

"registration.yaml"

run: ((port: null | number, config: null | ConfigType, registration: null | AppServiceRegistration) => void)

Type declaration

    • (port: null | number, config: null | ConfigType, registration: null | AppServiceRegistration): void
    • This function called when you should run the bridge.

      Parameters

      • port: null | number
      • config: null | ConfigType
      • registration: null | AppServiceRegistration

      Returns void

Generated using TypeDoc