ts-quiz— ~/quiz/levels.ts
tsc --watch● loading…
// tsc --watch · type-checking modules…
await load("quiz/levels.ts")
// streaming server components
◇ tsc 6.0.3 · compiling…UTF-8◇ scanning levels…
Repository<T> in this example?interface Repository<T> {
findById(id: string): T | null;
save(entity: T): void;
}
type Product = { id: string; price: number };
const repo: Repository<Product> = {
findById: id => ({ id, price: 10 }),
save: entity => {
console.log(entity.price);
},
};