UNPKG

@tsonic/dotnet-pure

Version:

TypeScript type definitions for .NET 10 BCL (Base Class Library) - CLR naming

223 lines (188 loc) 11.8 kB
// Generated by tsbindgen - Architecture // Namespace: System.Text.Json.Nodes // 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 support types from @tsonic/types import type { ptr, ref } from "@tsonic/types"; // Import types from other namespaces import * as System_Collections_Generic_Internal from "../../System.Collections.Generic/internal/index.js"; import type { ICollection_1, IDictionary_2, IEnumerable_1, IEnumerator_1, IList_1, KeyValuePair_2 } from "../../System.Collections.Generic/internal/index.js"; import * as System_Collections_Internal from "../../System.Collections/internal/index.js"; import type { IEnumerable, IEnumerator } from "../../System.Collections/internal/index.js"; import type { Stream } from "../../System.IO/internal/index.js"; import type { JsonTypeInfo_1 } from "../../System.Text.Json.Serialization.Metadata/internal/index.js"; import type { JsonDocumentOptions, JsonElement, JsonSerializerOptions, JsonValueKind, Utf8JsonReader, Utf8JsonWriter } from "../../System.Text.Json/internal/index.js"; import type { 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, Char, DateTime, DateTimeOffset, Decimal, Double, Func_2, Guid, Int16, Int32, Int64, Nullable_1, Object as ClrObject, ReadOnlySpan_1, SByte, Single, String as ClrString, Type, UInt16, UInt32, UInt64, ValueType, 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 JsonNodeOptions$instance { PropertyNameCaseInsensitive: boolean; } export const JsonNodeOptions: { new(): JsonNodeOptions$instance; }; export type JsonNodeOptions = JsonNodeOptions$instance; export interface JsonArray$instance extends JsonNode { readonly Count: int; Add<T>(value: T): void; Add(item: JsonNode): void; Clear(): void; Contains(item: JsonNode): boolean; GetEnumerator(): IEnumerator_1<JsonNode>; GetValues<T>(): IEnumerable_1<T>; IndexOf(item: JsonNode): int; Insert(index: int, item: JsonNode): void; Remove(item: JsonNode): boolean; RemoveAll(match: Func_2<JsonNode, CLROf<boolean>>): int; RemoveAt(index: int): void; RemoveRange(index: int, count: int): void; WriteTo(writer: Utf8JsonWriter, options?: JsonSerializerOptions): void; } export const JsonArray: { new(options: Nullable_1<JsonNodeOptions>): JsonArray$instance; new(options: JsonNodeOptions, items: JsonNode[]): JsonArray$instance; new(options: JsonNodeOptions, items: ReadOnlySpan_1<JsonNode>): JsonArray$instance; new(items: JsonNode[]): JsonArray$instance; new(items: ReadOnlySpan_1<JsonNode>): JsonArray$instance; Create(element: JsonElement, options?: Nullable_1<JsonNodeOptions>): JsonArray; }; export interface __JsonArray$views { As_ICollection_1(): System_Collections_Generic_Internal.ICollection_1$instance<JsonNode>; As_IEnumerable_1(): System_Collections_Generic_Internal.IEnumerable_1$instance<JsonNode>; As_IList_1(): System_Collections_Generic_Internal.IList_1$instance<JsonNode>; As_IEnumerable(): System_Collections_Internal.IEnumerable$instance; } export type JsonArray = JsonArray$instance & __JsonArray$views; export interface JsonNode$instance { readonly Options: Nullable_1<JsonNodeOptions>; readonly Parent: JsonNode; readonly Root: JsonNode; AsArray(): JsonArray; AsObject(): JsonObject; AsValue(): JsonValue; DeepClone(): JsonNode; get_Item(index: int): JsonNode; get_Item(propertyName: string): JsonNode; GetElementIndex(): int; GetPath(): string; GetPropertyName(): string; GetValue<T>(): T; GetValueKind(): JsonValueKind; ReplaceWith<T>(value: T): void; set_Item(index: int, value: JsonNode): void; set_Item(propertyName: string, value: JsonNode): void; ToJsonString(options?: JsonSerializerOptions): string; ToString(): string; WriteTo(writer: Utf8JsonWriter, options?: JsonSerializerOptions): void; } export const JsonNode: { DeepEquals(node1: JsonNode, node2: JsonNode): boolean; Parse(utf8Json: Stream, nodeOptions?: Nullable_1<JsonNodeOptions>, documentOptions?: JsonDocumentOptions): JsonNode; Parse(utf8Json: ReadOnlySpan_1<CLROf<byte>>, nodeOptions?: Nullable_1<JsonNodeOptions>, documentOptions?: JsonDocumentOptions): JsonNode; Parse(json: string, nodeOptions?: Nullable_1<JsonNodeOptions>, documentOptions?: JsonDocumentOptions): JsonNode; Parse(reader: { value: ref<Utf8JsonReader> }, nodeOptions?: Nullable_1<JsonNodeOptions>): JsonNode; ParseAsync(utf8Json: Stream, nodeOptions?: Nullable_1<JsonNodeOptions>, documentOptions?: JsonDocumentOptions, cancellationToken?: CancellationToken): Task_1<JsonNode>; }; export type JsonNode = JsonNode$instance; export interface JsonObject$instance extends JsonNode { readonly Count: int; Add(propertyName: string, value: JsonNode): void; Add(property: KeyValuePair_2<CLROf<string>, JsonNode>): void; Clear(): void; ContainsKey(propertyName: string): boolean; GetAt(index: int): KeyValuePair_2<CLROf<string>, JsonNode>; GetEnumerator(): IEnumerator_1<KeyValuePair_2<CLROf<string>, JsonNode>>; IndexOf(propertyName: string): int; Insert(index: int, propertyName: string, value: JsonNode): void; Remove(propertyName: string): boolean; RemoveAt(index: int): void; SetAt(index: int, propertyName: string, value: JsonNode): void; SetAt(index: int, value: JsonNode): void; TryAdd(propertyName: string, value: JsonNode): boolean; TryAdd(propertyName: string, value: JsonNode, index: { value: ref<int> }): boolean; TryGetPropertyValue(propertyName: string, jsonNode: { value: ref<JsonNode> }): boolean; TryGetPropertyValue(propertyName: string, jsonNode: { value: ref<JsonNode> }, index: { value: ref<int> }): boolean; WriteTo(writer: Utf8JsonWriter, options?: JsonSerializerOptions): void; } export const JsonObject: { new(options: Nullable_1<JsonNodeOptions>): JsonObject$instance; new(properties: IEnumerable_1<KeyValuePair_2<CLROf<string>, JsonNode>>, options: Nullable_1<JsonNodeOptions>): JsonObject$instance; Create(element: JsonElement, options?: Nullable_1<JsonNodeOptions>): JsonObject; }; export interface __JsonObject$views { As_ICollection_1(): System_Collections_Generic_Internal.ICollection_1$instance<KeyValuePair_2<CLROf<string>, JsonNode>>; As_IDictionary_2(): System_Collections_Generic_Internal.IDictionary_2$instance<CLROf<string>, JsonNode>; As_IEnumerable_1(): System_Collections_Generic_Internal.IEnumerable_1$instance<KeyValuePair_2<CLROf<string>, JsonNode>>; As_IList_1(): System_Collections_Generic_Internal.IList_1$instance<KeyValuePair_2<CLROf<string>, JsonNode>>; As_IEnumerable(): System_Collections_Internal.IEnumerable$instance; } export type JsonObject = JsonObject$instance & __JsonObject$views; export interface JsonValue$instance extends JsonNode { TryGetValue<T>(value: { value: ref<T> }): boolean; } export const JsonValue: { Create(value: boolean, options?: Nullable_1<JsonNodeOptions>): JsonValue; Create(value: byte, options?: Nullable_1<JsonNodeOptions>): JsonValue; Create(value: char, options?: Nullable_1<JsonNodeOptions>): JsonValue; Create(value: DateTime, options?: Nullable_1<JsonNodeOptions>): JsonValue; Create(value: DateTimeOffset, options?: Nullable_1<JsonNodeOptions>): JsonValue; Create(value: decimal, options?: Nullable_1<JsonNodeOptions>): JsonValue; Create(value: double, options?: Nullable_1<JsonNodeOptions>): JsonValue; Create(value: Guid, options?: Nullable_1<JsonNodeOptions>): JsonValue; Create(value: short, options?: Nullable_1<JsonNodeOptions>): JsonValue; Create(value: int, options?: Nullable_1<JsonNodeOptions>): JsonValue; Create(value: long, options?: Nullable_1<JsonNodeOptions>): JsonValue; Create(value: Nullable_1<CLROf<boolean>>, options?: Nullable_1<JsonNodeOptions>): JsonValue; Create(value: Nullable_1<CLROf<byte>>, options?: Nullable_1<JsonNodeOptions>): JsonValue; Create(value: Nullable_1<CLROf<char>>, options?: Nullable_1<JsonNodeOptions>): JsonValue; Create(value: Nullable_1<DateTime>, options?: Nullable_1<JsonNodeOptions>): JsonValue; Create(value: Nullable_1<DateTimeOffset>, options?: Nullable_1<JsonNodeOptions>): JsonValue; Create(value: Nullable_1<CLROf<decimal>>, options?: Nullable_1<JsonNodeOptions>): JsonValue; Create(value: Nullable_1<CLROf<double>>, options?: Nullable_1<JsonNodeOptions>): JsonValue; Create(value: Nullable_1<Guid>, options?: Nullable_1<JsonNodeOptions>): JsonValue; Create(value: Nullable_1<CLROf<short>>, options?: Nullable_1<JsonNodeOptions>): JsonValue; Create(value: Nullable_1<CLROf<int>>, options?: Nullable_1<JsonNodeOptions>): JsonValue; Create(value: Nullable_1<CLROf<long>>, options?: Nullable_1<JsonNodeOptions>): JsonValue; Create(value: Nullable_1<CLROf<sbyte>>, options?: Nullable_1<JsonNodeOptions>): JsonValue; Create(value: Nullable_1<CLROf<float>>, options?: Nullable_1<JsonNodeOptions>): JsonValue; Create(value: Nullable_1<JsonElement>, options?: Nullable_1<JsonNodeOptions>): JsonValue; Create(value: Nullable_1<CLROf<ushort>>, options?: Nullable_1<JsonNodeOptions>): JsonValue; Create(value: Nullable_1<CLROf<uint>>, options?: Nullable_1<JsonNodeOptions>): JsonValue; Create(value: Nullable_1<CLROf<ulong>>, options?: Nullable_1<JsonNodeOptions>): JsonValue; Create(value: sbyte, options?: Nullable_1<JsonNodeOptions>): JsonValue; Create(value: float, options?: Nullable_1<JsonNodeOptions>): JsonValue; Create(value: string, options?: Nullable_1<JsonNodeOptions>): JsonValue; Create(value: JsonElement, options?: Nullable_1<JsonNodeOptions>): JsonValue; Create(value: ushort, options?: Nullable_1<JsonNodeOptions>): JsonValue; Create(value: uint, options?: Nullable_1<JsonNodeOptions>): JsonValue; Create(value: ulong, options?: Nullable_1<JsonNodeOptions>): JsonValue; Create<T>(value: T, jsonTypeInfo: JsonTypeInfo_1<T>, options?: Nullable_1<JsonNodeOptions>): JsonValue; Create<T>(value: T, options?: Nullable_1<JsonNodeOptions>): JsonValue; }; export type JsonValue = JsonValue$instance;