@fernandomg/streak-counter
Version:
This is a basic streak counter - inspired by Duolingo - written in TypeScript and ment for the browser (uses `localStorage`).
10 lines (9 loc) • 371 B
TypeScript
export declare const KEY = "streak";
export interface Streak {
currentCount: number;
startDate: string;
lastLoginDate: string;
}
export declare function formattedDate(date: Date): string;
export declare function buildStreak(date: Date, overrideDefaults?: Partial<Streak>): Streak;
export declare function updateStreak(storage: Storage, streak: Streak): void;