declare module "windows.foundation.diagnostics" {
  export enum CausalityTraceLevel {
    required,
    important,
    verbose,
  }

  export enum CausalitySource {
    application,
    library,
    system,
  }

  export enum CausalityRelation {
    assignDelegate,
    join,
    choice,
    cancel,
    error,
  }

  export enum CausalitySynchronousWork {
    completionNotification,
    progressNotification,
    execution,
  }

  export enum ErrorOptions {
    none,
    suppressExceptions,
    forceExceptions,
    useSetErrorInfo,
    suppressSetErrorInfo,
  }

  export enum LoggingLevel {
    verbose,
    information,
    warning,
    error,
    critical,
  }

  export class TracingStatusChangedEventArgs {
    enabled: Boolean;
    traceLevel: CausalityTraceLevel;
    constructor();

  }

  export class AsyncCausalityTracer {
    constructor();

    static traceOperationCreation(traceLevel: CausalityTraceLevel, source: CausalitySource, platformId: String, operationId: Number, operationName: String, relatedContext: Number): void;


    static traceOperationCompletion(traceLevel: CausalityTraceLevel, source: CausalitySource, platformId: String, operationId: Number, status: Number): void;


    static traceOperationRelation(traceLevel: CausalityTraceLevel, source: CausalitySource, platformId: String, operationId: Number, relation: CausalityRelation): void;


    static traceSynchronousWorkStart(traceLevel: CausalityTraceLevel, source: CausalitySource, platformId: String, operationId: Number, work: CausalitySynchronousWork): void;


    static traceSynchronousWorkCompletion(traceLevel: CausalityTraceLevel, source: CausalitySource, work: CausalitySynchronousWork): void;


    addListener(type: "TracingStatusChanged", listener: (ev: Event) => void): void ;
    removeListener(type: "TracingStatusChanged", listener: (ev: Event) => void): void ;
    on(type: "TracingStatusChanged", listener: (ev: Event) => void): void ;
    off(type: "TracingStatusChanged", listener: (ev: Event) => void): void ;
    
    addListener(type: string, listener: (ev: Event) => void): void ;
    removeListener(type: string, listener: (ev: Event) => void): void ;
    on(type: string, listener: (ev: Event) => void): void ;
    off(type: string, listener: (ev: Event) => void): void ;
    

  }

  export class IErrorReportingSettings {
    constructor();

    setErrorOptions(value: ErrorOptions): void;

    getErrorOptions(): ErrorOptions;

  }

  export class RuntimeBrokerErrorSettings {
    constructor();

    setErrorOptions(value: ErrorOptions): void;

    getErrorOptions(): ErrorOptions;

  }

  export class ILoggingChannel {
    enabled: Boolean;
    level: LoggingLevel;
    name: String;
    constructor();

    logMessage(eventString: String): void;
    logMessage(eventString: String, level: LoggingLevel): void;

    logValuePair(value1: String, value2: Number): void;
    logValuePair(value1: String, value2: Number, level: LoggingLevel): void;

    addListener(type: "LoggingEnabled", listener: (ev: Event) => void): void ;
    removeListener(type: "LoggingEnabled", listener: (ev: Event) => void): void ;
    on(type: "LoggingEnabled", listener: (ev: Event) => void): void ;
    off(type: "LoggingEnabled", listener: (ev: Event) => void): void ;
    
    addListener(type: string, listener: (ev: Event) => void): void ;
    removeListener(type: string, listener: (ev: Event) => void): void ;
    on(type: string, listener: (ev: Event) => void): void ;
    off(type: string, listener: (ev: Event) => void): void ;
    

  }

  export class LoggingChannel {
    enabled: Boolean;
    level: LoggingLevel;
    name: String;
    constructor();
    constructor(name: String);

    logMessage(eventString: String): void;
    logMessage(eventString: String, level: LoggingLevel): void;

    logValuePair(value1: String, value2: Number): void;
    logValuePair(value1: String, value2: Number, level: LoggingLevel): void;

    close(): void;
    addListener(type: "LoggingEnabled", listener: (ev: Event) => void): void ;
    removeListener(type: "LoggingEnabled", listener: (ev: Event) => void): void ;
    on(type: "LoggingEnabled", listener: (ev: Event) => void): void ;
    off(type: "LoggingEnabled", listener: (ev: Event) => void): void ;
    
    addListener(type: string, listener: (ev: Event) => void): void ;
    removeListener(type: string, listener: (ev: Event) => void): void ;
    on(type: string, listener: (ev: Event) => void): void ;
    off(type: string, listener: (ev: Event) => void): void ;
    

  }

  export class LoggingActivity {
    id: String;
    name: String;
    constructor();
    constructor(activityName: String, loggingChannel: ILoggingChannel);
    constructor(activityName: String, loggingChannel: ILoggingChannel, level: LoggingLevel);

    close(): void;
  }

  export class ILoggingSession {
    name: String;
    constructor();

    saveToFileAsync(folder: Object, fileName: String, callback: (error: Error, result: Object) => void): void ;

    addLoggingChannel(loggingChannel: ILoggingChannel): void;
    addLoggingChannel(loggingChannel: ILoggingChannel, maxLevel: LoggingLevel): void;

    removeLoggingChannel(loggingChannel: ILoggingChannel): void;

  }

  export class LoggingSession {
    name: String;
    constructor();
    constructor(name: String);

    saveToFileAsync(folder: Object, fileName: String, callback: (error: Error, result: Object) => void): void ;

    addLoggingChannel(loggingChannel: ILoggingChannel): void;
    addLoggingChannel(loggingChannel: ILoggingChannel, maxLevel: LoggingLevel): void;

    removeLoggingChannel(loggingChannel: ILoggingChannel): void;

    close(): void;
  }

  export class LogFileGeneratedEventArgs {
    file: Object;
    constructor();

  }

  export class IFileLoggingSession {
    name: String;
    constructor();

    closeAndSaveToFileAsync(callback: (error: Error, result: Object) => void): void ;

    addLoggingChannel(loggingChannel: ILoggingChannel): void;
    addLoggingChannel(loggingChannel: ILoggingChannel, maxLevel: LoggingLevel): void;

    removeLoggingChannel(loggingChannel: ILoggingChannel): void;

    addListener(type: "LogFileGenerated", listener: (ev: Event) => void): void ;
    removeListener(type: "LogFileGenerated", listener: (ev: Event) => void): void ;
    on(type: "LogFileGenerated", listener: (ev: Event) => void): void ;
    off(type: "LogFileGenerated", listener: (ev: Event) => void): void ;
    
    addListener(type: string, listener: (ev: Event) => void): void ;
    removeListener(type: string, listener: (ev: Event) => void): void ;
    on(type: string, listener: (ev: Event) => void): void ;
    off(type: string, listener: (ev: Event) => void): void ;
    

  }

  export class FileLoggingSession {
    name: String;
    constructor();
    constructor(name: String);

    closeAndSaveToFileAsync(callback: (error: Error, result: Object) => void): void ;

    addLoggingChannel(loggingChannel: ILoggingChannel): void;
    addLoggingChannel(loggingChannel: ILoggingChannel, maxLevel: LoggingLevel): void;

    removeLoggingChannel(loggingChannel: ILoggingChannel): void;

    close(): void;
    addListener(type: "LogFileGenerated", listener: (ev: Event) => void): void ;
    removeListener(type: "LogFileGenerated", listener: (ev: Event) => void): void ;
    on(type: "LogFileGenerated", listener: (ev: Event) => void): void ;
    off(type: "LogFileGenerated", listener: (ev: Event) => void): void ;
    
    addListener(type: string, listener: (ev: Event) => void): void ;
    removeListener(type: string, listener: (ev: Event) => void): void ;
    on(type: string, listener: (ev: Event) => void): void ;
    off(type: string, listener: (ev: Event) => void): void ;
    

  }

}



