-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathenhancer.ts
More file actions
26 lines (23 loc) · 837 Bytes
/
enhancer.ts
File metadata and controls
26 lines (23 loc) · 837 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
import type { OverTypeInstance } from '../overtype/overtype'
/**
* stores enough info about the location of a draft to:
* - display it in a table
* - reopen the draft in-context
*/
export interface CommentSpot {
unique_key: string
type: string
}
/** wraps the textareas of a given platform with Gitcasso's enhancements */
export interface CommentEnhancer<Spot extends CommentSpot = CommentSpot> {
/** guarantees to only return a type within this list */
forSpotTypes(): string[]
/**
* whenever a new `textarea` is added to any webpage, this method is called.
* if we return non-null, then we become the handler for that text area.
*/
tryToEnhance(textarea: HTMLTextAreaElement): [OverTypeInstance, Spot] | null
tableIcon(spot: Spot): string
tableTitle(spot: Spot): string
buildUrl(spot: Spot): string
}