1- import {
2- setupDevtoolsPlugin ,
3- TimelineEvent ,
4- App as DevtoolsApp ,
5- } from '@vue/devtools-api'
6- import { ComponentPublicInstance , markRaw , toRaw , unref , watch } from 'vue'
1+ import { setupDevtoolsPlugin } from '@vue/devtools-api'
2+ import { App , ComponentPublicInstance , markRaw , toRaw , unref , watch } from 'vue'
73import { Pinia , PiniaPluginContext } from '../rootStore'
84import {
95 _GettersTree ,
@@ -37,6 +33,17 @@ const MUTATIONS_LAYER_ID = 'pinia:mutations'
3733const INSPECTOR_ID = 'pinia'
3834const { assign } = Object
3935
36+ // copied from devtools
37+ interface TimelineEvent < TData = any , TMeta = any > {
38+ time : number
39+ data : TData
40+ logType ?: 'default' | 'warning' | 'error'
41+ meta ?: TMeta
42+ groupId ?: number | string
43+ title ?: string
44+ subtitle ?: string
45+ }
46+
4047/**
4148 * Gets the displayed name of a store in devtools
4249 *
@@ -52,7 +59,7 @@ const getStoreType = (id: string) => '🍍 ' + id
5259 * @param app - Vue application
5360 * @param pinia - pinia instance
5461 */
55- export function registerPiniaDevtools ( app : DevtoolsApp , pinia : Pinia ) {
62+ export function registerPiniaDevtools ( app : App , pinia : Pinia ) {
5663 setupDevtoolsPlugin (
5764 {
5865 id : 'dev.esm.pinia' ,
@@ -140,7 +147,7 @@ export function registerPiniaDevtools(app: DevtoolsApp, pinia: Pinia) {
140147 ] ,
141148 } )
142149
143- api . on . inspectComponent ( ( payload , ctx ) => {
150+ api . on . inspectComponent ( ( payload ) => {
144151 const proxy = ( payload . componentInstance &&
145152 payload . componentInstance . proxy ) as
146153 | ComponentPublicInstance
@@ -241,7 +248,7 @@ export function registerPiniaDevtools(app: DevtoolsApp, pinia: Pinia) {
241248 }
242249 } )
243250
244- api . on . editInspectorState ( ( payload , ctx ) => {
251+ api . on . editInspectorState ( ( payload ) => {
245252 if ( payload . app === app && payload . inspectorId === INSPECTOR_ID ) {
246253 const inspectedStore =
247254 payload . nodeId === PINIA_ROOT_ID
@@ -301,7 +308,7 @@ export function registerPiniaDevtools(app: DevtoolsApp, pinia: Pinia) {
301308 )
302309}
303310
304- function addStoreToDevtools ( app : DevtoolsApp , store : StoreGeneric ) {
311+ function addStoreToDevtools ( app : App , store : StoreGeneric ) {
305312 if ( ! componentStateTypes . includes ( getStoreType ( store . $id ) ) ) {
306313 componentStateTypes . push ( getStoreType ( store . $id ) )
307314 }
0 commit comments