Command for selecting a result from manual search.
export class SelectSearchMatchCommand extends BaseCommand { constructor( matchIndex: number, beforeState: MangaMatchResult, afterState: MangaMatchResult, onExecute: OnExecuteCallback, ) { super( matchIndex, beforeState, afterState, onExecute, CommandType.SELECT_SEARCH_MATCH, `Select manual search result for "${beforeState.kenmeiManga.title}"`, ); }} Copy
export class SelectSearchMatchCommand extends BaseCommand { constructor( matchIndex: number, beforeState: MangaMatchResult, afterState: MangaMatchResult, onExecute: OnExecuteCallback, ) { super( matchIndex, beforeState, afterState, onExecute, CommandType.SELECT_SEARCH_MATCH, `Select manual search result for "${beforeState.kenmeiManga.title}"`, ); }}
Execute the command (apply "after" state).
execute(): void { this.onExecute(this.afterState); } Copy
execute(): void { this.onExecute(this.afterState); }
Undo the command (restore "before" state).
undo(): void { this.onExecute(this.beforeState); } Copy
undo(): void { this.onExecute(this.beforeState); }
Get user-friendly description of what this command does.
getDescription(): string { return this.metadata.description; } Copy
getDescription(): string { return this.metadata.description; }
Get metadata about this command.
getMetadata(): CommandMetadata { return this.metadata; } Copy
getMetadata(): CommandMetadata { return this.metadata; }
Command for selecting a result from manual search.
Source