fix: type import (#2715)

This commit is contained in:
Himself65
2023-06-07 22:47:02 +08:00
committed by GitHub
parent 008a05a470
commit 7f2006488e
24 changed files with 60 additions and 91 deletions

View File

@@ -35,22 +35,14 @@ function rpcToObservable<
});
}
type InferTFromEvent<E> = E extends (
callback: (t: infer T) => void
) => () => void
? T
: never;
type UpdateMeta = InferTFromEvent<typeof window.events.updater.onUpdateReady>;
export const updateReadyAtom = atomWithObservable(() => {
return rpcToObservable(null as UpdateMeta | null, {
return rpcToObservable(null as any | null, {
event: window.events?.updater.onUpdateReady,
});
});
export const updateAvailableAtom = atomWithObservable(() => {
return rpcToObservable(null as UpdateMeta | null, {
return rpcToObservable(null as any | null, {
event: window.events?.updater.onUpdateAvailable,
onSubscribe: () => {
window.apis?.updater.checkForUpdatesAndNotify();

View File

@@ -1,6 +1,3 @@
// eslint-disable-next-line @typescript-eslint/triple-slash-reference
/// <reference path="../../../apps/electron/layers/preload/preload.d.ts" />
export * from './components/list-skeleton';
export * from './styles';
export * from './ui/breadcrumbs';