interface vscode { postMessage ( message ) : void ; } declare const vscode ; export const sendMessage = < TState extends unknown > ( type , state ) => { vscode . postMessage ( { command : type , text : state } ) ; } ;