import type { IAssetUploadDecision, IAssetUploadInput, IAssetUploadPosition, IAssetUploadResult, IBlock, IClipboardData, IGetDocInfo, IGetTreeStat, IKernelPlugin, IKernelPluginState, IMenu, IMenuBaseDetail, IMenuItem, IModels, IObject, IPosition, IProtyle, IProtyleOptions, IRefDefs, ISiyuan, IWebSocketData, TAssetUploadSource, TAssetUploadTarget, TEditorMode, TProtyleAction, } from "./types"; import {App, Config, Custom, Files, Lute, MobileCustom, Model, Protyle, subMenu, Tab, Toolbar,} from "./types"; export * from "./types"; declare global { export interface Window extends Global { } } export type TDock = "file" | "outline" | "inbox" | "bookmark" | "tag" | "graph" | "globalGraph" | "backlink" | "agentChat" export type TTab = "Outline" | "Graph" | "Backlink" | "Asset" | "Editor" | "Search" | "siyuan-card" export type TCardType = "doc" | "notebook" | "all" export type TEventBus = keyof IEventBusMap export type TPluginDockPosition = "LeftTop" | "LeftBottom" | "RightTop" | "RightBottom" | "BottomLeft" | "BottomRight" export type TPluginDataChangeReason = "sync" | "overwrite" export type TOperation = "insert" | "restoreCreatedDoc" | "removeCreatedDoc" | "update" | "delete" | "move" | "foldHeading" | "unfoldHeading" | "setAttrs" | "updateAttrs" | "append" | "insertAttrViewBlock" | "removeAttrViewBlock" | "addAttrViewCol" | "removeAttrViewCol" | "addFlashcards" | "removeFlashcards" | "updateAttrViewCell" | "updateAttrViewCol" | "updateAttrViewColTemplate" | "sortAttrViewRow" | "sortAttrViewCol" | "sortAttrViewKey" | "sortAttrViewBinding" | "setAttrViewColPin" | "setAttrViewColHidden" | "setAttrViewColWrap" | "setAttrViewColWidth" | "setAttrViewColAlign" | "updateAttrViewColOptions" | "removeAttrViewColOption" | "updateAttrViewColOption" | "setAttrViewCustomColors" | "setAttrViewName" | "setAttrViewNewItemTemplates" | "doUpdateUpdated" | "duplicateAttrViewKey" | "setAttrViewColIcon" | "setAttrViewFilters" | "setAttrViewSorts" | "setAttrViewColCalc" | "updateAttrViewColNumberFormat" | "replaceAttrViewBlock" | "addAttrViewView" | "setAttrViewViewName" | "removeAttrViewView" | "setAttrViewViewIcon" | "duplicateAttrViewView" | "setAttrViewContextFilter" | "sortAttrViewView" | "setAttrViewPageSize" | "updateAttrViewColRelation" | "moveOutlineHeading" | "updateAttrViewColRollup" | "hideAttrViewName" | "setAttrViewCardSize" | "setAttrViewCardAspectRatio" | "setAttrViewCoverFrom" | "setAttrViewCoverFromAssetKeyID" | "setAttrViewFitImage" | "setAttrViewShowIcon" | "setAttrViewWrapField" | "setAttrViewColDateFillCreated" | "setAttrViewColDateFillSpecificTime" | "setAttrViewViewDesc" | "setAttrViewColDesc" | "setAttrViewBlockView" | "setAttrViewGroup" | "removeAttrViewGroup" | "hideAttrViewAllGroups" | "syncAttrViewTableColWidth" | "hideAttrViewGroup" | "sortAttrViewGroup" | "foldAttrViewGroup" | "setAttrViewDisplayFieldName" | "setAttrViewFillColBackgroundColor" | "setAttrViewUpdatedIncludeTime" | "setAttrViewCreatedIncludeTime" export interface Global { Lute: typeof Lute; siyuan: ISiyuan; } export interface IEventBusMap { "before-hide-tooltip": { tooltipElement: HTMLElement, }; /** 在桌面端搜索结果渲染前同步触发,blocks 仅包含当前页结果。 */ "before-search-results-render": { protyle: Protyle, config: Config.IUILayoutTabSearchConfig, searchElement: HTMLInputElement, blocks: IBlock[], }; "before-show-tooltip": { message: string, target: Element, tooltipElement: HTMLElement, }; /** 不得在该事件上调用 `preventDefault()`,取消上传应使用 `respondWith({action: "cancel"})`;未取得全部资源路径时,HTML 粘贴将停止正文提交。 */ "before-upload-assets": { requestId: string, /** PDF 标注等无编辑器上传场景不提供该字段。 */ protyle?: IProtyle, source: TAssetUploadSource, target: TAssetUploadTarget, position?: IAssetUploadPosition, /** 替换输入必须保持的精确文件数量;各项还须与原输入按下标一一对应。 */ requiredFileCount?: number, /** 当前目标支持的输入类型;未提供时支持 files 和 local-files。 */ allowedInputKinds?: Array, input: IAssetUploadInput, /** * 插件处理阶段的取消信号;自定义 upload.handler 执行期间也会在编辑器销毁或超时时触发。 * 标准传输开始后不再因编辑器销毁触发。 */ signal: AbortSignal, /** 必须同步调用且每次事件只允许调用一次;替换项须保持逻辑顺序,异步处理应传入 Promise,每个插件默认 120 秒超时。 */ respondWith(response: IAssetUploadDecision | PromiseLike): void, /** * 必须同步注册,经思源前端上传协调层发起的资源写入成功、失败或取消时执行一次。 * 注册该回调的插件卸载后不再执行。 * 回调结果不表示父级正文或属性视图已完成写入,也不覆盖 HTTP API、CLI、MCP、同步、导入、历史恢复等内核写入。 */ onComplete(callback: (result: IAssetUploadResult) => void): void, }; "common-menu-closed": { menu: HTMLElement, name: string | null, from: string | null, }; "common-menu-open": { menu: HTMLElement, name: string | null, from: string | null, mode: "popup" | "fullscreen", }; "click-flashcard-action": { card: ICard, type: string, // 1 - 重来;2 - 困难;3 - 良好;4 - 简单;-1 - 显示答案;-2 - 上一个 ;-3 - 跳过 }; "click-blockicon": { menu: subMenu, protyle: IProtyle, blockElements: HTMLElement[], }; "click-editorcontent": { protyle: IProtyle, event: MouseEvent, }; "click-editortitleicon": { menu: subMenu, protyle: IProtyle, data: IGetDocInfo, }; "click-pdf": { event: MouseEvent, }; "closed-notebook": IWebSocketData; "destroy-protyle": { protyle: IProtyle, }; "input-search": { protyle: Protyle, config: Config.IUILayoutTabSearchConfig, searchElement: HTMLInputElement, }; "loaded-protyle-dynamic": { protyle: IProtyle, position: "afterend" | "beforebegin", }; "loaded-protyle-static": { protyle: IProtyle, }; "lock-screen": void; "switch-protyle": { protyle: IProtyle, }; "switch-protyle-mode": { protyle: IProtyle, }; "open-menu-av": IMenuBaseDetail & { selectRowElements: HTMLElement[] }; "open-menu-blockref": IMenuBaseDetail; "open-menu-breadcrumbmore": { menu: subMenu, protyle: IProtyle, data: IGetTreeStat, }; "open-menu-content": IMenuBaseDetail & { range: Range }; "open-menu-fileannotationref": IMenuBaseDetail; "open-menu-image": IMenuBaseDetail; "open-menu-link": IMenuBaseDetail; "open-menu-tag": IMenuBaseDetail; "open-menu-doctree": { menu: subMenu, elements: NodeListOf, type: "doc" | "docs" | "notebook" | "notebooks" | "items", items: { id: string, path: string, notebookId: string }[], }; "open-menu-inbox": { menu: subMenu, element: HTMLElement, ids: string[], }; "open-asset": { path: string, action: Config.TAssetOpenAction, event?: MouseEvent, }; "open-link": { href: string, originalHref: string, event?: MouseEvent | KeyboardEvent, }; "open-noneditableblock": { protyle: IProtyle, toolbar: Toolbar, blockElement: HTMLElement, renderElement: HTMLElement, }; "open-siyuan-url-block": { url: string, id: string, focus: boolean, exist: boolean, }; "open-siyuan-url-plugin": { url: string, }; "opened-notebook": IWebSocketData; "paste": { protyle: IProtyle, /** 调用 `preventDefault()` 接管粘贴后必须在 120 秒内完成。 */ resolve: (value: IClipboardData | PromiseLike | undefined) => void, textHTML: string, textPlain: string, siyuanHTML: string, localFiles: { path: string, size: number }[] files: FileList | DataTransferItemList }; "ws-main": IWebSocketData; "sync-start": IWebSocketData; "sync-end": IWebSocketData; "sync-fail": IWebSocketData; "mobile-keyboard-show": void; "mobile-keyboard-hide": void; "code-language-update": { languages: string[], type: "init" | "match", listElement: HTMLElement, value: string }; "code-language-change": { language: string, languageElements: HTMLElement[], protyle: IProtyle }; "kernel-plugin-state-change": IKernelPluginState; } export interface IPluginDockTab { position: TPluginDockPosition, size: Config.IUILayoutDockPanelSize, icon: string, hotkey?: string, title: string, index?: number show?: boolean } export interface ICommandContext { source: "commandPanel" | "shortcut" | "editorShortcut" | "fileTreeShortcut" | "dockShortcut" | "globalShortcut" | "keymap" | "menu" | "api", focus: "global" | "editor" | "fileTree" | "dock", protyle?: IProtyle, range?: Range, fileTree?: Files, dock?: HTMLElement, } export interface ICommand { langKey: string, // 用于区分不同快捷键的 key, 同时作为 i18n 的字段名 langText?: string, // 显示的文本, 指定后不再使用 langKey 对应的 i18n 文本 /** * 目前需使用 MacOS 符号标识,顺序按照 ⌥⇧⌘,入 ⌥⇧⌘A * "Ctrl": "⌘", * "Shift": "⇧", * "Alt": "⌥", * "Tab": "⇥", * "Backspace": "⌫", * "Delete": "⌦", * "Enter": "↩", */ hotkey?: string, customHotkey?: string, execute?: (context: ICommandContext) => void | Promise callback?: (context?: ICommandContext) => void // 其余回调存在时将不会触发 globalCallback?: (context?: ICommandContext) => void // 焦点不在应用内时执行的回调 fileTreeCallback?: ( file: Files, context?: ICommandContext ) => void // 焦点在文档树上时执行的回调 editorCallback?: (protyle: IProtyle, context?: ICommandContext) => void // 焦点在编辑器上时执行的回调 dockCallback?: (element: HTMLElement, context?: ICommandContext) => void // 焦点在 dock 上时执行的回调 } export interface IAgentCapabilityEffects { localRead?: boolean; localWrite?: boolean; dataEgress?: boolean; externalCost?: boolean; } export interface ICard { deckID: string; cardID: string; blockID: string; nextDues: Record; lapses: number; // 遗忘次数 lastReview: number; // 最后复习时间 reps: number; // 复习次数 state: number; // 卡片状态 0:新卡 } export interface ICardData { cards: ICard[], unreviewedCount: number unreviewedNewCardCount: number unreviewedOldCardCount: number } export function adaptHotkey(hotkey: string): string export function confirm(title: string, text: string, confirmCallback?: (dialog: Dialog) => void, cancelCallback?: (dialog: Dialog) => void): void; export type TEditorFontSizeAction = "increase" | "decrease" | "reset"; export interface IEditorFontSizeOptions { notify?: boolean; } export function adjustEditorFontSize(action: TEditorFontSizeAction, options?: IEditorFontSizeOptions): number; export function setEditorFontSize(fontSize: number, options?: IEditorFontSizeOptions): number; export function fetchPost( url: string, data?: any, cb?: (response: IWebSocketData) => void, headers?: IObject, failCallback?: (response: IWebSocketData) => void ): void; export function fetchSyncPost(url: string, data?: any): Promise; export function fetchGet(url: string, callback: (response: IWebSocketData) => void): void; export function openWindow(options: { position?: { x: number, y: number, }, height?: number, width?: number, tab?: Tab, alwaysOnTop?: boolean, doc?: { id: string; // 块 id }, }): void; /** * 不支持移动端 * @param {boolean} [wndActive=true] - 当前活动窗口是否为激活状态 */ export function getActiveTab(wndActive?: boolean): Tab; /** * @param {boolean} [wndActive=true] - 当前活动窗口是否为激活状态 */ export function getActiveEditor(wndActive?: boolean): Protyle; export function expandDocTree(options: { id: string, isSetCurrent?: boolean }): void; export function openMobileFileById(app: App, id: string, action?: TProtyleAction[]): void; /** * @param {string} [options.doc.mode="wysiwyg"] - 只在首次打开时生效,切换可调用 switchMode 方法 */ export function openTab(options: { app: App, doc?: { id: string, // 块 id action?: TProtyleAction[], zoomIn?: boolean, // 是否缩放 mode?: TEditorMode }; pdf?: { path: string, page?: number, // pdf 页码 id?: string, // File Annotation id }; asset?: { path: string, }; search?: Config.IUILayoutTabSearchConfig; card?: { type: TCardType, id?: string, // cardType 为 all 时不传,否则传文档或笔记本 id title?: string, // cardType 为 all 时不传,否则传文档或笔记本名称 }; custom?: { id: string, // 插件名称+页签类型:plugin.name + tab.type icon: string, title: string, data?: any, }; position?: "right" | "bottom"; keepCursor?: boolean; // 是否跳转到新 tab 上 removeCurrentTab?: boolean; // 在当前页签打开时需移除原有页签 openNewTab?: boolean // 使用新页签打开 afterOpen?: () => void; // 打开后回调 }): Promise export function getFrontend(): "desktop" | "desktop-window" | "mobile" | "browser-desktop" | "browser-mobile"; export function getBackend(): "windows" | "linux" | "darwin" | "docker" | "android" | "ios" | "harmony"; export function lockScreen(app: App): void export function exitSiYuan(): void export function getAllEditor(): Protyle[] export function saveExportFile(uri: string, msgId?: string): Promise; export function getAllTabs(type?: TTab | string): Tab[] export function getAllModels(): IModels export function openSetting(app: App): Dialog | undefined; export function openEmoji(options: { position: IPosition, selectedCB?: (emoji: string) => void, dynamicIconURL?: string hideDynamicIcon?: boolean hideCustomIcon?: boolean }): void ; export function getModelByDockType(type: TDock | string): Model | any; /** * 显示、隐藏或切换左侧停靠栏面板。移动端、独立窗口或布局尚未初始化时调用无操作并返回 false。 * @param {boolean} [visible] - 不传时切换显隐,传入时设置显隐 * @returns 该组是否有活动工具且未被整体收起;空组返回 false,浮动面板暂时未悬停显示仍返回 true */ export function toggleLeftDock(visible?: boolean): boolean; /** * 显示、隐藏或切换右侧停靠栏面板。移动端、独立窗口或布局尚未初始化时调用无操作并返回 false。 * @param {boolean} [visible] - 不传时切换显隐,传入时设置显隐 * @returns 该组是否有活动工具且未被整体收起;空组返回 false,浮动面板暂时未悬停显示仍返回 true */ export function toggleRightDock(visible?: boolean): boolean; /** * 显示、隐藏或切换下侧停靠栏面板。移动端、独立窗口或布局尚未初始化时调用无操作并返回 false。 * @param {boolean} [visible] - 不传时切换显隐,传入时设置显隐 * @returns 该组是否有活动工具且未被整体收起;空组返回 false,浮动面板暂时未悬停显示仍返回 true */ export function toggleBottomDock(visible?: boolean): boolean; /** * 移动端、独立窗口或布局尚未初始化时返回 false。 * @returns 左侧组是否有活动工具且未被整体收起;浮动面板暂时未悬停显示仍返回 true */ export function isLeftDockVisible(): boolean; /** * 移动端、独立窗口或布局尚未初始化时返回 false。 * @returns 右侧组是否有活动工具且未被整体收起;浮动面板暂时未悬停显示仍返回 true */ export function isRightDockVisible(): boolean; /** * 移动端、独立窗口或布局尚未初始化时返回 false。 * @returns 下侧组是否有活动工具且未被整体收起;浮动面板暂时未悬停显示仍返回 true */ export function isBottomDockVisible(): boolean; /** * @param {IObject} [options.data] - 块属性值 * @param {HTMLElement} [options.nodeElement] - 块元素 * @param {"bookmark" | "name" | "alias" | "memo" | "av" | "custom"} [options.focusName="bookmark"] - av 为数据库页签,custom 为自定义页签,其余为内置输入框 * @param {IProtyle} [options.protyle] - 有数据库时需要传入 protyle */ export function openAttributePanel(options: { data?: IObject nodeElement?: HTMLElement, focusName: "bookmark" | "name" | "alias" | "memo" | "av" | "custom", protyle?: IProtyle, }): void; /** * 保存布局 * @param {function} [cb] - 保存后的回调函数 */ export function saveLayout(cb: () => void): void; /** * 全局命令 * @param {string} command - 命令名称 https://github.com/siyuan-note/siyuan/blob/master/app/src/boot/globalEvent/command/global.ts#L71 * @param {App} app */ export function globalCommand(command: string, app: App): void; /** * @param {number} [timeout=6000] - ms. 0: manual close;-1: always show; * @param {string} [type=info] */ export function showMessage(text: string, timeout?: number, type?: "info" | "error", id?: string): void; export function hideMessage(id?: string): void; /** * 前端插件生命周期契约。 * * 同一插件实例的 `onload`、`onLayoutReady`、`onDataChanged`、`onunload` 与 `uninstall` 在拆除截止时间前严格串行, * 并等待钩子返回的 Promise。`onDataChanged` 仅在插件实例就绪后运行;若插件未覆盖基类实现,数据变更会改为重载整个插件。 * 禁用、重载或卸载会在首次收到拆除请求时建立一份共享的 5 秒预算。等待 `onload`、内核初始化、`onLayoutReady` 或已经开始的 * `onDataChanged`,以及后续的 `onunload` 和仅在从工作空间移除插件时运行的 `uninstall`,均使用同一份预算。尚未开始的 * `onDataChanged` 会在禁用或卸载时丢弃。 * * 截止时间后,JavaScript Promise 无法取消,超时钩子可能继续运行。思源仍会尽力调用每个剩余的拆除钩子一次,但不再等待, * 随后拆除宿主管理的资源。这 5 秒只限制思源等待 Promise 的时间,无法中断同步 JavaScript。关闭窗口或退出思源时, * 该操作不会触发前端插件生命周期钩子。 */ export abstract class Plugin { eventBus: EventBus; i18n: Record; kernel: IKernelPlugin; data: any; displayName: string; readonly name: string; app: App; commands: ICommand[]; setting: Setting; /** * 自定义块渲染器。键为插件内部的块类型;块信息使用编码后的插件包名和块类型组成。 * 渲染函数只应修改传入的挂载元素,并可返回清理函数,不支持在其中嵌套 Protyle。 * setContent 应在渲染函数返回后调用;只读状态或内容中某行移除编辑器光标标记并去除首尾空白后等于 ;;; 时返回 false。 */ customBlockRenders: { [key: string]: { render: (options: { element: HTMLElement, content: string, setContent: (content: string) => boolean, }) => void | (() => void) } }; topBarIcons: Element[]; statusBarIcons: Element[]; agentActions: string[]; models: { [key: string]: (options: { tab: Tab, data: any }) => Custom }; docks: { [key: string]: { id: string, config: IPluginDockTab, model?: (options: { tab: Tab }) => Custom, mobileModel?: (element: Element) => MobileCustom } }; protyleSlash: { filter: string[], html: string, id: string, callback(protyle: Protyle, nodeElement: HTMLElement): void, }[]; protyleOptions: IProtyleOptions; constructor(options: { app: App, name: string, displayName: string, i18n: Record, }); /** 当前端插件实例启动时运行。 */ onload(): Promise | void; /** * 插件实例就绪后收到数据变更时运行;思源会等待返回的 Promise,未覆盖该方法时则重载整个插件。 * @param reason 数据变更来源,sync 为跨设备同步合并,overwrite 为其他前端实例通过文件接口写入 */ onDataChanged(reason?: TPluginDataChangeReason): Promise | void; /** 当前端插件实例被禁用、重载或卸载前运行一次。 */ onunload(): Promise | void; /** * 仅在从工作空间移除插件时,于 `onunload` 完成或思源停止等待后运行一次。 */ uninstall(): Promise | void; /** 布局就绪时,在 `onload` 与内核初始化完成后运行一次。 */ onLayoutReady(): Promise | void; /** * Must be executed before the synchronous function. * @param {string} [options.id] - Unique ID within the plugin. * @param {string} [options.position=right] * @param {string} options.icon - Support svg id or svg tag. */ addTopBar(options: { id?: string, icon: string, title: string, callback: (event: MouseEvent) => void position?: "right" | "left" }): HTMLElement; removeTopBar(id: string): void; addBreadcrumbButton(options: { id: string, icon: string, title: string, callback: (event: MouseEvent, protyle: IProtyle) => void, }): string; removeBreadcrumbButton(id: string): void; /** * Must be executed before the synchronous function. * @param {string} [options.position=right] */ addStatusBar(options: { element: HTMLElement, position?: "right" | "left", }): HTMLElement; openSetting(): void; loadData(storageName: string): Promise; saveData(storageName: string, content: any): Promise; removeData(storageName: string): Promise; addIcons(svg: string): void; getOpenedTab(): { [key: string]: Custom[] }; /** * Must be executed before the synchronous function. */ addTab(options: { type: string, destroy?: (this: Custom) => void, beforeDestroy?: (this: Custom) => void, resize?: (this: Custom) => void, update?: (this: Custom) => void, init: (this: Custom, custom: Custom) => void, }): (options: { tab: Tab, data: any }) => Custom; /** * Add Custom to Dock. * Must be executed before the synchronous function. * @param {string} [options.id] - Unique ID within the plugin. Defaults to options.type. */ addDock(options: { id?: string, config: IPluginDockTab, data: any, type: string, destroy?: (this: Custom | MobileCustom) => void, resize?: (this: Custom) => void, update?: (this: Custom | MobileCustom) => void, init: (this: Custom | MobileCustom, custom: Custom | MobileCustom) => void, }): { id: string, config: IPluginDockTab, model?: (options: { tab: Tab }) => Custom, mobileModel?: (element: Element) => MobileCustom }; removeDock(id: string): void; addCommand(options: ICommand): void; /** * 动态添加或更新编辑器工具栏按钮。name 必须是插件内稳定且唯一的自定义标识,不能使用内置工具栏名称或分隔符。 * 同名按钮会被更新,并保留用户已经配置的快捷键。 */ addToolbarItem(item: IMenuItem): void; /** * 移除动态注册的编辑器工具栏按钮,并保留其快捷键和入口配置。 */ removeToolbarItem(name: string): void; /** * 按名称取密钥值(来自「设置 → 密钥和变量」的密钥库)。找不到时返回空字符串。 * 密钥在内核侧加密存储,此处读到的是运行时明文;仅在本地管理员身份下可用。 */ getSecret(name: string): string; /** * 按名称取变量值(来自「设置 → 密钥和变量」的变量库)。找不到时返回空字符串。 * 变量以明文存储,用于非敏感配置。 */ getVariable(name: string): string; addAgentCapability(options: { name: string, title?: string, description: string, inputSchema: Record, outputSchema?: Record, effects?: IAgentCapabilityEffects, actionEffects?: Record, handler: (args: Record, app: App) => Promise<{ result?: string; structuredContent?: unknown; error?: string; }>, }): string; addFloatLayer(options: { refDefs: IRefDefs[], x?: number, y?: number, targetElement?: HTMLElement, originalRefBlockIDs?: IObject, isBacklink: boolean, }): void; updateCards(options: ICardData): Promise; updateProtyleToolbar(toolbar: Array): Array; } export class Setting { constructor(options: { height?: string, width?: string, destroyCallback?: () => void, confirmCallback?: () => void, }); addItem(options: { title: string, direction?: "column" | "row" description?: string, actionElement?: HTMLElement, createActionElement?(): HTMLElement, }): void; open(name: string): void; } export class EventBus { on< K extends TEventBus, D = IEventBusMap[K], >(type: K, listener: (event: CustomEvent) => any): void; once< K extends TEventBus, D = IEventBusMap[K], >(type: K, listener: (event: CustomEvent) => any): void; off< K extends TEventBus, D = IEventBusMap[K], >(type: K, listener: (event: CustomEvent) => any): void; emit< K extends TEventBus, D = IEventBusMap[K], >(type: K, detail?: D): boolean; } export class Dialog { element: HTMLElement; editors: { [key: string]: Protyle }; data: any; constructor(options: { positionId?: string, title?: string, transparent?: boolean, content: string, width?: string, height?: string, destroyCallback?: (options?: IObject) => void, disableClose?: boolean, hideCloseIcon?: boolean, disableAnimation?: boolean, resizeCallback?: (type: string) => void }); destroy(options?: IObject): void; bindInput(inputElement: HTMLInputElement | HTMLTextAreaElement, enterEvent?: () => void): void; } export class Menu { private menu; isOpen: boolean; element: HTMLElement; constructor(id?: string, closeCB?: () => void); showSubMenu(subMenuElement: HTMLElement): void; addItem(option: IMenu): HTMLElement; addSeparator(options?: { index?: number, id?: string, ignore?: boolean }): HTMLElement; open(options: IPosition): void; /** * @param {string} [position=all] */ fullscreen(position?: "bottom" | "all"): void; close(): void; }