Skip to content

Commit

Permalink
Extract AbstractEngineManager into .d.mts file
Browse files Browse the repository at this point in the history
  • Loading branch information
ator-dev committed Sep 9, 2024
1 parent 420d52c commit df12bbf
Show file tree
Hide file tree
Showing 3 changed files with 31 additions and 20 deletions.
5 changes: 3 additions & 2 deletions src/content.mts
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,9 @@ import type * as Message from "/dist/modules/messaging.d.mjs";
import { sendBackgroundMessage } from "/dist/modules/messaging/background.mjs";
import { type MatchMode, MatchTerm, termEquals, TermTokens, TermPatterns } from "/dist/modules/match-term.mjs";
import { EleID } from "/dist/modules/common.mjs";
import { type AbstractEngineManager, EngineManager } from "/dist/modules/highlight/engine-manager.mjs";
import { type AbstractToolbar, type ControlButtonName } from "/dist/modules/interface/toolbar.d.mjs";
import type { AbstractEngineManager } from "/dist/modules/highlight/engine-manager.d.mjs";
import { EngineManager } from "/dist/modules/highlight/engine-manager.mjs";
import type { AbstractToolbar, ControlButtonName } from "/dist/modules/interface/toolbar.d.mjs";
import { Toolbar } from "/dist/modules/interface/toolbar.mjs";
import { assert, itemsMatch } from "/dist/modules/common.mjs";

Expand Down
27 changes: 27 additions & 0 deletions src/modules/highlight/engine-manager.d.mts
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
/*
* This file is part of Mark My Search.
* Copyright © 2021-present ‘ator-dev’, Mark My Search contributors.
* Licensed under the EUPL-1.2-or-later.
*/

import type { HighlighterCounterInterface, HighlighterWalkerInterface } from "/dist/modules/highlight/model.d.mjs";
import type { Highlighter } from "/dist/modules/highlight/engine.d.mjs";
import type { Engine, PaintEngineMethod } from "/dist/modules/common.mjs";

interface AbstractEngineManager extends Highlighter, HighlighterCounterInterface, HighlighterWalkerInterface {
readonly setEngine: (preference: Engine) => Promise<void>

readonly applyEngine: () => void

readonly removeEngine: () => void

readonly signalPaintEngineMethod: (preference: PaintEngineMethod) => void

readonly applyPaintEngineMethod: (preference: PaintEngineMethod) => Promise<void>

readonly setSpecialEngine: () => Promise<void>

readonly removeSpecialEngine: () => void
}

export type { AbstractEngineManager };
19 changes: 1 addition & 18 deletions src/modules/highlight/engine-manager.mts
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,7 @@
* Licensed under the EUPL-1.2-or-later.
*/

import type { HighlighterCounterInterface, HighlighterWalkerInterface } from "/dist/modules/highlight/model.d.mjs";
import type { Highlighter } from "/dist/modules/highlight/engine.d.mjs";
import type { AbstractEngineManager } from "/dist/modules/highlight/engine-manager.d.mjs";
import type { AbstractSpecialEngine } from "/dist/modules/highlight/special-engine.d.mjs";
import type { AbstractTermCounter } from "/dist/modules/highlight/tools/term-counter.d.mjs";
import type { AbstractTermWalker } from "/dist/modules/highlight/tools/term-walker.d.mjs";
Expand All @@ -18,22 +17,6 @@ import type { MatchTerm, TermTokens, TermPatterns } from "/dist/modules/match-te
import { requestCallFn } from "/dist/modules/call-requester.mjs";
import { compatibility } from "/dist/modules/common.mjs";

interface AbstractEngineManager extends Highlighter, HighlighterCounterInterface, HighlighterWalkerInterface {
readonly setEngine: (preference: Engine) => Promise<void>

readonly applyEngine: () => void

readonly removeEngine: () => void

readonly signalPaintEngineMethod: (preference: PaintEngineMethod) => void

readonly applyPaintEngineMethod: (preference: PaintEngineMethod) => Promise<void>

readonly setSpecialEngine: () => Promise<void>

readonly removeSpecialEngine: () => void
}

type EngineData = Readonly<{
engine: AbstractTreeEditEngine | AbstractTreeCacheEngine
termCounter?: AbstractTermCounter
Expand Down

0 comments on commit df12bbf

Please sign in to comment.