Table of Contents

Class DeprecationReportBody

Namespace
CSharpToJavaScript.APIs.JS
Assembly
CSharpToJavaScript.dll
NOTE
Experimental
The DeprecationReportBody interface of the Reporting API represents the body of a deprecation report.
[Value("DeprecationReportBody")]
public class DeprecationReportBody : ReportBody
Inheritance
DeprecationReportBody
Inherited Members

Remarks

A deprecation report is generated when a deprecated feature (for example a deprecated API method) is used on a document being observed by a ReportingObserver. In addition to the support of this API, receiving useful deprecation warnings relies on browser vendors adding these warnings for deprecated features.

-Reporting API
-The Reporting API

See also on MDN

Constructors

DeprecationReportBody()

public DeprecationReportBody()

Properties

AnticipatedRemoval

NOTE
Experimental
The anticipatedRemoval read-only property of the DeprecationReportBody interface returns the date that the browser version which removes the feature will ship. This value can be used to prioritize warnings. If this property returns null because the date is unknown, then the deprecation should be considered low priority.
[Value("anticipatedRemoval")]
public Object? AnticipatedRemoval { get; }

Property Value

Object

A Date object, or null if the date is not known.

Remarks

ColumnNumber

NOTE
Experimental
The columnNumber read-only property of the DeprecationReportBody interface returns the line in the source file in which the deprecated feature was used.
[Value("columnNumber")]
public ulong? ColumnNumber { get; }

Property Value

ulong?

An integer, or null if the column is not known.

Remarks

NOTE

This property is most useful alongside SourceFile and LineNumber as it enables the location of the column in that file and line where the error occurred.

See also on MDN

Id

NOTE
Experimental
The id read-only property of the DeprecationReportBody interface returns a string representing the feature or API that is deprecated. This can be used to group or count related reports.
[Value("id")]
public string Id { get; }

Property Value

string

A string.

Remarks

LineNumber

NOTE
Experimental
The lineNumber read-only property of the DeprecationReportBody interface returns the line in the source file in which the deprecated feature was used.
[Value("lineNumber")]
public ulong? LineNumber { get; }

Property Value

ulong?

An integer, or null if the line is not known.

Remarks

NOTE

This property is most useful alongside SourceFile as it enables the location of the line in that file where the error occurred.

See also on MDN

Message

NOTE
Experimental
The message read-only property of the DeprecationReportBody interface returns a human-readable description of the deprecation. This typically matches the message a browser will display in its DevTools console regarding a deprecated feature.
[Value("message")]
public string Message { get; }

Property Value

string

A string.

Remarks

SourceFile

NOTE
Experimental
The sourceFile read-only property of the DeprecationReportBody interface returns the path to the source file where the deprecated feature was used.
[Value("sourceFile")]
public string? SourceFile { get; }

Property Value

string

A string, or null if the path is not known.

Remarks

NOTE

This property can be used with LineNumber and ColumnNumber to locate the column and line in the file where the error occurred.

See also on MDN

Methods

ToJSON()

NOTE
Experimental
The toJSON() method of the DeprecationReportBody interface is a serializer, and returns a JSON representation of the InterventionReportBody object.
[Value("toJSON")]
public Object ToJSON()

Returns

Object

A JSON object that is the serialization of the DeprecationReportBody object.

Remarks