import type { ViewBox } from '../types/viewer'; import type { ModelPoseOptions } from '../types/model'; import type { AnnotationPlacement, Chapter, ChapterAdvance, ChapterMedia, ChapterModel, ChapterCameraTrack, ChapterDrawingAnnotation, StoryState } from '../types/story'; export type CapturePayload = { manifest: string; canvasIndex: number; canvasId?: string; viewBox?: ViewBox; media?: ChapterMedia; model?: ChapterModel; modelOptions?: ModelPoseOptions; layerOpacities?: Record; entryTransition?: Chapter['entryTransition']; presentationDurationMs?: number; transitionTimeMs?: number; cameraTrack?: ChapterCameraTrack; drawingAnnotations?: ChapterDrawingAnnotation[]; }; export type AddChapterPayload = { capture: CapturePayload; id?: string; }; export type UpdateChapterPayload = { chapterId: string; capture: CapturePayload; }; export type DeleteChapterPayload = { chapterId: string; }; export type NarrationTrackPayload = { language: string; src: string; }; export type NarrationSegmentPayload = { chapterId: string; language: string; start: number; end: number; }; export type RemoveNarrationSegmentPayload = { chapterId: string; language: string; }; export type AnnotationTextPayload = { chapterId: string; language: string; text?: string; }; export type AnnotationPlacementPayload = { chapterId: string; language: string; placement?: AnnotationPlacement; }; export type AdvanceModePayload = { chapterId: string; mode: ChapterAdvance['mode']; }; export type AdvanceDelayPayload = { chapterId: string; delayMs?: number; }; export type ChapterMarginPayload = { chapterId: string; margin?: number; }; export type ChapterMarginUndoPayload = { chapterId: string; margin?: number; }; export type ChapterManifestPayload = { chapterId: string; manifest: string; }; export type ChapterMetadataPayload = { chapterId: string; language: string; value?: string; }; export type StoryMetadataPayload = { language: string; value?: string; }; export type StoryIdentifiersPayload = { id?: string; annotationBase?: string; }; export type ChapterCameraTrackPayload = { chapterId: string; cameraTrack?: ChapterCameraTrack; }; export type ChapterViewBoxPayload = { chapterId: string; viewBox: ViewBox; }; export type ReorderChapterPayload = { chapterId: string; targetChapterId: string; position?: 'before' | 'after'; }; export declare const createEmptyStory: () => StoryState; export declare const addChapterFromCapture: (story: StoryState, payload: AddChapterPayload) => StoryState; export declare const updateChapterFromCapture: (story: StoryState, payload: UpdateChapterPayload) => StoryState; export declare const deleteChapter: (story: StoryState, payload: DeleteChapterPayload) => StoryState; export declare const setNarrationTrack: (story: StoryState, payload: NarrationTrackPayload) => StoryState; export declare const setNarrationSegment: (story: StoryState, payload: NarrationSegmentPayload) => StoryState; export declare const removeNarrationSegment: (story: StoryState, payload: RemoveNarrationSegmentPayload) => StoryState; export declare const setAnnotationText: (story: StoryState, payload: AnnotationTextPayload) => StoryState; export declare const setAnnotationPlacement: (story: StoryState, payload: AnnotationPlacementPayload) => StoryState; export declare const setAdvanceMode: (story: StoryState, payload: AdvanceModePayload) => StoryState; export declare const setDelay: (story: StoryState, payload: AdvanceDelayPayload) => StoryState; export declare const setChapterManifest: (story: StoryState, payload: ChapterManifestPayload) => StoryState; export declare const setChapterTitle: (story: StoryState, payload: ChapterMetadataPayload) => StoryState; export declare const setStoryTitle: (story: StoryState, payload: StoryMetadataPayload) => StoryState; export declare const setStoryIdentifiers: (story: StoryState, payload: StoryIdentifiersPayload) => StoryState; export declare const setChapterCameraTrack: (story: StoryState, payload: ChapterCameraTrackPayload) => StoryState; export declare const setChapterViewBox: (story: StoryState, payload: ChapterViewBoxPayload) => StoryState; export declare const setChapterDescription: (story: StoryState, payload: ChapterMetadataPayload) => StoryState; export type ChapterLayersPayload = { chapterId: string; layerOpacities: Record; }; export declare const setLayerOpacities: (story: StoryState, payload: ChapterLayersPayload) => StoryState; export declare const reorderChapter: (story: StoryState, payload: ReorderChapterPayload) => StoryState; /** * StoryState store using Svelte 5 runes. * * This is a runes-based reactive store that can be used from Svelte components. * It maintains story data as plain, serializable state following the architectural principle * that story JSON must remain plain data without functions or runtime values. * * Usage in a Svelte component: * ```svelte * * * {store.story.chapters.length} chapters * ``` */ export declare function createStoryStore(initial?: StoryState): { readonly story: StoryState; addChapterFromCapture(payload: AddChapterPayload): void; updateChapterFromCapture(payload: UpdateChapterPayload): void; deleteChapter(payload: DeleteChapterPayload): void; setNarrationTrack(payload: NarrationTrackPayload): void; setNarrationSegment(payload: NarrationSegmentPayload): void; removeNarrationSegment(payload: RemoveNarrationSegmentPayload): void; setAnnotationText(payload: AnnotationTextPayload): void; setAnnotationPlacement(payload: AnnotationPlacementPayload): void; setAdvanceMode(payload: AdvanceModePayload): void; setDelay(payload: AdvanceDelayPayload): void; setChapterManifest(payload: ChapterManifestPayload): void; setChapterTitle(payload: ChapterMetadataPayload): void; setStoryTitle(payload: StoryMetadataPayload): void; setStoryIdentifiers(payload: StoryIdentifiersPayload): void; setChapterCameraTrack(payload: ChapterCameraTrackPayload): void; setChapterViewBox(payload: ChapterViewBoxPayload): void; setChapterDescription(payload: ChapterMetadataPayload): void; setLayerOpacities(payload: ChapterLayersPayload): void; reorderChapter(payload: ReorderChapterPayload): void; exportStory(): StoryState; loadStory(next: StoryState): void; }; export type StoryStoreRunes = ReturnType;