src/vs/workbench/api/common/extHostNotebookRenderers.ts/ExtHostNotebookRenderers/createRendererMessaging
class ExtHostNotebookRenderers:	public createRendererMessaging<TSend, TRecv>(rendererId: string): vscode.NotebookRendererMessaging<TSend, TRecv> {
		const messaging: vscode.NotebookRendererMessaging<TSend, TRecv> = {
			onDidReceiveMessage: (...args) =>
				this.getOrCreateEmitterFor(rendererId).event(...args),
			postMessage: (editor, message) => {
				const extHostEditor = ExtHostNotebookEditor.apiEditorsToExtHost.get(editor);
				if (!extHostEditor) {
					throw new Error(`The first argument to postMessage() must be a NotebookEditor`);
				}

				this.proxy.$postMessage(extHostEditor.id, rendererId, message);
			},
		};

		return messaging;
	}