e8c5802a96
Easier to extend in the future, or (de)serialize in a strongly-typed language.
12 lines
432 B
TypeScript
12 lines
432 B
TypeScript
// Copyright: Ankitects Pty Ltd and contributors
|
|
// License: GNU AGPL, version 3 or later; http://www.gnu.org/licenses/agpl.html
|
|
|
|
import { Stats } from "../lib/proto";
|
|
import { postRequest } from "../lib/postrequest";
|
|
|
|
export async function getCardStats(cardId: number): Promise<Stats.CardStatsResponse> {
|
|
return Stats.CardStatsResponse.decode(
|
|
await postRequest("/_anki/cardStats", JSON.stringify({ cardId }))
|
|
);
|
|
}
|