import { RPCInterface, RPCExporter, RPCDefinitions } from "rpclibrary";
import { PrivilegedRPCExporter } from "./PrivilegedRPCExporter";
import { TableDefinitionExporter } from "./Interfaces";
import { TableDefiniton } from "./Types";

export interface FrontworkComponent<
    Ifc extends RPCInterface = RPCInterface, 
    FeatureIfc extends RPCInterface = RPCInterface, 
    Name extends keyof Ifc = keyof Ifc, 
    FeatureName extends keyof FeatureIfc = keyof FeatureIfc, 
> extends
    PrivilegedRPCExporter<Ifc, FeatureIfc, Name, FeatureName>,
    TableDefinitionExporter
{
    name: Name;

    RPCFeatures(): RPCExporter<FeatureIfc, FeatureName>[] 
    RPCs(): RPCDefinitions<Ifc>[Name]
    getTableDefinitions(): TableDefiniton[] 

    initialize?(): Promise<any>
    stop?() : Promise<any>
}