QtWebSockets.pyi 11 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239
  1. # The PEP 484 type hints stub file for the QtWebSockets module.
  2. #
  3. # Generated by SIP 6.15.3
  4. #
  5. # Copyright (c) 2026 Riverbank Computing Limited <info@riverbankcomputing.com>
  6. #
  7. # This file is part of PyQt6.
  8. #
  9. # This file may be used under the terms of the GNU General Public License
  10. # version 3.0 as published by the Free Software Foundation and appearing in
  11. # the file LICENSE included in the packaging of this file. Please review the
  12. # following information to ensure the GNU General Public License version 3.0
  13. # requirements will be met: http://www.gnu.org/copyleft/gpl.html.
  14. #
  15. # If you do not wish to use this file under the terms of the GPL version 3.0
  16. # then you may purchase a commercial license. For more information contact
  17. # info@riverbankcomputing.com.
  18. #
  19. # This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
  20. # WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
  21. import collections, re, typing, enum
  22. try:
  23. from warnings import deprecated
  24. except ImportError:
  25. pass
  26. import PyQt6.sip
  27. from PyQt6 import QtCore
  28. from PyQt6 import QtNetwork
  29. # Support for QDate, QDateTime and QTime.
  30. import datetime
  31. # Convenient type aliases.
  32. PYQT_SIGNAL = typing.Union[QtCore.pyqtSignal, QtCore.pyqtBoundSignal]
  33. PYQT_SLOT = typing.Union[collections.abc.Callable[..., Any], QtCore.pyqtBoundSignal]
  34. class QMaskGenerator(QtCore.QObject):
  35. def __init__(self, parent: QtCore.QObject|None = ...) -> None: ...
  36. def nextMask(self) -> int: ...
  37. def seed(self) -> bool: ...
  38. class QWebSocket(QtCore.QObject):
  39. def __init__(self, origin: str|None = ..., version: 'QWebSocketProtocol.Version' = ..., parent: QtCore.QObject|None = ...) -> None: ...
  40. authenticationRequired: typing.ClassVar[QtCore.pyqtSignal]
  41. errorOccurred: typing.ClassVar[QtCore.pyqtSignal]
  42. def subprotocol(self) -> str: ...
  43. def handshakeOptions(self) -> 'QWebSocketHandshakeOptions': ...
  44. handshakeInterruptedOnError: typing.ClassVar[QtCore.pyqtSignal]
  45. alertReceived: typing.ClassVar[QtCore.pyqtSignal]
  46. alertSent: typing.ClassVar[QtCore.pyqtSignal]
  47. peerVerifyError: typing.ClassVar[QtCore.pyqtSignal]
  48. def continueInterruptedHandshake(self) -> None: ...
  49. @staticmethod
  50. def maxOutgoingFrameSize() -> int: ...
  51. def outgoingFrameSize(self) -> int: ...
  52. def setOutgoingFrameSize(self, outgoingFrameSize: int) -> None: ...
  53. @staticmethod
  54. def maxIncomingFrameSize() -> int: ...
  55. @staticmethod
  56. def maxIncomingMessageSize() -> int: ...
  57. def maxAllowedIncomingMessageSize(self) -> int: ...
  58. def setMaxAllowedIncomingMessageSize(self, maxAllowedIncomingMessageSize: int) -> None: ...
  59. def maxAllowedIncomingFrameSize(self) -> int: ...
  60. def setMaxAllowedIncomingFrameSize(self, maxAllowedIncomingFrameSize: int) -> None: ...
  61. def bytesToWrite(self) -> int: ...
  62. preSharedKeyAuthenticationRequired: typing.ClassVar[QtCore.pyqtSignal]
  63. sslErrors: typing.ClassVar[QtCore.pyqtSignal]
  64. bytesWritten: typing.ClassVar[QtCore.pyqtSignal]
  65. pong: typing.ClassVar[QtCore.pyqtSignal]
  66. binaryMessageReceived: typing.ClassVar[QtCore.pyqtSignal]
  67. textMessageReceived: typing.ClassVar[QtCore.pyqtSignal]
  68. binaryFrameReceived: typing.ClassVar[QtCore.pyqtSignal]
  69. textFrameReceived: typing.ClassVar[QtCore.pyqtSignal]
  70. readChannelFinished: typing.ClassVar[QtCore.pyqtSignal]
  71. proxyAuthenticationRequired: typing.ClassVar[QtCore.pyqtSignal]
  72. stateChanged: typing.ClassVar[QtCore.pyqtSignal]
  73. disconnected: typing.ClassVar[QtCore.pyqtSignal]
  74. connected: typing.ClassVar[QtCore.pyqtSignal]
  75. aboutToClose: typing.ClassVar[QtCore.pyqtSignal]
  76. def ping(self, payload: QtCore.QByteArray|bytes|bytearray|memoryview = ...) -> None: ...
  77. @typing.overload
  78. def open(self, request: QtNetwork.QNetworkRequest, options: 'QWebSocketHandshakeOptions') -> None: ...
  79. @typing.overload
  80. def open(self, url: QtCore.QUrl, options: 'QWebSocketHandshakeOptions') -> None: ...
  81. @typing.overload
  82. def open(self, url: QtCore.QUrl) -> None: ...
  83. @typing.overload
  84. def open(self, request: QtNetwork.QNetworkRequest) -> None: ...
  85. def close(self, closeCode: 'QWebSocketProtocol.CloseCode' = ..., reason: str|None = ...) -> None: ...
  86. def request(self) -> QtNetwork.QNetworkRequest: ...
  87. def sslConfiguration(self) -> QtNetwork.QSslConfiguration: ...
  88. def setSslConfiguration(self, sslConfiguration: QtNetwork.QSslConfiguration) -> None: ...
  89. @typing.overload
  90. def ignoreSslErrors(self, errors: collections.abc.Iterable[QtNetwork.QSslError]) -> None: ...
  91. @typing.overload
  92. def ignoreSslErrors(self) -> None: ...
  93. def sendBinaryMessage(self, data: QtCore.QByteArray|bytes|bytearray|memoryview) -> int: ...
  94. def sendTextMessage(self, message: str|None) -> int: ...
  95. def closeReason(self) -> str: ...
  96. def closeCode(self) -> 'QWebSocketProtocol.CloseCode': ...
  97. def origin(self) -> str: ...
  98. def requestUrl(self) -> QtCore.QUrl: ...
  99. def resourceName(self) -> str: ...
  100. def version(self) -> 'QWebSocketProtocol.Version': ...
  101. def state(self) -> QtNetwork.QAbstractSocket.SocketState: ...
  102. def setPauseMode(self, pauseMode: QtNetwork.QAbstractSocket.PauseMode) -> None: ...
  103. def resume(self) -> None: ...
  104. def setReadBufferSize(self, size: int) -> None: ...
  105. def readBufferSize(self) -> int: ...
  106. def maskGenerator(self) -> QMaskGenerator|None: ...
  107. def setMaskGenerator(self, maskGenerator: QMaskGenerator|None) -> None: ...
  108. def setProxy(self, networkProxy: QtNetwork.QNetworkProxy) -> None: ...
  109. def proxy(self) -> QtNetwork.QNetworkProxy: ...
  110. def peerPort(self) -> int: ...
  111. def peerName(self) -> str: ...
  112. def peerAddress(self) -> QtNetwork.QHostAddress: ...
  113. def pauseMode(self) -> QtNetwork.QAbstractSocket.PauseMode: ...
  114. def localPort(self) -> int: ...
  115. def localAddress(self) -> QtNetwork.QHostAddress: ...
  116. def isValid(self) -> bool: ...
  117. def flush(self) -> bool: ...
  118. def errorString(self) -> str: ...
  119. error: typing.ClassVar[QtCore.pyqtSignal]
  120. def abort(self) -> None: ...
  121. class QWebSocketCorsAuthenticator(PyQt6.sip.simplewrapper):
  122. @typing.overload
  123. def __init__(self, origin: str|None) -> None: ...
  124. @typing.overload
  125. def __init__(self, other: 'QWebSocketCorsAuthenticator') -> None: ...
  126. def allowed(self) -> bool: ...
  127. def setAllowed(self, allowed: bool) -> None: ...
  128. def origin(self) -> str: ...
  129. def swap(self, other: 'QWebSocketCorsAuthenticator') -> None: ...
  130. class QWebSocketHandshakeOptions(PyQt6.sip.simplewrapper):
  131. @typing.overload
  132. def __init__(self) -> None: ...
  133. @typing.overload
  134. def __init__(self, other: 'QWebSocketHandshakeOptions') -> None: ...
  135. def __eq__(self, other: object): ...
  136. def __ne__(self, other: object): ...
  137. def setSubprotocols(self, protocols: collections.abc.Iterable[str|None]) -> None: ...
  138. def subprotocols(self) -> list[str]: ...
  139. def swap(self, other: 'QWebSocketHandshakeOptions') -> None: ...
  140. class QWebSocketProtocol(PyQt6.sip.simplewrapper):
  141. class CloseCode(enum.Enum):
  142. CloseCodeNormal = ... # type: QWebSocketProtocol.CloseCode
  143. CloseCodeGoingAway = ... # type: QWebSocketProtocol.CloseCode
  144. CloseCodeProtocolError = ... # type: QWebSocketProtocol.CloseCode
  145. CloseCodeDatatypeNotSupported = ... # type: QWebSocketProtocol.CloseCode
  146. CloseCodeReserved1004 = ... # type: QWebSocketProtocol.CloseCode
  147. CloseCodeMissingStatusCode = ... # type: QWebSocketProtocol.CloseCode
  148. CloseCodeAbnormalDisconnection = ... # type: QWebSocketProtocol.CloseCode
  149. CloseCodeWrongDatatype = ... # type: QWebSocketProtocol.CloseCode
  150. CloseCodePolicyViolated = ... # type: QWebSocketProtocol.CloseCode
  151. CloseCodeTooMuchData = ... # type: QWebSocketProtocol.CloseCode
  152. CloseCodeMissingExtension = ... # type: QWebSocketProtocol.CloseCode
  153. CloseCodeBadOperation = ... # type: QWebSocketProtocol.CloseCode
  154. CloseCodeTlsHandshakeFailed = ... # type: QWebSocketProtocol.CloseCode
  155. class Version(enum.Enum):
  156. VersionUnknown = ... # type: QWebSocketProtocol.Version
  157. Version0 = ... # type: QWebSocketProtocol.Version
  158. Version4 = ... # type: QWebSocketProtocol.Version
  159. Version5 = ... # type: QWebSocketProtocol.Version
  160. Version6 = ... # type: QWebSocketProtocol.Version
  161. Version7 = ... # type: QWebSocketProtocol.Version
  162. Version8 = ... # type: QWebSocketProtocol.Version
  163. Version13 = ... # type: QWebSocketProtocol.Version
  164. VersionLatest = ... # type: QWebSocketProtocol.Version
  165. class QWebSocketServer(QtCore.QObject):
  166. class SslMode(enum.Enum):
  167. SecureMode = ... # type: QWebSocketServer.SslMode
  168. NonSecureMode = ... # type: QWebSocketServer.SslMode
  169. def __init__(self, serverName: str|None, secureMode: 'QWebSocketServer.SslMode', parent: QtCore.QObject|None = ...) -> None: ...
  170. sslErrorsOccurred: typing.ClassVar[QtCore.pyqtSignal]
  171. def supportedSubprotocols(self) -> list[str]: ...
  172. def setSupportedSubprotocols(self, protocols: collections.abc.Iterable[str|None]) -> None: ...
  173. def handshakeTimeoutMS(self) -> int: ...
  174. def setHandshakeTimeout(self, msec: int) -> None: ...
  175. preSharedKeyAuthenticationRequired: typing.ClassVar[QtCore.pyqtSignal]
  176. closed: typing.ClassVar[QtCore.pyqtSignal]
  177. sslErrors: typing.ClassVar[QtCore.pyqtSignal]
  178. peerVerifyError: typing.ClassVar[QtCore.pyqtSignal]
  179. newConnection: typing.ClassVar[QtCore.pyqtSignal]
  180. originAuthenticationRequired: typing.ClassVar[QtCore.pyqtSignal]
  181. serverError: typing.ClassVar[QtCore.pyqtSignal]
  182. acceptError: typing.ClassVar[QtCore.pyqtSignal]
  183. def handleConnection(self, socket: QtNetwork.QTcpSocket|None) -> None: ...
  184. def serverUrl(self) -> QtCore.QUrl: ...
  185. def supportedVersions(self) -> list[QWebSocketProtocol.Version]: ...
  186. def sslConfiguration(self) -> QtNetwork.QSslConfiguration: ...
  187. def setSslConfiguration(self, sslConfiguration: QtNetwork.QSslConfiguration) -> None: ...
  188. def proxy(self) -> QtNetwork.QNetworkProxy: ...
  189. def setProxy(self, networkProxy: QtNetwork.QNetworkProxy) -> None: ...
  190. def serverName(self) -> str: ...
  191. def setServerName(self, serverName: str|None) -> None: ...
  192. def resumeAccepting(self) -> None: ...
  193. def pauseAccepting(self) -> None: ...
  194. def errorString(self) -> str: ...
  195. def error(self) -> QWebSocketProtocol.CloseCode: ...
  196. def nextPendingConnection(self) -> QWebSocket|None: ...
  197. def hasPendingConnections(self) -> bool: ...
  198. def socketDescriptor(self) -> PyQt6.sip.voidptr: ...
  199. def setSocketDescriptor(self, socketDescriptor: PyQt6.sip.voidptr) -> bool: ...
  200. def secureMode(self) -> 'QWebSocketServer.SslMode': ...
  201. def serverAddress(self) -> QtNetwork.QHostAddress: ...
  202. def serverPort(self) -> int: ...
  203. def maxPendingConnections(self) -> int: ...
  204. def setMaxPendingConnections(self, numConnections: int) -> None: ...
  205. def isListening(self) -> bool: ...
  206. def close(self) -> None: ...
  207. def listen(self, address: QtNetwork.QHostAddress|QtNetwork.QHostAddress.SpecialAddress = ..., port: int = ...) -> bool: ...