22 lines
570 B
TypeScript
22 lines
570 B
TypeScript
|
import { INetRequest } from "./Core/INetRequest";
|
||
|
import { NetManager } from "./NetManager";
|
||
|
|
||
|
export abstract class NetRequest<TResquest, TResponse> implements INetRequest<TResquest, TResponse> {
|
||
|
abstract get Method(): string;
|
||
|
|
||
|
get MethodBack(): string {
|
||
|
return this.Method;
|
||
|
}
|
||
|
|
||
|
Data: TResquest;
|
||
|
Result: import("./Core/INetResponse").INetResponse<TResponse>;
|
||
|
|
||
|
SendAsync(mask: boolean = false): Iterator<any> {
|
||
|
return NetManager.SendAsync(this, mask);
|
||
|
}
|
||
|
|
||
|
Send() {
|
||
|
NetManager.Send(this);
|
||
|
}
|
||
|
}
|