@tsonic/dotnet-types
Version:
TypeScript declarations and metadata for .NET 10.0 assemblies
186 lines (169 loc) • 9.82 kB
TypeScript
// Auto-generated by generatedts on 2025-11-02T09:57:42Z - do not edit by hand.
type int = number & { __brand: "int" };
type uint = number & { __brand: "uint" };
type byte = number & { __brand: "byte" };
type sbyte = number & { __brand: "sbyte" };
type short = number & { __brand: "short" };
type ushort = number & { __brand: "ushort" };
type long = number & { __brand: "long" };
type ulong = number & { __brand: "ulong" };
type float = number & { __brand: "float" };
type double = number & { __brand: "double" };
type decimal = number & { __brand: "decimal" };
declare namespace System.Net.WebSockets {
class ValueWebSocketReceiveResult {
constructor(count: int, messageType: System.Net.WebSockets.WebSocketMessageType, endOfMessage: boolean);
readonly Count: int;
readonly EndOfMessage: boolean;
readonly MessageType: System.Net.WebSockets.WebSocketMessageType;
}
class WebSocket implements System.IDisposable {
readonly CloseStatus: System.Net.WebSockets.WebSocketCloseStatus | null;
readonly CloseStatusDescription: string;
readonly SubProtocol: string;
readonly State: System.Net.WebSockets.WebSocketState;
static readonly DefaultKeepAliveInterval: System.TimeSpan;
Abort(): void;
CloseAsync(closeStatus: System.Net.WebSockets.WebSocketCloseStatus, statusDescription: string, cancellationToken: System.Threading.CancellationToken): System.Threading.Tasks.Task;
CloseOutputAsync(closeStatus: System.Net.WebSockets.WebSocketCloseStatus, statusDescription: string, cancellationToken: System.Threading.CancellationToken): System.Threading.Tasks.Task;
Dispose(): void;
ReceiveAsync(buffer: System.ArraySegment<byte>, cancellationToken: System.Threading.CancellationToken): Promise<System.Net.WebSockets.WebSocketReceiveResult>;
SendAsync(buffer: System.ArraySegment<byte>, messageType: System.Net.WebSockets.WebSocketMessageType, endOfMessage: boolean, cancellationToken: System.Threading.CancellationToken): System.Threading.Tasks.Task;
ReceiveAsync(buffer: System.Memory<byte>, cancellationToken: System.Threading.CancellationToken): System.Threading.Tasks.ValueTask<System.Net.WebSockets.ValueWebSocketReceiveResult>;
SendAsync(buffer: System.ReadOnlyMemory<byte>, messageType: System.Net.WebSockets.WebSocketMessageType, endOfMessage: boolean, cancellationToken: System.Threading.CancellationToken): System.Threading.Tasks.ValueTask;
SendAsync(buffer: System.ReadOnlyMemory<byte>, messageType: System.Net.WebSockets.WebSocketMessageType, messageFlags: System.Net.WebSockets.WebSocketMessageFlags, cancellationToken?: System.Threading.CancellationToken): System.Threading.Tasks.ValueTask;
static CreateClientBuffer(receiveBufferSize: int, sendBufferSize: int): System.ArraySegment<byte>;
static CreateServerBuffer(receiveBufferSize: int): System.ArraySegment<byte>;
static CreateFromStream(stream: System.IO.Stream, isServer: boolean, subProtocol: string, keepAliveInterval: System.TimeSpan): System.Net.WebSockets.WebSocket;
static CreateFromStream(stream: System.IO.Stream, options: System.Net.WebSockets.WebSocketCreationOptions): System.Net.WebSockets.WebSocket;
static IsApplicationTargeting45(): boolean;
static RegisterPrefixes(): void;
static CreateClientWebSocket(innerStream: System.IO.Stream, subProtocol: string, receiveBufferSize: int, sendBufferSize: int, keepAliveInterval: System.TimeSpan, useZeroMaskingKey: boolean, internalBuffer: System.ArraySegment<byte>): System.Net.WebSockets.WebSocket;
}
enum WebSocketCloseStatus {
NormalClosure = 1000,
EndpointUnavailable = 1001,
ProtocolError = 1002,
InvalidMessageType = 1003,
Empty = 1005,
InvalidPayloadData = 1007,
PolicyViolation = 1008,
MessageTooBig = 1009,
MandatoryExtension = 1010,
InternalServerError = 1011
}
class WebSocketContext {
readonly RequestUri: System.Uri;
readonly Headers: System.Collections.Specialized.NameValueCollection;
readonly Origin: string;
readonly SecWebSocketProtocols: ReadonlyArray<string>;
readonly SecWebSocketVersion: string;
readonly SecWebSocketKey: string;
readonly CookieCollection: System.Net.CookieCollection;
readonly User: System.Security.Principal.IPrincipal;
readonly IsAuthenticated: boolean;
readonly IsLocal: boolean;
readonly IsSecureConnection: boolean;
readonly WebSocket: System.Net.WebSockets.WebSocket;
}
class WebSocketCreationOptions {
constructor();
IsServer: boolean;
SubProtocol: string;
KeepAliveInterval: System.TimeSpan;
KeepAliveTimeout: System.TimeSpan;
DangerousDeflateOptions: System.Net.WebSockets.WebSocketDeflateOptions;
}
class WebSocketDeflateOptions {
constructor();
ClientMaxWindowBits: int;
ClientContextTakeover: boolean;
ServerMaxWindowBits: int;
ServerContextTakeover: boolean;
}
enum WebSocketError {
Success = 0,
InvalidMessageType = 1,
Faulted = 2,
NativeError = 3,
NotAWebSocket = 4,
UnsupportedVersion = 5,
UnsupportedProtocol = 6,
HeaderError = 7,
ConnectionClosedPrematurely = 8,
InvalidState = 9
}
class WebSocketException extends System.ComponentModel.Win32Exception implements System.Runtime.Serialization.ISerializable {
constructor();
constructor(error: System.Net.WebSockets.WebSocketError);
constructor(error: System.Net.WebSockets.WebSocketError, message: string);
constructor(error: System.Net.WebSockets.WebSocketError, innerException: System.Exception);
constructor(error: System.Net.WebSockets.WebSocketError, message: string, innerException: System.Exception);
constructor(nativeError: int);
constructor(nativeError: int, message: string);
constructor(nativeError: int, innerException: System.Exception);
constructor(error: System.Net.WebSockets.WebSocketError, nativeError: int);
constructor(error: System.Net.WebSockets.WebSocketError, nativeError: int, message: string);
constructor(error: System.Net.WebSockets.WebSocketError, nativeError: int, innerException: System.Exception);
constructor(error: System.Net.WebSockets.WebSocketError, nativeError: int, message: string, innerException: System.Exception);
constructor(message: string);
constructor(message: string, innerException: System.Exception);
readonly ErrorCode: int;
readonly WebSocketErrorCode: System.Net.WebSockets.WebSocketError;
GetObjectData(info: System.Runtime.Serialization.SerializationInfo, context: System.Runtime.Serialization.StreamingContext): void;
}
enum WebSocketMessageFlags {
None = 0,
EndOfMessage = 1,
DisableCompression = 2
}
enum WebSocketMessageType {
Text = 0,
Binary = 1,
Close = 2
}
class WebSocketReceiveResult {
constructor(count: int, messageType: System.Net.WebSockets.WebSocketMessageType, endOfMessage: boolean);
constructor(count: int, messageType: System.Net.WebSockets.WebSocketMessageType, endOfMessage: boolean, closeStatus: System.Net.WebSockets.WebSocketCloseStatus | null, closeStatusDescription: string);
readonly Count: int;
readonly EndOfMessage: boolean;
readonly MessageType: System.Net.WebSockets.WebSocketMessageType;
readonly CloseStatus: System.Net.WebSockets.WebSocketCloseStatus | null;
readonly CloseStatusDescription: string;
}
enum WebSocketState {
None = 0,
Connecting = 1,
Open = 2,
CloseSent = 3,
CloseReceived = 4,
Closed = 5,
Aborted = 6
}
class WebSocketStream extends System.IO.Stream implements System.IDisposable, System.IAsyncDisposable {
readonly WebSocket: System.Net.WebSockets.WebSocket;
readonly CanRead: boolean;
readonly CanWrite: boolean;
readonly CanSeek: boolean;
readonly Length: long;
Position: long;
static Create(webSocket: System.Net.WebSockets.WebSocket, writeMessageType: System.Net.WebSockets.WebSocketMessageType, ownsWebSocket?: boolean): System.Net.WebSockets.WebSocketStream;
static Create(webSocket: System.Net.WebSockets.WebSocket, writeMessageType: System.Net.WebSockets.WebSocketMessageType, closeTimeout: System.TimeSpan): System.Net.WebSockets.WebSocketStream;
static CreateWritableMessageStream(webSocket: System.Net.WebSockets.WebSocket, writeMessageType: System.Net.WebSockets.WebSocketMessageType): System.Net.WebSockets.WebSocketStream;
static CreateReadableMessageStream(webSocket: System.Net.WebSockets.WebSocket): System.Net.WebSockets.WebSocketStream;
Flush(): void;
FlushAsync(cancellationToken: System.Threading.CancellationToken): System.Threading.Tasks.Task;
ReadAsync(buffer: ReadonlyArray<byte>, offset: int, count: int, cancellationToken: System.Threading.CancellationToken): Promise<int>;
ReadAsync(buffer: System.Memory<byte>, cancellationToken?: System.Threading.CancellationToken): System.Threading.Tasks.ValueTask<int>;
BeginRead(buffer: ReadonlyArray<byte>, offset: int, count: int, callback: System.AsyncCallback, state: any): System.IAsyncResult;
EndRead(asyncResult: System.IAsyncResult): int;
WriteAsync(buffer: ReadonlyArray<byte>, offset: int, count: int, cancellationToken: System.Threading.CancellationToken): System.Threading.Tasks.Task;
WriteAsync(buffer: System.ReadOnlyMemory<byte>, cancellationToken?: System.Threading.CancellationToken): System.Threading.Tasks.ValueTask;
BeginWrite(buffer: ReadonlyArray<byte>, offset: int, count: int, callback: System.AsyncCallback, state: any): System.IAsyncResult;
EndWrite(asyncResult: System.IAsyncResult): void;
Read(buffer: ReadonlyArray<byte>, offset: int, count: int): int;
Write(buffer: ReadonlyArray<byte>, offset: int, count: int): void;
Seek(offset: long, origin: System.IO.SeekOrigin): long;
SetLength(value: long): void;
}
}