'Typing svelte $store variable

I wanted to know if it is possible de type the dollar sign value of a custom svelte store ?

From this example :

app.svelte

<script>
    import { count } from './stores.js';
</script>

<h1>The count is {$count}</h1>

<button on:click={count.increment}>+</button>
<button on:click={count.decrement}>-</button>
<button on:click={count.reset}>reset</button>

stores.js

import { writable } from 'svelte/store';

function createCount() {
    const { subscribe, set, update } = writable(0);

    return {
        subscribe,
        increment: () => {},
        decrement: () => {},
        reset: () => {}
    };
}

export const count = createCount();

How do you type the variable {$count} with your own typescript interface ?

Thank you for your help



Solution 1:[1]

From what I found, it uses git's tagging system to determine what version the code is linked to. Looking at flutter_tools/lib/src/version.dart, the fetchTagsAndUpdate function gets called, which fetches the current git tags and some other information. It then parses the output string into pieces, and determines the version based on that.

The command I used to replicate it was, git describe --tags. My tag was un-parsable apparently, and was throwing an unknown error. That also explains why as I switched branches and tags, it would change the version output of flutter doctor

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 Zach the Dev