import * as models from './models'; import { Actions, AnyAction, ComponentDescriptorType, States, SummaryPartShape } from '@topwrite/common'; import ToolBarItem from './components/editor/tool-bar/item'; import Form from './components/form'; import { XBlockEditProps, XBlockProps, XInlineEditProps, XInlineProps } from './components/editor/plugins/x-element/tool'; import { ComponentProps } from 'react'; import './components/editor/custom-types'; import { PromptOptions } from './components/modal/prompt'; import { MenuItemProps } from './pages/status-bar'; import { CatalogMenuItemProps } from './pages/catalog'; type Models = typeof models; interface AssetHandler { onSuccess: (result: { path: string; name: string; size: number; }) => void; } declare module '@topwrite/common' { interface PluginMeta { installs_count: number; } function useSelector(model: T): States[T]; function useActions(namespace: T): Actions[T]; function useModel(model: T): [States[T], Actions[T]]; interface Model { getState(model: T): Generator[T]>; } interface OptionsStateType { preview: string | null; feedback: string | null; asset: string; assistant: { base: string; authorized: boolean; tools: BuiltinTool[]; models: { name: string; label: string; thinking?: boolean; }[]; }; download: string; import: string; export: string; lfs: boolean; release: boolean; metadata: Record; } interface ComponentsMap { 'plugin:setting': ComponentDescriptorType>; 'editor:catalog:menu:item': ComponentDescriptorType; 'editor:catalog:part:title': ComponentDescriptorType; 'editor:catalog:items': ComponentDescriptorType; 'editor:catalog:part': ComponentDescriptorType; 'editor:tool': ComponentDescriptorType>; 'editor:tool:video:upload': ComponentDescriptorType; 'editor:tool:audio:upload': ComponentDescriptorType; 'editor:tool:image:upload': ComponentDescriptorType; 'editor:tool:attachment:upload': ComponentDescriptorType; 'editor:directive': ComponentDescriptorType; 'editor:block': ComponentDescriptorType; 'editor:block:edit': ComponentDescriptorType; 'editor:inline': ComponentDescriptorType; 'editor:inline:edit': ComponentDescriptorType; 'editor:menu:item': ComponentDescriptorType; } } declare global { interface Window { TopWriteState: { book: { id: string; }; options: { plugins: { host: string; }; }; }; } interface TypeToTriggeredEventMap { beforeCreatePart: CustomEvent>; beforeUpdatePart: CustomEvent>; } } export {};