title: State type with Pinia is destructed in actions or outside
body: <p>Having this store here :</p>
  <pre><code>interface Task {
    id?: string;
    name: string;
    done: boolean;
  }
  
  interface TodoState {
    tasks: Task[];
    loading: boolean;
  }
  
  export const useTodoStore = defineStore({
    id: 'todo',
    state: (): TodoState =&gt; ({
      tasks: [],
      loading: false,
    }),
    getters: {},
    actions: {
      async addTask(name: string): Promise&lt;void&gt; {
        this.loading = true;
        this.tasks.push({ name, done: false, id: generateID() });
        await sleep(200);
        this.loading = false;
      },
    },
  });
  </code></pre>
  <p>I don't understand why when I hover &quot;tasks&quot; in the action its type is not Task[] but I get</p>
  <pre><code>(property) tasks: {
      id?: string | undefined;
      name: string;
      done: boolean;
  }[]
  </code></pre>
  <p><a href="https://stackblitz.com/edit/boilerplate-vue3-typescript-pinia-r96nwp?file=src%2Fstore%2Ftodo.ts" rel="nofollow noreferrer">here is the code in a stackblitz if needed</a></p>
  <p>The same issue is observed when I get tasks outside of the store. In a component for example.</p>