Pop-up dictionary browser extension for language learning. Successor to Yomichan. (PERSONAL FORK)
1/*
2 * Copyright (C) 2023-2025 Yomitan Authors
3 *
4 * This program is free software: you can redistribute it and/or modify
5 * it under the terms of the GNU General Public License as published by
6 * the Free Software Foundation, either version 3 of the License, or
7 * (at your option) any later version.
8 *
9 * This program is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 * GNU General Public License for more details.
13 *
14 * You should have received a copy of the GNU General Public License
15 * along with this program. If not, see <https://www.gnu.org/licenses/>.
16 */
17
18import type {PopupFactory} from '../../ext/js/app/popup-factory';
19import type {HotkeyHandler} from '../../ext/js/input/hotkey-handler';
20import type {Application} from '../../ext/js/application';
21
22/** Details about how to set up the instance. */
23export type ConstructorDetails = {
24 /** The main application instance. */
25 application: Application;
26 /** The type of page, one of 'web', 'popup', or 'search'. */
27 pageType: PageType;
28 /** A PopupFactory instance to use for generating popups. */
29 popupFactory: PopupFactory;
30 /** The nesting depth value of the popup. */
31 depth: number;
32 /** The popup ID of the parent popup if one exists, otherwise null. */
33 parentPopupId: string | null;
34 /** The frame ID of the parent popup if one exists, otherwise null. */
35 parentFrameId: number | null;
36 /** Whether or not proxy popups should be used. */
37 useProxyPopup: boolean;
38 /** Whether or not window popups can be used. */
39 canUseWindowPopup: boolean;
40 /** Whether or not popups can be hosted in the root frame. */
41 allowRootFramePopupProxy: boolean;
42 /** Whether popups can create child popups or not. */
43 childrenSupported: boolean;
44 /** A HotkeyHandler instance. */
45 hotkeyHandler: HotkeyHandler;
46};
47
48export type PageType = 'web' | 'popup' | 'search';