// PLAN_V2.0 の SCHEDULE の設計図(入力の形)。contracts の livingSurfacePlanTypeDeclarations が定義と語彙から作る。 // 型で表せない検査(数の上限・文字数・limit の上限・skin が media のときの cover・skipFeatured の相手)は parser が行う。 export type LivingSurfacePlanLocalizedText = { readonly ja: string; readonly en: string }; export type LivingSurfacePlanLook = { readonly density?: "compact" | "regular" | "airy"; readonly shape?: "sharp" | "soft" | "rounded" | "leaf"; readonly texture?: "none" | "paper" | "grain" | "night" }; export type LivingSurfacePlanHeadingText = { readonly role: "display" | "title"; readonly text: LivingSurfacePlanLocalizedText; readonly vertical?: boolean }; export type LivingSurfacePlanSubText = { readonly role: "body" | "caption"; readonly text: LivingSurfacePlanLocalizedText; readonly vertical?: false }; export type LivingSurfacePlanKickerText = { readonly role: "caption"; readonly text: LivingSurfacePlanLocalizedText; readonly vertical?: false }; export type LivingSurfacePlanText = LivingSurfacePlanHeadingText | LivingSurfacePlanSubText; export type LivingSurfacePlanOrnament = ({ readonly catalog: "lantern" | "lanterns" | "moon" | "leaf" | "wave" | "star" | "stars" | "confetti" | "blob" | "cloud" | "noren"; readonly asset?: never } | { readonly asset: string; readonly catalog?: never }) & { readonly anchor: "topLeft" | "top" | "topRight" | "left" | "center" | "right" | "bottomLeft" | "bottom" | "bottomRight"; readonly size?: "s" | "m" | "l"; readonly offset?: { readonly x: -2 | -1 | 0 | 1 | 2; readonly y: -2 | -1 | 0 | 1 | 2 }; readonly rotate?: -15 | -8 | 0 | 8 | 15; readonly tone?: "accent" | "swatch1" | "swatch2" | "swatch3" | "swatch4"; readonly motion?: "none" | "enter" | "sway" | "stamp" }; export type LivingSurfacePlanMediaBase = { readonly ratio: "1:1" | "4:3" | "3:2" | "16:9" | "3:4" | "4:5"; readonly veil?: "none" | "soft" | "strong"; readonly mono?: boolean } & { readonly size?: "s" | "m" | "l" } & ({ readonly fit: "contain"; readonly focus?: never } | { readonly fit?: "cover"; readonly focus?: "center" | "top" | "bottom" | "left" | "right" }) & ({ readonly alt: LivingSurfacePlanLocalizedText; readonly decorative?: false } | { readonly decorative: true; readonly alt?: never }); export type LivingSurfacePlanMedia = LivingSurfacePlanMediaBase & { readonly asset: string; readonly cover?: false }; export type LivingSurfacePlanLogo = Pick & ({ readonly alt: LivingSurfacePlanLocalizedText; readonly decorative?: false } | { readonly decorative: true; readonly alt?: never }); export type LivingSurfacePlanMediaWithCover = LivingSurfacePlanMediaBase & ({ readonly asset: string; readonly cover?: false } | { readonly cover: true; readonly asset?: never }); export type LivingSurfacePlanAction = { readonly type: "startBooking" } | { readonly type: "openSurface"; readonly surface: "HOME" | "SCHEDULE" | "HELP_TASKS" }; export type LivingSurfacePlanButton = { readonly label: LivingSurfacePlanLocalizedText; readonly kind?: "primary" | "secondary" | "text"; readonly action: Action }; export type LivingSurfacePlanFeatureAction = { readonly action?: LivingSurfacePlanButton; readonly actionLayout?: never } | { readonly action: LivingSurfacePlanButton; readonly actionLayout: "inline" | "full" | "bottom" | "card" }; export type LivingSurfacePlanCustomBadge = { readonly kind: "custom"; readonly shape?: "pill" | "stamp"; readonly label: LivingSurfacePlanLocalizedText }; export type LivingSurfacePlanEmptiness = { readonly empty: LivingSurfacePlanText; readonly hideWhenEmpty?: false } | { readonly hideWhenEmpty: true; readonly empty?: never }; export type LivingSurfacePlanFeatureVariant = (({ readonly variant: "banner" | "poster" | "night" | "masthead" | "compact"; readonly media?: Media; readonly mediaPlacement?: never } | { readonly variant: "banner" | "poster" | "night" | "window" | "masthead" | "compact"; readonly media: Media; readonly mediaPlacement?: "top" | "start" | "end" | "over" }) & { readonly ground?: "fill" | "soft" | "surface" }) | { readonly variant: "hero" | "agenda" | "portrait"; readonly media?: Media; readonly mediaPlacement?: never; readonly ground?: never }; export type LivingSurfacePlanFeatureBase = { readonly type: "feature"; readonly kicker?: LivingSurfacePlanKickerText; readonly title?: LivingSurfacePlanHeadingText; readonly subtitle?: LivingSurfacePlanSubText; readonly ornaments?: readonly LivingSurfacePlanOrnament[]; readonly tone?: "accent" | "swatch1" | "swatch2" | "swatch3" | "swatch4"; readonly align?: "start" | "center"; readonly motion?: "none" | "enter" | "sway" | "stamp"; readonly logo?: LivingSurfacePlanLogo }; export type LivingSurfacePlanFeatureWithoutItem = LivingSurfacePlanFeatureBase & LivingSurfacePlanFeatureVariant & LivingSurfacePlanFeatureAction & { readonly item?: never; readonly empty?: never; readonly hideWhenEmpty?: false; readonly facts?: readonly []; readonly progress?: never; readonly badges?: readonly LivingSurfacePlanCustomBadge[] }; export type LivingSurfacePlanQueryEvents = { readonly source: "events"; readonly filter?: readonly ("upcoming" | "joined" | "open")[]; readonly sort?: "start" }; export type LivingSurfacePlanFactEvents = { readonly kind: "date"; readonly format?: "md" | "weekday" | "weekdayLatin" | "kanji" | "relative"; readonly size?: "regular" | "big" } | { readonly kind: "startTime"; readonly format?: "kanji"; readonly size?: "regular" | "big" } | { readonly kind: "daysUntil"; readonly format?: "kanji"; readonly size?: "regular" | "big" } | { readonly kind: "seatsLeft"; readonly format?: "kanji"; readonly size?: "regular" | "big" } | { readonly kind: "fee"; readonly size?: "regular" | "big" } | { readonly kind: "places"; readonly size?: "regular" | "big" } | { readonly kind: "instructor"; readonly size?: "regular" | "big" } | { readonly kind: "organizer"; readonly size?: "regular" | "big" }; export type LivingSurfacePlanBadgeEvents = { readonly kind: "joined" | "full" | "closed"; readonly shape?: "pill" | "stamp" } | LivingSurfacePlanCustomBadge; export type LivingSurfacePlanProgressEvents = { readonly value: "seatsTaken"; readonly label: LivingSurfacePlanLocalizedText; readonly tone?: "accent" | "swatch1" | "swatch2" | "swatch3" | "swatch4"; readonly shape?: "bar" | "ring" }; export type LivingSurfacePlanFeatureEvents = LivingSurfacePlanFeatureBase & LivingSurfacePlanFeatureVariant & LivingSurfacePlanEmptiness & LivingSurfacePlanFeatureAction<{ readonly type: "openBooking" } | { readonly type: "startBooking" } | { readonly type: "openSurface"; readonly surface: "HOME" | "SCHEDULE" | "HELP_TASKS" }> & { readonly item: LivingSurfacePlanQueryEvents; readonly facts?: readonly LivingSurfacePlanFactEvents[]; readonly badges?: readonly LivingSurfacePlanBadgeEvents[]; readonly progress?: LivingSurfacePlanProgressEvents }; export type LivingSurfacePlanCollectionEvents = { readonly type: "collection"; readonly query: LivingSurfacePlanQueryEvents; readonly skin: "plain" | "media" | "ticket" | "placard" | "slip"; readonly fields: readonly ("title" | "date" | "time" | "places" | "fee" | "seats" | "cover" | "instructor" | "organizer")[]; readonly limit: number; readonly mark?: "pill" | "stamp" | "none"; readonly skipFeatured?: boolean; readonly numerals?: "arabic" | "kanji"; readonly motion?: "none" | "enter"; readonly tone?: "accent" | "swatch1" | "swatch2" | "swatch3" | "swatch4" } & LivingSurfacePlanEmptiness & ({ readonly layout: "rail"; readonly vertical?: boolean } | { readonly layout: "stack" | "grid2" | "grid3" | "split" | "tiles"; readonly vertical?: false }); export type LivingSurfacePlanQueryBookings = { readonly source: "bookings"; readonly filter?: readonly ("mine")[]; readonly sort?: "start" }; export type LivingSurfacePlanFactBookings = { readonly kind: "date"; readonly format?: "md" | "weekday" | "weekdayLatin" | "kanji" | "relative"; readonly size?: "regular" | "big" } | { readonly kind: "startTime"; readonly format?: "kanji"; readonly size?: "regular" | "big" } | { readonly kind: "daysUntil"; readonly format?: "kanji"; readonly size?: "regular" | "big" } | { readonly kind: "places"; readonly size?: "regular" | "big" } | { readonly kind: "headCount"; readonly format?: "kanji"; readonly size?: "regular" | "big" }; export type LivingSurfacePlanBadgeBookings = LivingSurfacePlanCustomBadge; export type LivingSurfacePlanFeatureBookings = LivingSurfacePlanFeatureBase & LivingSurfacePlanFeatureVariant & LivingSurfacePlanEmptiness & LivingSurfacePlanFeatureAction<{ readonly type: "openBooking" } | { readonly type: "startBooking" } | { readonly type: "openSurface"; readonly surface: "HOME" | "SCHEDULE" | "HELP_TASKS" }> & { readonly item: LivingSurfacePlanQueryBookings; readonly facts?: readonly LivingSurfacePlanFactBookings[]; readonly badges?: readonly LivingSurfacePlanBadgeBookings[]; readonly progress?: never }; export type LivingSurfacePlanCollectionBookings = { readonly type: "collection"; readonly query: LivingSurfacePlanQueryBookings; readonly skin: "plain" | "ticket" | "placard" | "slip"; readonly fields: readonly ("date" | "time" | "places" | "headCount" | "exclusive")[]; readonly limit: number; readonly mark?: "pill" | "stamp" | "none"; readonly skipFeatured?: boolean; readonly numerals?: "arabic" | "kanji"; readonly motion?: "none" | "enter"; readonly tone?: "accent" | "swatch1" | "swatch2" | "swatch3" | "swatch4" } & LivingSurfacePlanEmptiness & ({ readonly layout: "rail"; readonly vertical?: boolean } | { readonly layout: "stack" | "grid2" | "grid3" | "split" | "tiles"; readonly vertical?: false }); export type LivingSurfacePlanFeature = LivingSurfacePlanFeatureWithoutItem | LivingSurfacePlanFeatureEvents | LivingSurfacePlanFeatureBookings; export type LivingSurfacePlanCollection = LivingSurfacePlanCollectionEvents | LivingSurfacePlanCollectionBookings; export type LivingSurfacePlanModule = ({ readonly type: "module"; readonly name: "calendar"; readonly compact?: boolean; readonly controls?: boolean; readonly marker?: { readonly tone?: "accent" | "swatch1" | "swatch2" | "swatch3" | "swatch4"; readonly fill?: "solid" | "soft" | "plain"; readonly emoji?: string } } & ({ readonly view: "week"; readonly days?: 5 | 7 } | { readonly view: "day" | "month"; readonly days?: never })); export type LivingSurfacePlanItem = LivingSurfacePlanFeature | LivingSurfacePlanCollection | LivingSurfacePlanModule; export type LivingSurfacePlanSection = { readonly layout: "stack" | "rail" | "grid2" | "grid3" | "split" | "tiles"; readonly ornaments?: readonly LivingSurfacePlanOrnament[]; readonly items: readonly LivingSurfacePlanItem[] } & ({ readonly title: LivingSurfacePlanHeadingText; readonly kicker?: LivingSurfacePlanKickerText; readonly action?: LivingSurfacePlanButton } | { readonly title?: never; readonly kicker?: never; readonly action?: never }); export type LivingSurfacePlanPage = { readonly look?: LivingSurfacePlanLook; readonly hideDefaultBookingButton?: boolean; readonly sections: readonly LivingSurfacePlanSection[]; };