Add more properties
This commit is contained in:
parent
13849a6739
commit
c5c1b375ec
|
|
@ -47,12 +47,14 @@ export class EventForDotNet<TData extends UIEventArgs> {
|
|||
case 'dblclick':
|
||||
return new EventForDotNet<UIMouseEventArgs>('mouse', parseMouseEvent(<MouseEvent>event));
|
||||
|
||||
case 'error':
|
||||
return new EventForDotNet<UIErrorEventArgs>('error', parseErrorEvent(<ErrorEvent>event));
|
||||
|
||||
case 'loadstart':
|
||||
case 'timeout':
|
||||
case 'abort':
|
||||
case 'load':
|
||||
case 'loadend':
|
||||
case 'error':
|
||||
case 'progress':
|
||||
return new EventForDotNet<UIProgressEventArgs>('progress', parseProgressEvent(<ProgressEvent>event));
|
||||
|
||||
|
|
@ -114,6 +116,16 @@ function parseWheelEvent(event: WheelEvent) {
|
|||
};
|
||||
}
|
||||
|
||||
function parseErrorEvent(event: ErrorEvent) {
|
||||
return {
|
||||
type: event.type,
|
||||
message: event.message,
|
||||
filename: event.filename,
|
||||
lineno: event.lineno,
|
||||
colno: event.colno
|
||||
}
|
||||
}
|
||||
|
||||
function parseProgressEvent(event: ProgressEvent) {
|
||||
return {
|
||||
type: event.type,
|
||||
|
|
@ -249,6 +261,13 @@ interface UIDataTransferItem {
|
|||
}
|
||||
|
||||
interface UIErrorEventArgs extends UIEventArgs {
|
||||
message: string;
|
||||
filename: string;
|
||||
lineno: number;
|
||||
colno: number;
|
||||
|
||||
// omitting 'error' here since we'd have to serialize it, and it's not clear we will want to
|
||||
// do that. https://developer.mozilla.org/en-US/docs/Web/API/ErrorEvent
|
||||
}
|
||||
|
||||
interface UIFocusEventArgs extends UIEventArgs {
|
||||
|
|
|
|||
|
|
@ -170,6 +170,25 @@ namespace Microsoft.AspNetCore.Blazor
|
|||
/// </summary>
|
||||
public class UIErrorEventArgs : UIEventArgs
|
||||
{
|
||||
/// <summary>
|
||||
/// Gets a a human-readable error message describing the problem.
|
||||
/// </summary>
|
||||
public string Message { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets the name of the script file in which the error occurred.
|
||||
/// </summary>
|
||||
public string Filename { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets the line number of the script file on which the error occurred.
|
||||
/// </summary>
|
||||
public int Lineno { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets the column number of the script file on which the error occurred.
|
||||
/// </summary>
|
||||
public int Colno { get; set; }
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
|
|
|
|||
Loading…
Reference in New Issue