Typescript/interface

src/interface/interface.ts
interface Bread {
    calories: number
}

interface Bread {
    type: string
}

const francePan: Bread = {
    calories: 300,
    type: "hard"
}

interface Book {
    page: number,
    title: string
}

interface Magazine extends Book {
    cycle: "daily" | "weekly" | "monthly"
}

const jump: Magazine = {
    page: 300,
    title: "ジャンプ",
    cycle: "daily"
}

class Comic implements Book {
    page: number;
    title: string;
    constructor(page: number, title: string) {
        this.page = page
        this.title = title
    }
}

const doraemon = new Comic(200, "ドラえもん")