@vueuse/electron 12.7.0 → 12.8.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/index.d.cts CHANGED
@@ -1,6 +1,5 @@
1
1
  import { IpcRendererEvent, IpcRenderer, WebFrame } from 'electron';
2
- import { Ref } from 'vue';
3
- import { MaybeRef } from '@vueuse/shared';
2
+ import { ShallowRef, MaybeRef, Ref } from 'vue';
4
3
 
5
4
  type IpcRendererListener = (event: IpcRendererEvent, ...args: any[]) => void;
6
5
 
@@ -48,14 +47,14 @@ interface UseIpcRendererReturn {
48
47
  *
49
48
  * @see https://www.electronjs.org/docs/api/ipc-renderer#ipcrendererinvokechannel-args
50
49
  */
51
- invoke: <T>(channel: string, ...args: any[]) => Ref<T | null>;
50
+ invoke: <T>(channel: string, ...args: any[]) => ShallowRef<T | null>;
52
51
  /**
53
52
  * Returns any - The value sent back by the ipcMain handler.
54
53
  * Send a message to the main process via channel and expect a result synchronously.
55
54
  *
56
55
  * @see https://www.electronjs.org/docs/api/ipc-renderer#ipcrenderersendsyncchannel-args
57
56
  */
58
- sendSync: <T>(channel: string, ...args: any[]) => Ref<T | null>;
57
+ sendSync: <T>(channel: string, ...args: any[]) => ShallowRef<T | null>;
59
58
  /**
60
59
  * Send a message to the main process, optionally transferring ownership of zero or more MessagePort objects.
61
60
  *
@@ -93,7 +92,7 @@ declare function useIpcRenderer(ipcRenderer?: IpcRenderer): UseIpcRendererReturn
93
92
  * @see https://www.electronjs.org/docs/api/ipc-renderer#ipcrendererinvokechannel-args
94
93
  * @see https://vueuse.org/useIpcRendererInvoke
95
94
  */
96
- declare function useIpcRendererInvoke<T>(ipcRenderer: IpcRenderer, channel: string, ...args: any[]): Ref<T | null>;
95
+ declare function useIpcRendererInvoke<T>(ipcRenderer: IpcRenderer, channel: string, ...args: any[]): ShallowRef<T | null>;
97
96
  /**
98
97
  * Returns Promise<any> - Resolves with the response from the main process.
99
98
  *
@@ -104,7 +103,7 @@ declare function useIpcRendererInvoke<T>(ipcRenderer: IpcRenderer, channel: stri
104
103
  * @see https://www.electronjs.org/docs/api/ipc-renderer#ipcrendererinvokechannel-args
105
104
  * @see https://vueuse.org/useIpcRendererInvoke
106
105
  */
107
- declare function useIpcRendererInvoke<T>(channel: string, ...args: any[]): Ref<T | null>;
106
+ declare function useIpcRendererInvoke<T>(channel: string, ...args: any[]): ShallowRef<T | null>;
108
107
 
109
108
  /**
110
109
  * Listens to channel, when a new message arrives listener would be called with listener(event, args...).
package/index.d.mts CHANGED
@@ -1,6 +1,5 @@
1
1
  import { IpcRendererEvent, IpcRenderer, WebFrame } from 'electron';
2
- import { Ref } from 'vue';
3
- import { MaybeRef } from '@vueuse/shared';
2
+ import { ShallowRef, MaybeRef, Ref } from 'vue';
4
3
 
5
4
  type IpcRendererListener = (event: IpcRendererEvent, ...args: any[]) => void;
6
5
 
@@ -48,14 +47,14 @@ interface UseIpcRendererReturn {
48
47
  *
49
48
  * @see https://www.electronjs.org/docs/api/ipc-renderer#ipcrendererinvokechannel-args
50
49
  */
51
- invoke: <T>(channel: string, ...args: any[]) => Ref<T | null>;
50
+ invoke: <T>(channel: string, ...args: any[]) => ShallowRef<T | null>;
52
51
  /**
53
52
  * Returns any - The value sent back by the ipcMain handler.
54
53
  * Send a message to the main process via channel and expect a result synchronously.
55
54
  *
56
55
  * @see https://www.electronjs.org/docs/api/ipc-renderer#ipcrenderersendsyncchannel-args
57
56
  */
58
- sendSync: <T>(channel: string, ...args: any[]) => Ref<T | null>;
57
+ sendSync: <T>(channel: string, ...args: any[]) => ShallowRef<T | null>;
59
58
  /**
60
59
  * Send a message to the main process, optionally transferring ownership of zero or more MessagePort objects.
61
60
  *
@@ -93,7 +92,7 @@ declare function useIpcRenderer(ipcRenderer?: IpcRenderer): UseIpcRendererReturn
93
92
  * @see https://www.electronjs.org/docs/api/ipc-renderer#ipcrendererinvokechannel-args
94
93
  * @see https://vueuse.org/useIpcRendererInvoke
95
94
  */
96
- declare function useIpcRendererInvoke<T>(ipcRenderer: IpcRenderer, channel: string, ...args: any[]): Ref<T | null>;
95
+ declare function useIpcRendererInvoke<T>(ipcRenderer: IpcRenderer, channel: string, ...args: any[]): ShallowRef<T | null>;
97
96
  /**
98
97
  * Returns Promise<any> - Resolves with the response from the main process.
99
98
  *
@@ -104,7 +103,7 @@ declare function useIpcRendererInvoke<T>(ipcRenderer: IpcRenderer, channel: stri
104
103
  * @see https://www.electronjs.org/docs/api/ipc-renderer#ipcrendererinvokechannel-args
105
104
  * @see https://vueuse.org/useIpcRendererInvoke
106
105
  */
107
- declare function useIpcRendererInvoke<T>(channel: string, ...args: any[]): Ref<T | null>;
106
+ declare function useIpcRendererInvoke<T>(channel: string, ...args: any[]): ShallowRef<T | null>;
108
107
 
109
108
  /**
110
109
  * Listens to channel, when a new message arrives listener would be called with listener(event, args...).
package/index.d.ts CHANGED
@@ -1,6 +1,5 @@
1
1
  import { IpcRendererEvent, IpcRenderer, WebFrame } from 'electron';
2
- import { Ref } from 'vue';
3
- import { MaybeRef } from '@vueuse/shared';
2
+ import { ShallowRef, MaybeRef, Ref } from 'vue';
4
3
 
5
4
  type IpcRendererListener = (event: IpcRendererEvent, ...args: any[]) => void;
6
5
 
@@ -48,14 +47,14 @@ interface UseIpcRendererReturn {
48
47
  *
49
48
  * @see https://www.electronjs.org/docs/api/ipc-renderer#ipcrendererinvokechannel-args
50
49
  */
51
- invoke: <T>(channel: string, ...args: any[]) => Ref<T | null>;
50
+ invoke: <T>(channel: string, ...args: any[]) => ShallowRef<T | null>;
52
51
  /**
53
52
  * Returns any - The value sent back by the ipcMain handler.
54
53
  * Send a message to the main process via channel and expect a result synchronously.
55
54
  *
56
55
  * @see https://www.electronjs.org/docs/api/ipc-renderer#ipcrenderersendsyncchannel-args
57
56
  */
58
- sendSync: <T>(channel: string, ...args: any[]) => Ref<T | null>;
57
+ sendSync: <T>(channel: string, ...args: any[]) => ShallowRef<T | null>;
59
58
  /**
60
59
  * Send a message to the main process, optionally transferring ownership of zero or more MessagePort objects.
61
60
  *
@@ -93,7 +92,7 @@ declare function useIpcRenderer(ipcRenderer?: IpcRenderer): UseIpcRendererReturn
93
92
  * @see https://www.electronjs.org/docs/api/ipc-renderer#ipcrendererinvokechannel-args
94
93
  * @see https://vueuse.org/useIpcRendererInvoke
95
94
  */
96
- declare function useIpcRendererInvoke<T>(ipcRenderer: IpcRenderer, channel: string, ...args: any[]): Ref<T | null>;
95
+ declare function useIpcRendererInvoke<T>(ipcRenderer: IpcRenderer, channel: string, ...args: any[]): ShallowRef<T | null>;
97
96
  /**
98
97
  * Returns Promise<any> - Resolves with the response from the main process.
99
98
  *
@@ -104,7 +103,7 @@ declare function useIpcRendererInvoke<T>(ipcRenderer: IpcRenderer, channel: stri
104
103
  * @see https://www.electronjs.org/docs/api/ipc-renderer#ipcrendererinvokechannel-args
105
104
  * @see https://vueuse.org/useIpcRendererInvoke
106
105
  */
107
- declare function useIpcRendererInvoke<T>(channel: string, ...args: any[]): Ref<T | null>;
106
+ declare function useIpcRendererInvoke<T>(channel: string, ...args: any[]): ShallowRef<T | null>;
108
107
 
109
108
  /**
110
109
  * Listens to channel, when a new message arrives listener would be called with listener(event, args...).
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@vueuse/electron",
3
3
  "type": "module",
4
- "version": "12.7.0",
4
+ "version": "12.8.0",
5
5
  "description": "Electron renderer process modules for VueUse",
6
6
  "author": "Archer Gu<https://github.com/ArcherGu>",
7
7
  "license": "MIT",
@@ -46,7 +46,7 @@
46
46
  },
47
47
  "dependencies": {
48
48
  "vue": "^3.5.13",
49
- "@vueuse/shared": "12.7.0"
49
+ "@vueuse/shared": "12.8.0"
50
50
  },
51
51
  "devDependencies": {
52
52
  "electron": "^13.1.0"