mirror of
https://github.com/0PandaDEV/Qopy.git
synced 2025-04-22 05:34:04 +02:00
feat(types): improve type safety for history and plugin modules
This commit is contained in:
parent
43c1428dbb
commit
6ea877a1be
2 changed files with 10 additions and 2 deletions
|
@ -1,5 +1,5 @@
|
||||||
import { invoke } from "@tauri-apps/api/core";
|
import { invoke } from "@tauri-apps/api/core";
|
||||||
import type { HistoryItem } from "~/types/types";
|
import type { ContentType, HistoryItem } from "~/types/types";
|
||||||
|
|
||||||
export default defineNuxtPlugin(() => {
|
export default defineNuxtPlugin(() => {
|
||||||
return {
|
return {
|
||||||
|
@ -37,7 +37,7 @@ export default defineNuxtPlugin(() => {
|
||||||
|
|
||||||
async writeAndPaste(data: {
|
async writeAndPaste(data: {
|
||||||
content: string;
|
content: string;
|
||||||
contentType: string;
|
contentType: ContentType;
|
||||||
}): Promise<void> {
|
}): Promise<void> {
|
||||||
await invoke<void>("write_and_paste", data);
|
await invoke<void>("write_and_paste", data);
|
||||||
},
|
},
|
||||||
|
|
8
types/plugins.d.ts
vendored
Normal file
8
types/plugins.d.ts
vendored
Normal file
|
@ -0,0 +1,8 @@
|
||||||
|
import { HistoryItem, ContentType } from './types';
|
||||||
|
|
||||||
|
declare module '#app' {
|
||||||
|
interface NuxtApp {
|
||||||
|
$history: ReturnType<typeof import('../plugins/history')>['provide']['history'];
|
||||||
|
$settings: ReturnType<typeof import('../plugins/settings')>['provide']['settings'];
|
||||||
|
}
|
||||||
|
}
|
Loading…
Add table
Add a link
Reference in a new issue