@tsonic/dotnet-pure
Version:
TypeScript type definitions for .NET 10 BCL (Base Class Library) - CLR naming
356 lines (282 loc) • 18.1 kB
TypeScript
// Generated by tsbindgen - Architecture
// Namespace: System.Text.Json.Serialization.Metadata
// Assembly: System.Text.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 { ConcurrentQueue_1, ConcurrentStack_1 } from "../../System.Collections.Concurrent/internal/index.js";
import type { Dictionary_2, IAsyncEnumerable_1, ICollection_1, IDictionary_2, IEnumerable_1, IList_1, IReadOnlyDictionary_2, ISet_1, KeyValuePair_2, List_1, Queue_1, Stack_1 } from "../../System.Collections.Generic/internal/index.js";
import type { IEnumerable, IList } from "../../System.Collections/internal/index.js";
import type { ICustomAttributeProvider } from "../../System.Reflection/internal/index.js";
import type { JsonArray, JsonNode, JsonObject, JsonValue } from "../../System.Text.Json.Nodes/internal/index.js";
import type { JsonConverter, JsonConverter_1, JsonIgnoreCondition, JsonNumberHandling, JsonObjectCreationHandling, JsonSerializerContext, JsonUnknownDerivedTypeHandling, JsonUnmappedMemberHandling } from "../../System.Text.Json.Serialization/internal/index.js";
import type { JsonDocument, JsonElement, JsonSerializerOptions, Utf8JsonWriter } from "../../System.Text.Json/internal/index.js";
import * as System_Internal from "../../System/internal/index.js";
import type { Action_1, Action_2, Boolean as ClrBoolean, Byte, Char, DateOnly, DateTime, DateTimeOffset, Decimal, Double, Enum, Func_1, Func_2, Func_3, Guid, Half, IComparable, IConvertible, IFormatProvider, IFormattable, Int128, Int16, Int32, Int64, ISpanFormattable, Memory_1, Nullable_1, Object as ClrObject, ReadOnlyMemory_1, ReadOnlySpan_1, SByte, Single, String as ClrString, TimeOnly, TimeSpan, Type, TypeCode, UInt128, UInt16, UInt32, UInt64, Uri, ValueType, Version, 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 enum JsonTypeInfoKind {
None = 0,
Object = 1,
Enumerable = 2,
Dictionary = 3
}
export interface IJsonTypeInfoResolver$instance {
GetTypeInfo(type_: Type, options: JsonSerializerOptions): JsonTypeInfo;
}
export type IJsonTypeInfoResolver = IJsonTypeInfoResolver$instance;
export interface JsonDerivedType$instance {
readonly DerivedType: Type;
readonly TypeDiscriminator: unknown;
}
export const JsonDerivedType: {
new(derivedType: Type): JsonDerivedType$instance;
new(derivedType: Type, typeDiscriminator: int): JsonDerivedType$instance;
new(derivedType: Type, typeDiscriminator: string): JsonDerivedType$instance;
};
export type JsonDerivedType = JsonDerivedType$instance;
export interface DefaultJsonTypeInfoResolver$instance {
readonly Modifiers: IList_1<Action_1<JsonTypeInfo>>;
GetTypeInfo(type_: Type, options: JsonSerializerOptions): JsonTypeInfo;
}
export const DefaultJsonTypeInfoResolver: {
new(): DefaultJsonTypeInfoResolver$instance;
};
export interface __DefaultJsonTypeInfoResolver$views {
As_IJsonTypeInfoResolver(): IJsonTypeInfoResolver$instance;
}
export interface DefaultJsonTypeInfoResolver$instance extends IJsonTypeInfoResolver$instance {}
export type DefaultJsonTypeInfoResolver = DefaultJsonTypeInfoResolver$instance & __DefaultJsonTypeInfoResolver$views;
export interface JsonCollectionInfoValues_1$instance<TCollection> {
ElementInfo: JsonTypeInfo;
KeyInfo: JsonTypeInfo;
NumberHandling: JsonNumberHandling;
ObjectCreator: Func_1<TCollection>;
SerializeHandler: Action_2<Utf8JsonWriter, TCollection>;
}
export const JsonCollectionInfoValues_1: {
new<TCollection>(): JsonCollectionInfoValues_1$instance<TCollection>;
};
export type JsonCollectionInfoValues_1<TCollection> = JsonCollectionInfoValues_1$instance<TCollection>;
export interface JsonObjectInfoValues_1$instance<T> {
ConstructorAttributeProviderFactory: Func_1<ICustomAttributeProvider>;
ConstructorParameterMetadataInitializer: Func_1<JsonParameterInfoValues[]>;
NumberHandling: JsonNumberHandling;
ObjectCreator: Func_1<T>;
ObjectWithParameterizedConstructorCreator: Func_2<unknown[], T>;
PropertyMetadataInitializer: Func_2<JsonSerializerContext, JsonPropertyInfo[]>;
SerializeHandler: Action_2<Utf8JsonWriter, T>;
}
export const JsonObjectInfoValues_1: {
new<T>(): JsonObjectInfoValues_1$instance<T>;
};
export type JsonObjectInfoValues_1<T> = JsonObjectInfoValues_1$instance<T>;
export interface JsonParameterInfo$instance {
readonly AttributeProvider: ICustomAttributeProvider;
readonly DeclaringType: Type;
readonly DefaultValue: unknown;
readonly HasDefaultValue: boolean;
readonly IsMemberInitializer: boolean;
readonly IsNullable: boolean;
readonly Name: string;
readonly ParameterType: Type;
readonly Position: int;
}
export const JsonParameterInfo: {
};
export type JsonParameterInfo = JsonParameterInfo$instance;
export interface JsonParameterInfoValues$instance {
DefaultValue: unknown;
HasDefaultValue: boolean;
IsMemberInitializer: boolean;
IsNullable: boolean;
Name: string;
ParameterType: Type;
Position: int;
}
export const JsonParameterInfoValues: {
new(): JsonParameterInfoValues$instance;
};
export type JsonParameterInfoValues = JsonParameterInfoValues$instance;
export interface JsonPolymorphismOptions$instance {
readonly DerivedTypes: IList_1<JsonDerivedType>;
IgnoreUnrecognizedTypeDiscriminators: boolean;
TypeDiscriminatorPropertyName: string;
UnknownDerivedTypeHandling: JsonUnknownDerivedTypeHandling;
}
export const JsonPolymorphismOptions: {
new(): JsonPolymorphismOptions$instance;
};
export type JsonPolymorphismOptions = JsonPolymorphismOptions$instance;
export interface JsonPropertyInfo$instance {
readonly AssociatedParameter: JsonParameterInfo;
AttributeProvider: ICustomAttributeProvider;
CustomConverter: JsonConverter;
readonly DeclaringType: Type;
Get: Func_2<unknown, unknown>;
IsExtensionData: boolean;
IsGetNullable: boolean;
IsRequired: boolean;
IsSetNullable: boolean;
Name: string;
NumberHandling: Nullable_1<JsonNumberHandling>;
ObjectCreationHandling: Nullable_1<JsonObjectCreationHandling>;
readonly Options: JsonSerializerOptions;
Order: int;
readonly PropertyType: Type;
Set: Action_2<unknown, unknown>;
ShouldSerialize: Func_3<unknown, unknown, CLROf<boolean>>;
}
export const JsonPropertyInfo: {
};
export type JsonPropertyInfo = JsonPropertyInfo$instance;
export interface JsonPropertyInfoValues_1$instance<T> {
AttributeProviderFactory: Func_1<ICustomAttributeProvider>;
Converter: JsonConverter_1<T>;
DeclaringType: Type;
Getter: Func_2<unknown, T>;
HasJsonInclude: boolean;
IgnoreCondition: Nullable_1<JsonIgnoreCondition>;
IsExtensionData: boolean;
IsProperty: boolean;
IsPublic: boolean;
IsVirtual: boolean;
JsonPropertyName: string;
NumberHandling: Nullable_1<JsonNumberHandling>;
PropertyName: string;
PropertyTypeInfo: JsonTypeInfo;
Setter: Action_2<unknown, T>;
}
export const JsonPropertyInfoValues_1: {
new<T>(): JsonPropertyInfoValues_1$instance<T>;
};
export type JsonPropertyInfoValues_1<T> = JsonPropertyInfoValues_1$instance<T>;
export interface JsonTypeInfo$instance {
readonly ConstructorAttributeProvider: ICustomAttributeProvider;
readonly Converter: JsonConverter;
CreateObject: Func_1<unknown>;
readonly ElementType: Type;
readonly IsReadOnly: boolean;
readonly KeyType: Type;
readonly Kind: JsonTypeInfoKind;
NumberHandling: Nullable_1<JsonNumberHandling>;
OnDeserialized: Action_1<unknown>;
OnDeserializing: Action_1<unknown>;
OnSerialized: Action_1<unknown>;
OnSerializing: Action_1<unknown>;
readonly Options: JsonSerializerOptions;
OriginatingResolver: IJsonTypeInfoResolver;
PolymorphismOptions: JsonPolymorphismOptions;
PreferredPropertyObjectCreationHandling: Nullable_1<JsonObjectCreationHandling>;
readonly Properties: IList_1<JsonPropertyInfo>;
readonly Type: Type;
UnmappedMemberHandling: Nullable_1<JsonUnmappedMemberHandling>;
CreateJsonPropertyInfo(propertyType: Type, name: string): JsonPropertyInfo;
MakeReadOnly(): void;
}
export const JsonTypeInfo: {
CreateJsonTypeInfo<T>(options: JsonSerializerOptions): JsonTypeInfo_1<T>;
CreateJsonTypeInfo(type_: Type, options: JsonSerializerOptions): JsonTypeInfo;
};
export type JsonTypeInfo = JsonTypeInfo$instance;
export interface JsonTypeInfo_1$instance<T> extends JsonTypeInfo {
CreateObject: Func_1<T>;
readonly SerializeHandler: Action_2<Utf8JsonWriter, T>;
}
export const JsonTypeInfo_1: {
new<T>(): JsonTypeInfo_1$instance<T>;
};
export type JsonTypeInfo_1<T> = JsonTypeInfo_1$instance<T>;
export abstract class JsonMetadataServices$instance {
static readonly BooleanConverter: JsonConverter_1<CLROf<boolean>>;
static readonly ByteArrayConverter: JsonConverter_1<byte[]>;
static readonly ByteConverter: JsonConverter_1<CLROf<byte>>;
static readonly CharConverter: JsonConverter_1<CLROf<char>>;
static readonly DateTimeConverter: JsonConverter_1<DateTime>;
static readonly DateTimeOffsetConverter: JsonConverter_1<DateTimeOffset>;
static readonly DateOnlyConverter: JsonConverter_1<DateOnly>;
static readonly TimeOnlyConverter: JsonConverter_1<TimeOnly>;
static readonly DecimalConverter: JsonConverter_1<CLROf<decimal>>;
static readonly DoubleConverter: JsonConverter_1<CLROf<double>>;
static readonly GuidConverter: JsonConverter_1<Guid>;
static readonly Int16Converter: JsonConverter_1<CLROf<short>>;
static readonly Int32Converter: JsonConverter_1<CLROf<int>>;
static readonly Int64Converter: JsonConverter_1<CLROf<long>>;
static readonly Int128Converter: JsonConverter_1<CLROf<int128>>;
static readonly UInt128Converter: JsonConverter_1<CLROf<uint128>>;
static readonly JsonArrayConverter: JsonConverter_1<JsonArray>;
static readonly JsonElementConverter: JsonConverter_1<JsonElement>;
static readonly JsonNodeConverter: JsonConverter_1<JsonNode>;
static readonly JsonObjectConverter: JsonConverter_1<JsonObject>;
static readonly JsonValueConverter: JsonConverter_1<JsonValue>;
static readonly JsonDocumentConverter: JsonConverter_1<JsonDocument>;
static readonly MemoryByteConverter: JsonConverter_1<Memory_1<CLROf<byte>>>;
static readonly ReadOnlyMemoryByteConverter: JsonConverter_1<ReadOnlyMemory_1<CLROf<byte>>>;
static readonly ObjectConverter: JsonConverter_1<unknown>;
static readonly HalfConverter: JsonConverter_1<CLROf<half>>;
static readonly SingleConverter: JsonConverter_1<CLROf<float>>;
static readonly SByteConverter: JsonConverter_1<CLROf<sbyte>>;
static readonly StringConverter: JsonConverter_1<CLROf<string>>;
static readonly TimeSpanConverter: JsonConverter_1<TimeSpan>;
static readonly UInt16Converter: JsonConverter_1<CLROf<ushort>>;
static readonly UInt32Converter: JsonConverter_1<CLROf<uint>>;
static readonly UInt64Converter: JsonConverter_1<CLROf<ulong>>;
static readonly UriConverter: JsonConverter_1<Uri>;
static readonly VersionConverter: JsonConverter_1<Version>;
static CreateArrayInfo<TElement>(options: JsonSerializerOptions, collectionInfo: JsonCollectionInfoValues_1<TElement[]>): JsonTypeInfo_1<TElement[]>;
static CreateConcurrentQueueInfo<TCollection extends ConcurrentQueue_1<TElement>, TElement>(options: JsonSerializerOptions, collectionInfo: JsonCollectionInfoValues_1<TCollection>): JsonTypeInfo_1<TCollection>;
static CreateConcurrentStackInfo<TCollection extends ConcurrentStack_1<TElement>, TElement>(options: JsonSerializerOptions, collectionInfo: JsonCollectionInfoValues_1<TCollection>): JsonTypeInfo_1<TCollection>;
static CreateDictionaryInfo<TCollection extends Dictionary_2<TKey, TValue>, TKey, TValue>(options: JsonSerializerOptions, collectionInfo: JsonCollectionInfoValues_1<TCollection>): JsonTypeInfo_1<TCollection>;
static CreateIAsyncEnumerableInfo<TCollection extends IAsyncEnumerable_1<TElement>, TElement>(options: JsonSerializerOptions, collectionInfo: JsonCollectionInfoValues_1<TCollection>): JsonTypeInfo_1<TCollection>;
static CreateICollectionInfo<TCollection extends ICollection_1<TElement>, TElement>(options: JsonSerializerOptions, collectionInfo: JsonCollectionInfoValues_1<TCollection>): JsonTypeInfo_1<TCollection>;
static CreateIDictionaryInfo<TCollection extends IDictionary_2<TKey, TValue>, TKey, TValue>(options: JsonSerializerOptions, collectionInfo: JsonCollectionInfoValues_1<TCollection>): JsonTypeInfo_1<TCollection>;
static CreateIEnumerableInfo<TCollection extends IEnumerable_1<TElement>, TElement>(options: JsonSerializerOptions, collectionInfo: JsonCollectionInfoValues_1<TCollection>): JsonTypeInfo_1<TCollection>;
static CreateIListInfo<TCollection extends IList>(options: JsonSerializerOptions, collectionInfo: JsonCollectionInfoValues_1<TCollection>): JsonTypeInfo_1<TCollection>;
static CreateImmutableDictionaryInfo<TCollection extends IReadOnlyDictionary_2<TKey, TValue>, TKey, TValue>(options: JsonSerializerOptions, collectionInfo: JsonCollectionInfoValues_1<TCollection>, createRangeFunc: Func_2<IEnumerable_1<KeyValuePair_2<TKey, TValue>>, TCollection>): JsonTypeInfo_1<TCollection>;
static CreateImmutableEnumerableInfo<TCollection extends IEnumerable_1<TElement>, TElement>(options: JsonSerializerOptions, collectionInfo: JsonCollectionInfoValues_1<TCollection>, createRangeFunc: Func_2<IEnumerable_1<TElement>, TCollection>): JsonTypeInfo_1<TCollection>;
static CreateIReadOnlyDictionaryInfo<TCollection extends IReadOnlyDictionary_2<TKey, TValue>, TKey, TValue>(options: JsonSerializerOptions, collectionInfo: JsonCollectionInfoValues_1<TCollection>): JsonTypeInfo_1<TCollection>;
static CreateISetInfo<TCollection extends ISet_1<TElement>, TElement>(options: JsonSerializerOptions, collectionInfo: JsonCollectionInfoValues_1<TCollection>): JsonTypeInfo_1<TCollection>;
static CreateListInfo<TCollection extends List_1<TElement>, TElement>(options: JsonSerializerOptions, collectionInfo: JsonCollectionInfoValues_1<TCollection>): JsonTypeInfo_1<TCollection>;
static CreateMemoryInfo<TElement>(options: JsonSerializerOptions, collectionInfo: JsonCollectionInfoValues_1<Memory_1<TElement>>): JsonTypeInfo_1<Memory_1<TElement>>;
static CreateObjectInfo<T>(options: JsonSerializerOptions, objectInfo: JsonObjectInfoValues_1<T>): JsonTypeInfo_1<T>;
static CreatePropertyInfo<T>(options: JsonSerializerOptions, propertyInfo: JsonPropertyInfoValues_1<T>): JsonPropertyInfo;
static CreateQueueInfo<TCollection extends IEnumerable>(options: JsonSerializerOptions, collectionInfo: JsonCollectionInfoValues_1<TCollection>, addFunc: Action_2<TCollection, unknown>): JsonTypeInfo_1<TCollection>;
static CreateQueueInfo<TCollection extends Queue_1<TElement>, TElement>(options: JsonSerializerOptions, collectionInfo: JsonCollectionInfoValues_1<TCollection>): JsonTypeInfo_1<TCollection>;
static CreateReadOnlyMemoryInfo<TElement>(options: JsonSerializerOptions, collectionInfo: JsonCollectionInfoValues_1<ReadOnlyMemory_1<TElement>>): JsonTypeInfo_1<ReadOnlyMemory_1<TElement>>;
static CreateStackInfo<TCollection extends IEnumerable>(options: JsonSerializerOptions, collectionInfo: JsonCollectionInfoValues_1<TCollection>, addFunc: Action_2<TCollection, unknown>): JsonTypeInfo_1<TCollection>;
static CreateStackInfo<TCollection extends Stack_1<TElement>, TElement>(options: JsonSerializerOptions, collectionInfo: JsonCollectionInfoValues_1<TCollection>): JsonTypeInfo_1<TCollection>;
static CreateValueInfo<T>(options: JsonSerializerOptions, converter: JsonConverter): JsonTypeInfo_1<T>;
static GetEnumConverter<T extends number>(options: JsonSerializerOptions): JsonConverter_1<T>;
static GetNullableConverter<T extends unknown>(underlyingTypeInfo: JsonTypeInfo_1<T>): JsonConverter_1<Nullable_1<T>>;
static GetNullableConverter<T extends unknown>(options: JsonSerializerOptions): JsonConverter_1<Nullable_1<T>>;
static GetUnsupportedTypeConverter<T>(): JsonConverter_1<T>;
}
export type JsonMetadataServices = JsonMetadataServices$instance;
export abstract class JsonTypeInfoResolver$instance {
static Combine(resolvers: ReadOnlySpan_1<IJsonTypeInfoResolver>): IJsonTypeInfoResolver;
static Combine(resolvers: IJsonTypeInfoResolver[]): IJsonTypeInfoResolver;
static WithAddedModifier(resolver: IJsonTypeInfoResolver, modifier: Action_1<JsonTypeInfo>): IJsonTypeInfoResolver;
}
export type JsonTypeInfoResolver = JsonTypeInfoResolver$instance;