import { type ReactPortal } from "react"; import { type MangaViewerInstance, type MangaViewerOptions, type ViewerEventMap, type ViewerEventName } from "@yui540/comimi"; import { type ReactManga } from "./types"; /** * comimi の各イベントを `on` 形式の props にしたもの。 * 例: `pageChange` → `onPageChange`、`favoritesChange` → `onFavoritesChange`。 */ export type ViewerEventProps = { [K in ViewerEventName as `on${Capitalize}`]?: ViewerEventMap[K] extends void ? () => void : (event: ViewerEventMap[K]) => void; }; type EventPropName = keyof ViewerEventProps; export declare const VIEWER_EVENT_PROP_NAMES: readonly EventPropName[]; /** props からイベントハンドラだけを取り出す。 */ export declare function pickViewerEventProps(props: T): ViewerEventProps; export interface UseMangaViewerOptions extends Omit, ViewerEventProps { manga: ReactManga; } export interface UseMangaViewerResult { containerRef: React.RefObject; viewer: MangaViewerInstance | null; /** Portals that render React page content. Must be rendered by the consumer. */ portals: ReactPortal[]; } export declare function useMangaViewer(options: UseMangaViewerOptions): UseMangaViewerResult; export {};