TypeScript: obter a árvore de sintaxe

Eu tinha lido "internet inteira", mas não consigo encontrar nenhum exemplo sobre como obter a árvore de sintaxe (assim como no Esprima) da fonte TypeScrypt. Quero dizer, como posso obter objeto como este (Esprima Parser exemplo)

{
    "type": "Program",
    "body": [
        {
            "type": "VariableDeclaration",
            "declarations": [
                {
                    "type": "VariableDeclarator",
                    "id": {
                        "type": "Identifier",
                        "name": "answer"
                    },
                    "init": {
                        "type": "BinaryExpression",
                        "operator": "*",
                        "left": {
                            "type": "Literal",
                            "value": 6,
                            "raw": "6"
                        },
                        "right": {
                            "type": "Literal",
                            "value": 7,
                            "raw": "7"
                        }
                    }
                }
            ],
            "kind": "var"
        }
    ]
}

do código javascript

var answer = 6 * 7;

apenas para o texto de origem do TypeScript?

P.S. Espero muito por sua ajuda, porque eu não quero escrever sua própria bicicleta terrível)

P.P.S. Eu acho que os arquivos lib typescript.ts (.js) e typescriptServices.ts (.js) para me ajudar, mas eu não sei como :(

Resolvido

Muito obrigado ao usuário Steve Fenton. Aqui está o meu código, se alguém estiver interessado em:

// uses
var typeScriptLS =  new Harness.TypeScriptLS();
var ServicesFactory = new Services.TypeScriptServicesFactory();
var serviceShim = ServicesFactory.createLanguageServiceShim(typeScriptLS);

// add lib.d.ts
var _libText = window.document.getElementById('lib.d.ts').innerText;
typeScriptLS.addScript('lib.d.ts', _libText.replace(/\r\n?/g,"\n"), true);

// add greeter.ts
var _sourceText = window.document.getElementById('greeter.ts').innerText;
typeScriptLS.addScript('greeter.ts', _sourceText.replace(/\r\n?/g,"\n"), true);

// script name
var _scriptName = 'greeter.ts';
// get syntax tree
var _st = serviceShim.languageService.getSyntaxTree(_scriptName);
//console.log(_st);
console.log(JSON.stringify(_st, "", 2));

questionAnswers(4)

yourAnswerToTheQuestion