@tsonic/dotnet
Version:
TypeScript type definitions for .NET 10 BCL (Base Class Library)
89 lines (69 loc) • 3.55 kB
TypeScript
// Generated by tsbindgen - Architecture
// Namespace: System.Threading.Tasks.Sources
// Assembly: System.Private.CoreLib
// 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 * as System_Internal from "../../System/internal/index.js";
import type { Action_1, Boolean as ClrBoolean, Enum, Exception, IComparable, IConvertible, IFormatProvider, IFormattable, Int16, Int32, ISpanFormattable, Object as ClrObject, String as ClrString, Type, TypeCode, 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 enum ValueTaskSourceOnCompletedFlags {
none = 0,
useSchedulingContext = 1,
flowExecutionContext = 2
}
export enum ValueTaskSourceStatus {
pending = 0,
succeeded = 1,
faulted = 2,
canceled = 3
}
export interface IValueTaskSource$instance {
getResult(token: short): void;
getStatus(token: short): ValueTaskSourceStatus;
onCompleted(continuation: Action_1<unknown>, state: unknown, token: short, flags: ValueTaskSourceOnCompletedFlags): void;
}
export type IValueTaskSource = IValueTaskSource$instance;
export interface IValueTaskSource_1$instance<TResult> {
getResult(token: short): TResult;
getStatus(token: short): ValueTaskSourceStatus;
onCompleted(continuation: Action_1<unknown>, state: unknown, token: short, flags: ValueTaskSourceOnCompletedFlags): void;
}
export type IValueTaskSource_1<TResult> = IValueTaskSource_1$instance<TResult>;
export interface ManualResetValueTaskSourceCore_1$instance<TResult> {
runContinuationsAsynchronously: boolean;
readonly version: short;
getResult(token: short): TResult;
getStatus(token: short): ValueTaskSourceStatus;
onCompleted(continuation: Action_1<unknown>, state: unknown, token: short, flags: ValueTaskSourceOnCompletedFlags): void;
reset(): void;
setException(error: Exception): void;
setResult(result: TResult): void;
}
export const ManualResetValueTaskSourceCore_1: {
new<TResult>(): ManualResetValueTaskSourceCore_1$instance<TResult>;
};
export type ManualResetValueTaskSourceCore_1<TResult> = ManualResetValueTaskSourceCore_1$instance<TResult>;