@tsonic/dotnet
Version:
TypeScript type definitions for .NET 10 BCL (Base Class Library)
140 lines (122 loc) • 13.4 kB
TypeScript
// Generated by tsbindgen - Architecture
// Namespace: System.Net.Http.Json
// Assembly: System.Net.Http.Json
// Branded primitive types are sourced from @tsonic/types
import type { sbyte, byte, short, ushort, int, uint, long, ulong, int128, uint128, half, float, double, decimal, nint, nuint, char } from '@tsonic/types';
// Import types from other namespaces
import type { IAsyncEnumerable_1 } from "../../System.Collections.Generic/internal/index.js";
import type { Stream } from "../../System.IO/internal/index.js";
import type { HttpContentHeaders, MediaTypeHeaderValue } from "../../System.Net.Http.Headers/internal/index.js";
import * as System_Net_Http_Internal from "../../System.Net.Http/internal/index.js";
import type { HttpClient, HttpContent, HttpResponseMessage } from "../../System.Net.Http/internal/index.js";
import type { TransportContext } from "../../System.Net/internal/index.js";
import type { JsonTypeInfo, JsonTypeInfo_1 } from "../../System.Text.Json.Serialization.Metadata/internal/index.js";
import type { JsonSerializerContext } from "../../System.Text.Json.Serialization/internal/index.js";
import type { JsonSerializerOptions } from "../../System.Text.Json/internal/index.js";
import type { Task, Task_1 } from "../../System.Threading.Tasks/internal/index.js";
import type { CancellationToken } from "../../System.Threading/internal/index.js";
import * as System_Internal from "../../System/internal/index.js";
import type { Boolean as ClrBoolean, Byte, IDisposable, Int32, Int64, Object as ClrObject, String as ClrString, Type, Uri, Void } from "../../System/internal/index.js";
// CLROf<T> - Maps ergonomic primitives to their CLR types for generic constraints
// This utility is used ONLY in generic type arguments to satisfy CLR interface constraints
// Value positions (parameters, return types) use lowercase primitives for ergonomics
export type CLROf<T> =
T extends sbyte ? System_Internal.SByte :
T extends short ? System_Internal.Int16 :
T extends int ? System_Internal.Int32 :
T extends long ? System_Internal.Int64 :
T extends int128 ? System_Internal.Int128 :
T extends nint ? System_Internal.IntPtr :
T extends byte ? System_Internal.Byte :
T extends ushort ? System_Internal.UInt16 :
T extends uint ? System_Internal.UInt32 :
T extends ulong ? System_Internal.UInt64 :
T extends uint128 ? System_Internal.UInt128 :
T extends nuint ? System_Internal.UIntPtr :
T extends half ? System_Internal.Half :
T extends float ? System_Internal.Single :
T extends double ? System_Internal.Double :
T extends decimal ? System_Internal.Decimal :
T extends char ? System_Internal.Char :
T extends boolean ? System_Internal.Boolean :
T extends string ? System_Internal.String :
T; // Identity fallback for non-primitive types
export interface JsonContent$instance extends HttpContent {
readonly objectType: Type;
readonly value: unknown;
dispose(): void;
}
export const JsonContent: {
new(): JsonContent$instance;
create(inputValue: unknown, jsonTypeInfo: JsonTypeInfo, mediaType?: MediaTypeHeaderValue): JsonContent;
create(inputValue: unknown, inputType: Type, mediaType?: MediaTypeHeaderValue, options?: JsonSerializerOptions): JsonContent;
create<T>(inputValue: T, jsonTypeInfo: JsonTypeInfo_1<T>, mediaType?: MediaTypeHeaderValue): JsonContent;
create<T>(inputValue: T, mediaType?: MediaTypeHeaderValue, options?: JsonSerializerOptions): JsonContent;
};
export interface __JsonContent$views {
As_IDisposable(): System_Internal.IDisposable$instance;
}
export type JsonContent = JsonContent$instance & __JsonContent$views;
export abstract class HttpClientJsonExtensions$instance {
static deleteFromJsonAsync<TValue>(client: HttpClient, requestUri: string, jsonTypeInfo: JsonTypeInfo_1<TValue>, cancellationToken?: CancellationToken): Task_1<TValue>;
static deleteFromJsonAsync<TValue>(client: HttpClient, requestUri: string, options: JsonSerializerOptions, cancellationToken?: CancellationToken): Task_1<TValue>;
static deleteFromJsonAsync<TValue>(client: HttpClient, requestUri: string, cancellationToken?: CancellationToken): Task_1<TValue>;
static deleteFromJsonAsync(client: HttpClient, requestUri: string, type_: Type, options: JsonSerializerOptions, cancellationToken?: CancellationToken): Task_1<unknown>;
static deleteFromJsonAsync(client: HttpClient, requestUri: string, type_: Type, context: JsonSerializerContext, cancellationToken?: CancellationToken): Task_1<unknown>;
static deleteFromJsonAsync(client: HttpClient, requestUri: string, type_: Type, cancellationToken?: CancellationToken): Task_1<unknown>;
static deleteFromJsonAsync<TValue>(client: HttpClient, requestUri: Uri, jsonTypeInfo: JsonTypeInfo_1<TValue>, cancellationToken?: CancellationToken): Task_1<TValue>;
static deleteFromJsonAsync<TValue>(client: HttpClient, requestUri: Uri, options: JsonSerializerOptions, cancellationToken?: CancellationToken): Task_1<TValue>;
static deleteFromJsonAsync<TValue>(client: HttpClient, requestUri: Uri, cancellationToken?: CancellationToken): Task_1<TValue>;
static deleteFromJsonAsync(client: HttpClient, requestUri: Uri, type_: Type, options: JsonSerializerOptions, cancellationToken?: CancellationToken): Task_1<unknown>;
static deleteFromJsonAsync(client: HttpClient, requestUri: Uri, type_: Type, context: JsonSerializerContext, cancellationToken?: CancellationToken): Task_1<unknown>;
static deleteFromJsonAsync(client: HttpClient, requestUri: Uri, type_: Type, cancellationToken?: CancellationToken): Task_1<unknown>;
static getFromJsonAsAsyncEnumerable<TValue>(client: HttpClient, requestUri: string, jsonTypeInfo: JsonTypeInfo_1<TValue>, cancellationToken?: CancellationToken): IAsyncEnumerable_1<TValue>;
static getFromJsonAsAsyncEnumerable<TValue>(client: HttpClient, requestUri: string, options: JsonSerializerOptions, cancellationToken?: CancellationToken): IAsyncEnumerable_1<TValue>;
static getFromJsonAsAsyncEnumerable<TValue>(client: HttpClient, requestUri: string, cancellationToken?: CancellationToken): IAsyncEnumerable_1<TValue>;
static getFromJsonAsAsyncEnumerable<TValue>(client: HttpClient, requestUri: Uri, jsonTypeInfo: JsonTypeInfo_1<TValue>, cancellationToken?: CancellationToken): IAsyncEnumerable_1<TValue>;
static getFromJsonAsAsyncEnumerable<TValue>(client: HttpClient, requestUri: Uri, options: JsonSerializerOptions, cancellationToken?: CancellationToken): IAsyncEnumerable_1<TValue>;
static getFromJsonAsAsyncEnumerable<TValue>(client: HttpClient, requestUri: Uri, cancellationToken?: CancellationToken): IAsyncEnumerable_1<TValue>;
static getFromJsonAsync<TValue>(client: HttpClient, requestUri: string, jsonTypeInfo: JsonTypeInfo_1<TValue>, cancellationToken?: CancellationToken): Task_1<TValue>;
static getFromJsonAsync<TValue>(client: HttpClient, requestUri: string, options: JsonSerializerOptions, cancellationToken?: CancellationToken): Task_1<TValue>;
static getFromJsonAsync<TValue>(client: HttpClient, requestUri: string, cancellationToken?: CancellationToken): Task_1<TValue>;
static getFromJsonAsync(client: HttpClient, requestUri: string, type_: Type, options: JsonSerializerOptions, cancellationToken?: CancellationToken): Task_1<unknown>;
static getFromJsonAsync(client: HttpClient, requestUri: string, type_: Type, context: JsonSerializerContext, cancellationToken?: CancellationToken): Task_1<unknown>;
static getFromJsonAsync(client: HttpClient, requestUri: string, type_: Type, cancellationToken?: CancellationToken): Task_1<unknown>;
static getFromJsonAsync<TValue>(client: HttpClient, requestUri: Uri, jsonTypeInfo: JsonTypeInfo_1<TValue>, cancellationToken?: CancellationToken): Task_1<TValue>;
static getFromJsonAsync<TValue>(client: HttpClient, requestUri: Uri, options: JsonSerializerOptions, cancellationToken?: CancellationToken): Task_1<TValue>;
static getFromJsonAsync<TValue>(client: HttpClient, requestUri: Uri, cancellationToken?: CancellationToken): Task_1<TValue>;
static getFromJsonAsync(client: HttpClient, requestUri: Uri, type_: Type, options: JsonSerializerOptions, cancellationToken?: CancellationToken): Task_1<unknown>;
static getFromJsonAsync(client: HttpClient, requestUri: Uri, type_: Type, context: JsonSerializerContext, cancellationToken?: CancellationToken): Task_1<unknown>;
static getFromJsonAsync(client: HttpClient, requestUri: Uri, type_: Type, cancellationToken?: CancellationToken): Task_1<unknown>;
static patchAsJsonAsync<TValue>(client: HttpClient, requestUri: string, value: TValue, jsonTypeInfo: JsonTypeInfo_1<TValue>, cancellationToken?: CancellationToken): Task_1<HttpResponseMessage>;
static patchAsJsonAsync<TValue>(client: HttpClient, requestUri: string, value: TValue, options?: JsonSerializerOptions, cancellationToken?: CancellationToken): Task_1<HttpResponseMessage>;
static patchAsJsonAsync<TValue>(client: HttpClient, requestUri: string, value: TValue, cancellationToken: CancellationToken): Task_1<HttpResponseMessage>;
static patchAsJsonAsync<TValue>(client: HttpClient, requestUri: Uri, value: TValue, jsonTypeInfo: JsonTypeInfo_1<TValue>, cancellationToken?: CancellationToken): Task_1<HttpResponseMessage>;
static patchAsJsonAsync<TValue>(client: HttpClient, requestUri: Uri, value: TValue, options?: JsonSerializerOptions, cancellationToken?: CancellationToken): Task_1<HttpResponseMessage>;
static patchAsJsonAsync<TValue>(client: HttpClient, requestUri: Uri, value: TValue, cancellationToken: CancellationToken): Task_1<HttpResponseMessage>;
static postAsJsonAsync<TValue>(client: HttpClient, requestUri: string, value: TValue, jsonTypeInfo: JsonTypeInfo_1<TValue>, cancellationToken?: CancellationToken): Task_1<HttpResponseMessage>;
static postAsJsonAsync<TValue>(client: HttpClient, requestUri: string, value: TValue, options?: JsonSerializerOptions, cancellationToken?: CancellationToken): Task_1<HttpResponseMessage>;
static postAsJsonAsync<TValue>(client: HttpClient, requestUri: string, value: TValue, cancellationToken: CancellationToken): Task_1<HttpResponseMessage>;
static postAsJsonAsync<TValue>(client: HttpClient, requestUri: Uri, value: TValue, jsonTypeInfo: JsonTypeInfo_1<TValue>, cancellationToken?: CancellationToken): Task_1<HttpResponseMessage>;
static postAsJsonAsync<TValue>(client: HttpClient, requestUri: Uri, value: TValue, options?: JsonSerializerOptions, cancellationToken?: CancellationToken): Task_1<HttpResponseMessage>;
static postAsJsonAsync<TValue>(client: HttpClient, requestUri: Uri, value: TValue, cancellationToken: CancellationToken): Task_1<HttpResponseMessage>;
static putAsJsonAsync<TValue>(client: HttpClient, requestUri: string, value: TValue, jsonTypeInfo: JsonTypeInfo_1<TValue>, cancellationToken?: CancellationToken): Task_1<HttpResponseMessage>;
static putAsJsonAsync<TValue>(client: HttpClient, requestUri: string, value: TValue, options?: JsonSerializerOptions, cancellationToken?: CancellationToken): Task_1<HttpResponseMessage>;
static putAsJsonAsync<TValue>(client: HttpClient, requestUri: string, value: TValue, cancellationToken: CancellationToken): Task_1<HttpResponseMessage>;
static putAsJsonAsync<TValue>(client: HttpClient, requestUri: Uri, value: TValue, jsonTypeInfo: JsonTypeInfo_1<TValue>, cancellationToken?: CancellationToken): Task_1<HttpResponseMessage>;
static putAsJsonAsync<TValue>(client: HttpClient, requestUri: Uri, value: TValue, options?: JsonSerializerOptions, cancellationToken?: CancellationToken): Task_1<HttpResponseMessage>;
static putAsJsonAsync<TValue>(client: HttpClient, requestUri: Uri, value: TValue, cancellationToken: CancellationToken): Task_1<HttpResponseMessage>;
}
export type HttpClientJsonExtensions = HttpClientJsonExtensions$instance;
export abstract class HttpContentJsonExtensions$instance {
static readFromJsonAsAsyncEnumerable<TValue>(content: HttpContent, jsonTypeInfo: JsonTypeInfo_1<TValue>, cancellationToken?: CancellationToken): IAsyncEnumerable_1<TValue>;
static readFromJsonAsAsyncEnumerable<TValue>(content: HttpContent, options: JsonSerializerOptions, cancellationToken?: CancellationToken): IAsyncEnumerable_1<TValue>;
static readFromJsonAsAsyncEnumerable<TValue>(content: HttpContent, cancellationToken?: CancellationToken): IAsyncEnumerable_1<TValue>;
static readFromJsonAsync<T>(content: HttpContent, jsonTypeInfo: JsonTypeInfo_1<T>, cancellationToken?: CancellationToken): Task_1<T>;
static readFromJsonAsync<T>(content: HttpContent, options: JsonSerializerOptions, cancellationToken?: CancellationToken): Task_1<T>;
static readFromJsonAsync<T>(content: HttpContent, cancellationToken?: CancellationToken): Task_1<T>;
static readFromJsonAsync(content: HttpContent, type_: Type, options: JsonSerializerOptions, cancellationToken?: CancellationToken): Task_1<unknown>;
static readFromJsonAsync(content: HttpContent, type_: Type, context: JsonSerializerContext, cancellationToken?: CancellationToken): Task_1<unknown>;
static readFromJsonAsync(content: HttpContent, type_: Type, cancellationToken?: CancellationToken): Task_1<unknown>;
}
export type HttpContentJsonExtensions = HttpContentJsonExtensions$instance;