import { RPCInterface, RPCExporter, RPCInterfaceArray } 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, 
    SubresT = {}
> extends
    PrivilegedRPCExporter<Ifc, FeatureIfc, Name, FeatureName, SubresT>,
    TableDefinitionExporter
{
    name: Name;

    exportRPCFeatures(): RPCExporter<FeatureIfc, FeatureName, SubresT>[] 
    exportRPCs(): RPCInterfaceArray<Ifc>[Name]
    getTableDefinitions(): TableDefiniton[] 

    initialize?(): Promise<any>
}