Skip to content

Commit 4ca0261

Browse files
author
ntwigg
committed
Remove unnecessary base class.
1 parent 0161e0b commit 4ca0261

File tree

3 files changed

+4
-25
lines changed

3 files changed

+4
-25
lines changed

browser-extension/src/datamodel/textarea-handler.ts

Lines changed: 0 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -25,18 +25,3 @@ export interface TextareaHandler<T extends CommentContext = CommentContext> {
2525
buildUrl(context: T, withDraft?: boolean): string;
2626
}
2727

28-
export abstract class BaseTextareaHandler<T extends CommentContext = CommentContext> implements TextareaHandler<T> {
29-
protected domain: string;
30-
31-
constructor(domain: string) {
32-
this.domain = domain;
33-
}
34-
35-
abstract forCommentTypes(): string[];
36-
abstract identifyContextOf(textarea: HTMLTextAreaElement): TextareaInfo<T> | null;
37-
abstract extractContext(textarea: HTMLTextAreaElement): T | null;
38-
abstract determineType(textarea: HTMLTextAreaElement): string | null;
39-
abstract generateDisplayTitle(context: T): string;
40-
abstract generateIcon(type: string): string;
41-
abstract buildUrl(context: T, withDraft?: boolean): string;
42-
}

browser-extension/src/handlers/github-handler.ts

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { CommentContext, BaseTextareaHandler, TextareaInfo } from '../datamodel/textarea-handler';
1+
import { CommentContext, TextareaHandler, TextareaInfo } from '../datamodel/textarea-handler';
22

33
export type GitHubCommentType =
44
| 'GH_ISSUE_NEW'
@@ -16,10 +16,7 @@ export interface GitHubContext extends CommentContext {
1616
commentId?: string | undefined; // for editing existing comments
1717
}
1818

19-
export class GitHubHandler extends BaseTextareaHandler<GitHubContext> {
20-
constructor() {
21-
super('github.com');
22-
}
19+
export class GitHubHandler implements TextareaHandler<GitHubContext> {
2320

2421
forCommentTypes(): string[] {
2522
return [

browser-extension/src/handlers/reddit-handler.ts

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { CommentContext, BaseTextareaHandler, TextareaInfo } from '../datamodel/textarea-handler';
1+
import { CommentContext, TextareaHandler, TextareaInfo } from '../datamodel/textarea-handler';
22

33
export type RedditCommentType =
44
| 'REDDIT_POST_NEW'
@@ -11,10 +11,7 @@ export interface RedditContext extends CommentContext {
1111
commentId?: string | undefined; // for editing existing comments
1212
}
1313

14-
export class RedditHandler extends BaseTextareaHandler<RedditContext> {
15-
constructor() {
16-
super('reddit.com');
17-
}
14+
export class RedditHandler implements TextareaHandler<RedditContext> {
1815

1916
forCommentTypes(): string[] {
2017
return [

0 commit comments

Comments
 (0)