wechat-article / store /v2 /html.ts
asemxin2000's picture
Deploy wechat-article-exporter to Space
6e41657 verified
Raw
History Blame Contribute Delete
570 Bytes
import { db } from './db';
export interface HtmlAsset {
fakeid: string;
url: string;
file: Blob;
title: string;
commentID: string | null;
}
/**
* 更新 html 缓存
* @param html 缓存
*/
export async function updateHtmlCache(html: HtmlAsset): Promise<boolean> {
return db.transaction('rw', 'html', async () => {
await db.html.put(html);
return true;
});
}
/**
* 获取 asset 缓存
* @param url
*/
export async function getHtmlCache(url: string): Promise<HtmlAsset | undefined> {
return db.html.get(url);
}