JsonHubProtocol.d.ts 1.2 KB

12345678910111213141516171819202122232425262728
  1. import { HubMessage, IHubProtocol } from "./IHubProtocol";
  2. import { ILogger } from "./ILogger";
  3. import { TransferFormat } from "./ITransport";
  4. /** Implements the JSON Hub Protocol. */
  5. export declare class JsonHubProtocol implements IHubProtocol {
  6. /** @inheritDoc */
  7. readonly name: string;
  8. /** @inheritDoc */
  9. readonly version: number;
  10. /** @inheritDoc */
  11. readonly transferFormat: TransferFormat;
  12. /** Creates an array of {@link @microsoft/signalr.HubMessage} objects from the specified serialized representation.
  13. *
  14. * @param {string} input A string containing the serialized representation.
  15. * @param {ILogger} logger A logger that will be used to log messages that occur during parsing.
  16. */
  17. parseMessages(input: string, logger: ILogger): HubMessage[];
  18. /** Writes the specified {@link @microsoft/signalr.HubMessage} to a string and returns it.
  19. *
  20. * @param {HubMessage} message The message to write.
  21. * @returns {string} A string containing the serialized representation of the message.
  22. */
  23. writeMessage(message: HubMessage): string;
  24. private _isInvocationMessage;
  25. private _isStreamItemMessage;
  26. private _isCompletionMessage;
  27. private _assertNotEmptyString;
  28. }