Skip to content

Commit 0c9d9d5

Browse files
committed
more types fixed
1 parent 67807b2 commit 0c9d9d5

File tree

9 files changed

+33
-16
lines changed

9 files changed

+33
-16
lines changed

apps/desktop/src/lib/context/appConfig.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,16 +3,16 @@
33
* It's designed to allow all components to access a shared state.
44
* With context, we can avoid prop drilling, and avoid using stores which makes components hard to encapsulate.
55
*/
6-
import type { AppConfig } from "@/types/appConfig"
6+
import type { AppConfigState } from "@kksh/types"
77
import { getContext, setContext } from "svelte"
88
import type { Writable } from "svelte/store"
99

1010
export const APP_CONFIG_CONTEXT_KEY = Symbol("appConfig")
1111

12-
export function getAppConfigContext(): Writable<AppConfig> {
12+
export function getAppConfigContext(): Writable<AppConfigState> {
1313
return getContext(APP_CONFIG_CONTEXT_KEY)
1414
}
1515

16-
export function setAppConfigContext(appConfig: Writable<AppConfig>) {
16+
export function setAppConfigContext(appConfig: Writable<AppConfigState>) {
1717
setContext(APP_CONFIG_CONTEXT_KEY, appConfig)
1818
}

apps/desktop/src/lib/context/appState.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import type { AppState } from "@/types/appState"
1+
import type { AppState } from "@kksh/types"
22
import { getContext, setContext } from "svelte"
33
import type { Writable } from "svelte/store"
44

apps/desktop/src/lib/stores/apps.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ import Fuse from "fuse.js"
77
import { derived, get, writable } from "svelte/store"
88
import { appState } from "./appState"
99

10-
export const fuse = new Fuse<AppInfo>([], {
10+
const fuse = new Fuse<AppInfo>([], {
1111
includeScore: true,
1212
threshold: 0.2,
1313
keys: ["name"]

apps/desktop/src/lib/stores/quick-links.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ import Fuse from "fuse.js"
66
import { derived, get, writable, type Writable } from "svelte/store"
77
import { appState } from "./appState"
88

9-
export const fuse = new Fuse<QuickLink>([], {
9+
const fuse = new Fuse<QuickLink>([], {
1010
includeScore: true,
1111
threshold: 0.2,
1212
keys: ["name"]

apps/desktop/tsconfig.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,8 @@
99
"skipLibCheck": true,
1010
"sourceMap": true,
1111
"strict": true,
12-
"moduleResolution": "bundler"
12+
"moduleResolution": "bundler",
13+
"allowImportingTsExtensions": true
1314
},
1415
// Path aliases are handled by https://kit.svelte.dev/docs/configuration#alias
1516
// except $lib which is handled by https://kit.svelte.dev/docs/configuration#files

packages/api/src/models/manifest.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@ export const TitleBarStyleEnum = {
2929
transparent: "transparent",
3030
overlay: "overlay"
3131
}
32+
export type TitleBarStyle = v.InferOutput<typeof TitleBarStyle>
3233
export const TitleBarStyle = v.picklist(Object.values(TitleBarStyleEnum))
3334
// JS new WebViewWindow only accepts lowercase, while manifest loaded from Rust is capitalized. I run toLowerCase() on the value before passing it to the WebViewWindow.
3435
// This lowercase title bar style schema is used to validate and set the type so TypeScript won't complaint

packages/extension/package.json

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,14 +11,15 @@
1111
"./install": "./src/install.ts"
1212
},
1313
"devDependencies": {
14-
"@types/bun": "latest"
14+
"@types/bun": "latest",
15+
"@types/semver": "^7.5.8"
1516
},
1617
"dependencies": {
1718
"@kksh/api": "workspace:*",
18-
"@std/semver": "npm:@jsr/std__semver@^1.0.3",
19+
"@std/semver": "npm:@jsr/std__semver@^1.0.4",
1920
"@tauri-apps/plugin-upload": "^2.2.1",
2021
"semver": "^7.7.1",
21-
"uuid": "^11.0.3"
22+
"uuid": "^11.1.0"
2223
},
2324
"peerDependencies": {
2425
"typescript": "^5.0.0"

packages/extension/src/window.ts

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
1-
import type { WindowConfig } from "@kksh/api/models"
1+
import type { TitleBarStyle, WindowConfig } from "@kksh/api/models"
2+
import { TitleBarStyleEnum } from "@kksh/api/models"
23
import { WebviewWindow } from "@tauri-apps/api/webviewWindow"
34

45
export function launchNewExtWindow(windowLabel: string, url: string, windowConfig?: WindowConfig) {
@@ -26,7 +27,8 @@ export function launchNewExtWindow(windowLabel: string, url: string, windowConfi
2627
skipTaskbar: windowConfig?.skipTaskbar ?? undefined,
2728
shadow: windowConfig?.shadow ?? undefined,
2829
// theme: windowConfig?.theme ?? undefined,
29-
titleBarStyle: windowConfig?.titleBarStyle ?? undefined,
30+
titleBarStyle:
31+
(windowConfig?.titleBarStyle as keyof typeof TitleBarStyleEnum | undefined) ?? undefined,
3032
hiddenTitle: windowConfig?.hiddenTitle ?? undefined,
3133
tabbingIdentifier: windowConfig?.tabbingIdentifier ?? undefined,
3234
maximizable: windowConfig?.maximizable ?? undefined,

pnpm-lock.yaml

Lines changed: 16 additions & 4 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)