wechat-article / composables /usePreferences.ts
asemxin2000's picture
Deploy wechat-article-exporter to Space
6e41657 verified
Raw
History Blame Contribute Delete
897 Bytes
import { StorageSerializers } from '@vueuse/core';
import { MP_ORIGIN_TIMESTAMP } from '~/config';
import type { Preferences } from '~/types/preferences';
const defaultOptions: Partial<Preferences> = {
hideDeleted: true,
privateProxyList: [],
privateProxyAuthorization: '',
exportConfig: {
dirname: '${title}',
maxlength: 0,
exportExcelIncludeContent: true,
exportJsonIncludeComments: true,
exportJsonIncludeContent: true,
exportHtmlIncludeComments: true,
},
downloadConfig: {
forceDownloadContent: false,
metadataOverrideContent: false,
},
accountSyncSeconds: 3,
syncDateRange: 'all',
syncDatePoint: MP_ORIGIN_TIMESTAMP,
};
export default () => {
//@ts-ignore
return useLocalStorage<Preferences>('preferences', defaultOptions, {
serializer: StorageSerializers.object,
mergeDefaults: true,
});
};