import * as cdecode from 'cdecode/client';

import { Connection } from '@workbench-stack/extension-api';

const handler = (value: any) => (args: any[]) => value.apply(handler, args);

export class ExtHostBridge {
    constructor(
        private api: typeof cdecode,
        private connection: Connection,
        private mainConnection?: Connection,
    ) { this.initialize(); }

    public initialize() {
        // this.connection.onRequest('$hello', (...args) => {
        //     console.log('onRequest $hello: ', ...args);
        // });

        // console.log("MAIN___CONNECTION:>>", this.mainConnection);
        // setTimeout(() => {
        //     this.connection.sendRequest('11/$provideHover', [1, 2, 3])
        //         .then((data) => console.log('data>>>', data))
        //         .catch((err) => console.log('error>>>', err));
        // }, 3000);
    }
}
