also looking at this
fix(svelte): expose public store declaration types
#310
3 files
+58
-2
| @@ -1,4 +1,5 @@ | ||
| 1 | 1 | import { writable, derived } from 'svelte/store'; |
| 2 | import type { Readable } from 'svelte/store'; | |
| 2 | 3 | |
| 3 | 4 | interface CraftAPI { |
| 4 | 5 | getPlatform(): Promise<{ platform: string; version: string }>; |
| @@ -18,7 +19,7 @@ declare global { | ||
| 18 | 19 | } |
| 19 | 20 | } |
| 20 | 21 | |
| 21 | function createCraftStore() { | |
| 22 | function createCraftStore(): Readable<CraftAPI | null> { | |
| 22 | 23 | const { subscribe, set } = writable<CraftAPI | null>(null); |
| 23 | 24 | |
| 24 | 25 | if (typeof window !== 'undefined') { |