mirror of
https://github.com/toeverything/AFFiNE.git
synced 2026-08-02 18:09:58 +08:00
feat(electron): add font list handlers
This commit is contained in:
@@ -0,0 +1,15 @@
|
||||
import { getFonts } from 'font-list';
|
||||
|
||||
import type { NamespaceHandlers } from '../type';
|
||||
|
||||
export const fontListHandlers = {
|
||||
getSystemFonts: async () => {
|
||||
try {
|
||||
const fonts = await getFonts();
|
||||
return fonts;
|
||||
} catch (error) {
|
||||
console.error('Failed to get system fonts:', error);
|
||||
return [];
|
||||
}
|
||||
},
|
||||
} satisfies NamespaceHandlers;
|
||||
@@ -0,0 +1 @@
|
||||
export * from './handlers';
|
||||
@@ -5,6 +5,7 @@ import { clipboardHandlers } from './clipboard';
|
||||
import { configStorageHandlers } from './config-storage';
|
||||
import { exportHandlers } from './export';
|
||||
import { findInPageHandlers } from './find-in-page';
|
||||
import { fontListHandlers } from './font-list';
|
||||
import { getLogFilePath, logger, revealLogFile } from './logger';
|
||||
import { sharedStorageHandlers } from './shared-storage';
|
||||
import { uiHandlers } from './ui/handlers';
|
||||
@@ -29,6 +30,7 @@ export const allHandlers = {
|
||||
configStorage: configStorageHandlers,
|
||||
findInPage: findInPageHandlers,
|
||||
sharedStorage: sharedStorageHandlers,
|
||||
fontList: fontListHandlers,
|
||||
};
|
||||
|
||||
export const registerHandlers = () => {
|
||||
|
||||
Reference in New Issue
Block a user