IHttpConnectionOptions.d.ts 1.8 KB

1234567891011121314151617181920212223242526272829303132
  1. import { HttpClient } from "./HttpClient";
  2. import { ILogger, LogLevel } from "./ILogger";
  3. import { HttpTransportType, ITransport } from "./ITransport";
  4. /** Options provided to the 'withUrl' method on {@link @aspnet/signalr.HubConnectionBuilder} to configure options for the HTTP-based transports. */
  5. export interface IHttpConnectionOptions {
  6. /** An {@link @aspnet/signalr.HttpClient} that will be used to make HTTP requests. */
  7. httpClient?: HttpClient;
  8. /** An {@link @aspnet/signalr.HttpTransportType} value specifying the transport to use for the connection. */
  9. transport?: HttpTransportType | ITransport;
  10. /** Configures the logger used for logging.
  11. *
  12. * Provide an {@link @aspnet/signalr.ILogger} instance, and log messages will be logged via that instance. Alternatively, provide a value from
  13. * the {@link @aspnet/signalr.LogLevel} enumeration and a default logger which logs to the Console will be configured to log messages of the specified
  14. * level (or higher).
  15. */
  16. logger?: ILogger | LogLevel;
  17. /** A function that provides an access token required for HTTP Bearer authentication.
  18. *
  19. * @returns {string | Promise<string>} A string containing the access token, or a Promise that resolves to a string containing the access token.
  20. */
  21. accessTokenFactory?(): string | Promise<string>;
  22. /** A boolean indicating if message content should be logged.
  23. *
  24. * Message content can contain sensitive user data, so this is disabled by default.
  25. */
  26. logMessageContent?: boolean;
  27. /** A boolean indicating if negotiation should be skipped.
  28. *
  29. * Negotiation can only be skipped when the {@link @aspnet/signalr.IHttpConnectionOptions.transport} property is set to 'HttpTransportType.WebSockets'.
  30. */
  31. skipNegotiation?: boolean;
  32. }