mirror of
https://github.com/toeverything/AFFiNE.git
synced 2026-02-12 12:28:42 +00:00
fix: type import (#2715)
This commit is contained in:
@@ -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();
|
||||
|
||||
@@ -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';
|
||||
|
||||
Reference in New Issue
Block a user