@xmobitea/gn-server
Version:
GearN Server by XmobiTea (Pro)
27 lines (26 loc) • 816 B
TypeScript
import { Constructor } from "./IRequestConverterService";
export interface IGenericService {
verifyGenericService(serviceName: string, serviceData: {
[k: string]: any;
}): Promise<{
status: "Ok" | "ServiceNotFound" | "VerifyError";
serviceId: string;
someDatas?: any;
error?: string;
}>;
}
export interface IGenericServiceHandler {
getServiceName(): string;
handle(serviceData: {
[k: string]: any;
}): Promise<{
status: "Ok" | "ServiceNotFound" | "VerifyError";
serviceId: string;
someDatas?: any;
error?: string;
}>;
}
export declare namespace IGenericService {
function getImplementations(): IGenericServiceHandler[];
function register<T extends Constructor<IGenericServiceHandler>>(ctor: T): T;
}