mirror of
https://gitea.toothfairyai.com/ToothFairyAI/tf_code.git
synced 2026-04-05 00:23:10 +00:00
21 lines
500 B
TypeScript
21 lines
500 B
TypeScript
import { App } from "../../app/app";
|
|
|
|
export namespace FileTimes {
|
|
export const state = App.state("tool.filetimes", () => ({
|
|
read: new Map<string, Date>(),
|
|
write: new Map<string, Date>(),
|
|
}));
|
|
|
|
export function read(filePath: string) {
|
|
state().read.set(filePath, new Date());
|
|
}
|
|
|
|
export function write(filePath: string) {
|
|
state().write.set(filePath, new Date());
|
|
}
|
|
|
|
export function get(filePath: string): Date | null {
|
|
return state().read.get(filePath) || null;
|
|
}
|
|
}
|