Problems with Strongly typed props and typescript with string components

My current goal is to try an maximize as much as I can from Typescript and Vue but I’m running into an issue where I’m not able to get rid of any errors.

I am currently forced into a really weird environment configuration that I can’t change, and this is that I am unable to use the vue-cli, webpack, node or almost anything else that would make my life better.

That said all I can do is include vue as such: <script src="https://cdn.jsdelivr.net/npm/vue@2.6.0"></script>

So back to my problem, I’m currently able to create vue components using string templates and templated literals, and if I wanted to x-templates. This is all good if I want to use just javascript, but I’ve been instructed to use Typescript, so use it I will, but this is where things go a bit sideways.

For example I have the following component:

const testComponentTemplate = `<div><h1>here be dragons</h1>
   <p>counter: {{count}}</p>
   <button @click="increment">increment</button> - <button @click="decrement">derement</button>
   </div>`

const testComponent = Vue.component("test-component", {
    template: testComponentTemplate,
    data() {
        return {
            count: 0
        }
    },
    methods: {
        increment(): void {
            const model = this;
            model.count = model.count + 1;
        },
        decrement(): void {
            const model = this;
            model.count = model.count - 1;
        }
    }
});

Granted there’s not a lot of typescript specific things going on here the problem I’m having is with the data function / object. No matter what I do, data is never typed and always returns any . In the case above I want count to be number but for the life of me I cant seem to find anything that will let me do that. Initially my first assumption was to type it myself:

data(): { count: number} { 
   count: 0
}

however inside of the methods model is still any type and the typescript compiler starts to give me some nice errors if I have noImplicitAny or noImplicitThis turned on in my tsconfig.json

One thing I have noticed was when I turn on noImplicitThis inside of the methods , computed or watch I can see that the functions in their respective blocks are typed, but nothing from data shows up.