Add more properties
This commit is contained in:
parent
13849a6739
commit
c5c1b375ec
|
|
@ -47,12 +47,14 @@ export class EventForDotNet<TData extends UIEventArgs> {
|
||||||
case 'dblclick':
|
case 'dblclick':
|
||||||
return new EventForDotNet<UIMouseEventArgs>('mouse', parseMouseEvent(<MouseEvent>event));
|
return new EventForDotNet<UIMouseEventArgs>('mouse', parseMouseEvent(<MouseEvent>event));
|
||||||
|
|
||||||
|
case 'error':
|
||||||
|
return new EventForDotNet<UIErrorEventArgs>('error', parseErrorEvent(<ErrorEvent>event));
|
||||||
|
|
||||||
case 'loadstart':
|
case 'loadstart':
|
||||||
case 'timeout':
|
case 'timeout':
|
||||||
case 'abort':
|
case 'abort':
|
||||||
case 'load':
|
case 'load':
|
||||||
case 'loadend':
|
case 'loadend':
|
||||||
case 'error':
|
|
||||||
case 'progress':
|
case 'progress':
|
||||||
return new EventForDotNet<UIProgressEventArgs>('progress', parseProgressEvent(<ProgressEvent>event));
|
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) {
|
function parseProgressEvent(event: ProgressEvent) {
|
||||||
return {
|
return {
|
||||||
type: event.type,
|
type: event.type,
|
||||||
|
|
@ -249,6 +261,13 @@ interface UIDataTransferItem {
|
||||||
}
|
}
|
||||||
|
|
||||||
interface UIErrorEventArgs extends UIEventArgs {
|
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 {
|
interface UIFocusEventArgs extends UIEventArgs {
|
||||||
|
|
|
||||||
|
|
@ -170,6 +170,25 @@ namespace Microsoft.AspNetCore.Blazor
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public class UIErrorEventArgs : UIEventArgs
|
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>
|
/// <summary>
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue