let idCounter = 1 ; export type Id = number ; export type TodoItem = { name : string ; id : Id ; completed : boolean ; } ; export function todoItem ( name , id = idCounter ++ , completed = false ) { return { name , completed , id , } ; }