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>;

    async SendAsync(mask: boolean = false): Promise<Iterator<any>> {
        return await NetManager.SendAsync(this, mask);
    }

    Send() {
        NetManager.Send(this);
    }
}
