const card: Card = createEmptyCard(new Date());
interface CardUnChecked
extends Omit<Card, "due" | "last_review" | "state"> {
cid: string;
due: Date | number;
last_review: Date | null | number;
state: StateType;
}
function cardAfterHandler(card: Card) {
return {
...card,
cid: "test001",
state: State[card.state],
last_review: card.last_review ?? null,
} as CardUnChecked;
}
const card: CardUnChecked = createEmptyCard(new Date(), cardAfterHandler);
Create an empty card