export declare const SCHEDULE_SURFACE_SCHEMA: "SCHEDULE_V1"; export declare const SCHEDULE_SURFACE_LANGUAGES: readonly [ "ja", "en" ]; export type ScheduleSurfaceLanguage = (typeof SCHEDULE_SURFACE_LANGUAGES)[number]; export declare const SCHEDULE_SURFACE_REGISTRATIONS: readonly [ "OPEN", "FULL", "CLOSED" ]; export type ScheduleSurfaceRegistration = (typeof SCHEDULE_SURFACE_REGISTRATIONS)[number]; export type ScheduleSurfaceEventV1 = Readonly<{ /** 親が画面を開くたびに作る使い捨ての番号。予定の ID ではない。 */ ref: string; title: string; /** JST の時刻(`2026-12-03T19:30:00+09:00`)。 */ startAt: string; endAt: string; places: readonly string[]; /** 円。0 は無料、null は金額の設定なし。 */ fee: number | null; /** 残りの席。null は残席を出さないイベント。 */ seats: Readonly<{ capacity: number; left: number; }> | null; registration: ScheduleSurfaceRegistration; joined: boolean; }>; export type ScheduleSurfaceBookingV1 = Readonly<{ ref: string; startAt: string; endAt: string; places: readonly string[]; headCount: number | null; /** 貸切。 */ exclusive: boolean; mine: boolean; }>; export type ScheduleSurfaceSnapshotV1 = Readonly<{ schema: typeof SCHEDULE_SURFACE_SCHEMA; language: ScheduleSurfaceLanguage; reducedMotion: boolean; spot: Readonly<{ name: string; }>; labels: Readonly<{ event: string; }>; /** JST の日付。`range.to` は含まない。 */ today: string; range: Readonly<{ from: string; to: string; }>; viewer: Readonly<{ canBook: boolean; }>; zones: readonly Readonly<{ ref: string; name: string; }>[]; events: readonly ScheduleSurfaceEventV1[]; bookings: readonly ScheduleSurfaceBookingV1[]; }>; /** `openSurface` で移れる画面。描けるかどうか(台帳)とは別。 */ export declare const SCHEDULE_SURFACE_LINK_TARGETS: readonly [ "HOME", "SCHEDULE", "HELP_TASKS" ]; export type ScheduleSurfaceLinkTarget = (typeof SCHEDULE_SURFACE_LINK_TARGETS)[number]; /** どれも「開く」「見る期間を変える」だけ。予約・参加・支払いの確定は NIHO の画面で会員が行う。 */ export type ScheduleSurfaceAction = Readonly<{ type: "openBooking"; ref: string; }> | Readonly<{ type: "startBooking"; date?: string; startHour?: number; endHour?: number; zoneRef?: string; }> | Readonly<{ type: "showMonth"; month: string; }> | Readonly<{ type: "openSurface"; surface: ScheduleSurfaceLinkTarget; }>; export type LivingSurfaceChangeV1 = Readonly<{ snapshot: Snapshot; sequence: number; }>; export type LivingSurfaceTapInputV1 = Readonly<{ name: string; /** 押した要素の `data-*`(`data-on-tap` を除く)。鍵は `data-ref` のように属性の名前のまま。 */ data: Readonly>; }>; /** ホストが書いたコードから使える `niho`。実体は描画エンジンの中にあり、ここに無いものは使えない。 */ export interface LivingSurfaceSdkV1 { readonly surface: { /** 今の値。呼ぶたびに別の写しを返す。 */ get(): Snapshot; /** 値が変わったときに呼ばれる。戻り値を呼ぶと聞くのをやめる。 */ onChange(listener: (change: LivingSurfaceChangeV1) => void | Promise): () => void; }; readonly ui: { /** `data-on-tap` に同じ名前を書いた要素が押されたときに呼ばれる。 */ onTap(name: string, listener: (input: LivingSurfaceTapInputV1) => void | Promise): () => void; }; readonly clock: { /** 端末の時刻(JST・秒まで。`2026-12-03T19:30:00+09:00`)。1 回の処理の間は変わらない。 */ now(): string; }; readonly actions: { /** NIHO の操作を頼む。`onTap` の中で、1 回のタップに 1 つだけ。結果は返らない。 */ request(action: Action): void; }; /** 最初の描画ができたら 1 回呼ぶ。 */ ready(): Promise; } export type NihoScheduleSurfaceSdkV1 = LivingSurfaceSdkV1; declare global { const niho: NihoScheduleSurfaceSdkV1; }