@tsonic/dotnet
Version:
TypeScript type definitions for .NET 10 BCL (Base Class Library)
503 lines (359 loc) • 14.4 kB
TypeScript
// Generated by tsbindgen - Architecture
// Namespace: System.Diagnostics.Tracing
// 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 support types from @tsonic/types
import type { ptr, ref } from "@tsonic/types";
// Import types from other namespaces
import type { IDictionary_2, IEnumerable_1 } from "../../System.Collections.Generic/internal/index.js";
import type { ReadOnlyCollection_1 } from "../../System.Collections.ObjectModel/internal/index.js";
import type { IDictionary } from "../../System.Collections/internal/index.js";
import type { MethodBase } from "../../System.Reflection/internal/index.js";
import * as System_Runtime_Serialization_Internal from "../../System.Runtime.Serialization/internal/index.js";
import type { ISerializable, SerializationInfo, StreamingContext } from "../../System.Runtime.Serialization/internal/index.js";
import * as System_Internal from "../../System/internal/index.js";
import type { Attribute, Boolean as ClrBoolean, Byte, DateTime, Double, Enum, EventArgs, EventHandler_1, Exception, Func_1, Guid, IComparable, IConvertible, IDisposable, IFormatProvider, IFormattable, Int32, Int64, ISpanFormattable, Object as ClrObject, Single, String as ClrString, TimeSpan, 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 EventActivityOptions {
none = 0,
disable = 2,
recursive = 4,
detachable = 8
}
export enum EventChannel {
none = 0,
admin = 16,
operational = 17,
analytic = 18,
debug = 19
}
export enum EventCommand {
update = 0,
sendManifest = -1,
enable = -2,
disable = -3
}
export enum EventFieldFormat {
default_ = 0,
string_ = 2,
boolean_ = 3,
hexadecimal = 4,
xml = 11,
json = 12,
hResult = 15
}
export enum EventFieldTags {
none = 0
}
export enum EventKeywords {
none = 0,
all = -1,
microsoftTelemetry = 562949953421312,
wdiContext = 562949953421312,
wdiDiagnostic = 1125899906842624,
sqm = 2251799813685248,
auditFailure = 4503599627370496,
auditSuccess = 9007199254740992,
correlationHint = 4503599627370496,
eventLogClassic = 36028797018963968
}
export enum EventLevel {
logAlways = 0,
critical = 1,
error = 2,
warning = 3,
informational = 4,
verbose = 5
}
export enum EventManifestOptions {
none = 0,
strict = 1,
allCultures = 2,
onlyIfNeededForRegistration = 4,
allowEventSourceOverride = 8
}
export enum EventOpcode {
info = 0,
start = 1,
stop = 2,
dataCollectionStart = 3,
dataCollectionStop = 4,
extension = 5,
reply = 6,
resume = 7,
suspend = 8,
send = 9,
receive = 240
}
export enum EventSourceSettings {
default_ = 0,
throwOnEventWriteErrors = 1,
etwManifestEventFormat = 4,
etwSelfDescribingEventFormat = 8
}
export enum EventTags {
none = 0
}
export enum EventTask {
none = 0
}
export interface EventSource_EventSourcePrimitive$instance {
}
export const EventSource_EventSourcePrimitive: {
new(): EventSource_EventSourcePrimitive$instance;
};
export type EventSource_EventSourcePrimitive = EventSource_EventSourcePrimitive$instance;
export interface EventSourceOptions$instance {
activityOptions: EventActivityOptions;
keywords: EventKeywords;
level: EventLevel;
opcode: EventOpcode;
tags: EventTags;
}
export const EventSourceOptions: {
new(): EventSourceOptions$instance;
};
export type EventSourceOptions = EventSourceOptions$instance;
export interface DiagnosticCounter$instance {
displayName: string;
displayUnits: string;
readonly eventSource: EventSource;
readonly name: string;
addMetadata(key: string, value: string): void;
dispose(): void;
}
export const DiagnosticCounter: {
};
export interface __DiagnosticCounter$views {
As_IDisposable(): System_Internal.IDisposable$instance;
}
export interface DiagnosticCounter$instance extends System_Internal.IDisposable$instance {}
export type DiagnosticCounter = DiagnosticCounter$instance & __DiagnosticCounter$views;
export interface EventAttribute$instance extends Attribute {
activityOptions: EventActivityOptions;
channel: EventChannel;
readonly eventId: int;
keywords: EventKeywords;
level: EventLevel;
message: string;
opcode: EventOpcode;
tags: EventTags;
task: EventTask;
version: byte;
}
export const EventAttribute: {
new(eventId: int): EventAttribute$instance;
};
export type EventAttribute = EventAttribute$instance;
export interface EventCommandEventArgs$instance extends EventArgs {
readonly arguments: IDictionary_2<CLROf<string>, CLROf<string>>;
readonly command: EventCommand;
disableEvent(eventId: int): boolean;
enableEvent(eventId: int): boolean;
}
export const EventCommandEventArgs: {
new(): EventCommandEventArgs$instance;
};
export type EventCommandEventArgs = EventCommandEventArgs$instance;
export interface EventCounter$instance extends DiagnosticCounter$instance {
dispose(): void;
toString(): string;
writeMetric(value: float): void;
writeMetric(value: double): void;
}
export const EventCounter: {
new(name: string, eventSource: EventSource): EventCounter$instance;
};
export interface __EventCounter$views {
As_IDisposable(): System_Internal.IDisposable$instance;
}
export type EventCounter = EventCounter$instance & __EventCounter$views;
export interface EventDataAttribute$instance extends Attribute {
name: string;
}
export const EventDataAttribute: {
new(): EventDataAttribute$instance;
};
export type EventDataAttribute = EventDataAttribute$instance;
export interface EventFieldAttribute$instance extends Attribute {
format: EventFieldFormat;
tags: EventFieldTags;
}
export const EventFieldAttribute: {
new(): EventFieldAttribute$instance;
};
export type EventFieldAttribute = EventFieldAttribute$instance;
export interface EventIgnoreAttribute$instance extends Attribute {
}
export const EventIgnoreAttribute: {
new(): EventIgnoreAttribute$instance;
};
export type EventIgnoreAttribute = EventIgnoreAttribute$instance;
export interface EventListener$instance {
disableEvents(eventSource: EventSource): void;
dispose(): void;
enableEvents(eventSource: EventSource, level: EventLevel): void;
enableEvents(eventSource: EventSource, level: EventLevel, matchAnyKeyword: EventKeywords): void;
enableEvents(eventSource: EventSource, level: EventLevel, matchAnyKeyword: EventKeywords, arguments: IDictionary_2<CLROf<string>, CLROf<string>>): void;
}
export const EventListener: {
};
export interface __EventListener$views {
As_IDisposable(): System_Internal.IDisposable$instance;
}
export interface EventListener$instance extends System_Internal.IDisposable$instance {}
export type EventListener = EventListener$instance & __EventListener$views;
export interface EventSource$instance {
readonly constructionException: Exception;
readonly guid: Guid;
readonly name: string;
readonly settings: EventSourceSettings;
dispose(): void;
getTrait(key: string): string;
isEnabled(): boolean;
isEnabled(level: EventLevel, keywords: EventKeywords): boolean;
isEnabled(level: EventLevel, keywords: EventKeywords, channel: EventChannel): boolean;
toString(): string;
write(eventName: string): void;
write(eventName: string, options: EventSourceOptions): void;
write<T>(eventName: string, data: T): void;
write<T>(eventName: string, options: EventSourceOptions, data: T): void;
write<T>(eventName: string, options: { value: ref<EventSourceOptions> }, data: { value: ref<T> }): void;
write<T>(eventName: string, options: { value: ref<EventSourceOptions> }, activityId: { value: ref<Guid> }, relatedActivityId: { value: ref<Guid> }, data: { value: ref<T> }): void;
}
export const EventSource: {
new(eventSourceName: string): EventSource$instance;
new(eventSourceName: string, config: EventSourceSettings): EventSource$instance;
new(eventSourceName: string, config: EventSourceSettings, traits: string[]): EventSource$instance;
readonly currentThreadActivityId: Guid;
generateManifest(eventSourceType: Type, assemblyPathToIncludeInManifest: string, flags: EventManifestOptions): string;
generateManifest(eventSourceType: Type, assemblyPathToIncludeInManifest: string): string;
getGuid(eventSourceType: Type): Guid;
getName(eventSourceType: Type): string;
getSources(): IEnumerable_1<EventSource>;
sendCommand(eventSource: EventSource, command: EventCommand, commandArguments: IDictionary_2<CLROf<string>, CLROf<string>>): void;
setCurrentThreadActivityId(activityId: Guid, oldActivityThatWillContinue: { value: ref<Guid> }): void;
setCurrentThreadActivityId(activityId: Guid): void;
};
export interface __EventSource$views {
As_IDisposable(): System_Internal.IDisposable$instance;
}
export interface EventSource$instance extends System_Internal.IDisposable$instance {}
export type EventSource = EventSource$instance & __EventSource$views;
export interface EventSourceAttribute$instance extends Attribute {
guid: string;
localizationResources: string;
name: string;
}
export const EventSourceAttribute: {
new(): EventSourceAttribute$instance;
};
export type EventSourceAttribute = EventSourceAttribute$instance;
export interface EventSourceCreatedEventArgs$instance extends EventArgs {
readonly eventSource: EventSource;
}
export const EventSourceCreatedEventArgs: {
new(): EventSourceCreatedEventArgs$instance;
};
export type EventSourceCreatedEventArgs = EventSourceCreatedEventArgs$instance;
export interface EventSourceException$instance extends Exception {
getObjectData(info: SerializationInfo, context: StreamingContext): void;
}
export const EventSourceException: {
new(): EventSourceException$instance;
new(message: string): EventSourceException$instance;
new(message: string, innerException: Exception): EventSourceException$instance;
};
export interface __EventSourceException$views {
As_ISerializable(): System_Runtime_Serialization_Internal.ISerializable$instance;
}
export type EventSourceException = EventSourceException$instance & __EventSourceException$views;
export interface EventWrittenEventArgs$instance extends EventArgs {
readonly activityId: Guid;
readonly channel: EventChannel;
readonly eventId: int;
readonly eventName: string;
readonly eventSource: EventSource;
readonly keywords: EventKeywords;
readonly level: EventLevel;
readonly message: string;
readonly opcode: EventOpcode;
readonly osThreadId: long;
readonly payload: ReadOnlyCollection_1<unknown>;
readonly payloadNames: ReadOnlyCollection_1<CLROf<string>>;
readonly relatedActivityId: Guid;
readonly tags: EventTags;
readonly task: EventTask;
readonly timeStamp: DateTime;
readonly version: byte;
}
export const EventWrittenEventArgs: {
new(): EventWrittenEventArgs$instance;
};
export type EventWrittenEventArgs = EventWrittenEventArgs$instance;
export interface IncrementingEventCounter$instance extends DiagnosticCounter$instance {
displayRateTimeScale: TimeSpan;
dispose(): void;
increment(increment?: double): void;
toString(): string;
}
export const IncrementingEventCounter: {
new(name: string, eventSource: EventSource): IncrementingEventCounter$instance;
};
export interface __IncrementingEventCounter$views {
As_IDisposable(): System_Internal.IDisposable$instance;
}
export type IncrementingEventCounter = IncrementingEventCounter$instance & __IncrementingEventCounter$views;
export interface IncrementingPollingCounter$instance extends DiagnosticCounter$instance {
displayRateTimeScale: TimeSpan;
dispose(): void;
toString(): string;
}
export const IncrementingPollingCounter: {
new(name: string, eventSource: EventSource, totalValueProvider: Func_1<CLROf<double>>): IncrementingPollingCounter$instance;
};
export interface __IncrementingPollingCounter$views {
As_IDisposable(): System_Internal.IDisposable$instance;
}
export type IncrementingPollingCounter = IncrementingPollingCounter$instance & __IncrementingPollingCounter$views;
export interface NonEventAttribute$instance extends Attribute {
}
export const NonEventAttribute: {
new(): NonEventAttribute$instance;
};
export type NonEventAttribute = NonEventAttribute$instance;
export interface PollingCounter$instance extends DiagnosticCounter$instance {
dispose(): void;
toString(): string;
}
export const PollingCounter: {
new(name: string, eventSource: EventSource, metricProvider: Func_1<CLROf<double>>): PollingCounter$instance;
};
export interface __PollingCounter$views {
As_IDisposable(): System_Internal.IDisposable$instance;
}
export type PollingCounter = PollingCounter$instance & __PollingCounter$views;