File tree Expand file tree Collapse file tree 1 file changed +37
-0
lines changed Expand file tree Collapse file tree 1 file changed +37
-0
lines changed Original file line number Diff line number Diff line change @@ -50,3 +50,40 @@ export interface CommentEnhancer<Spot extends CommentSpot = CommentSpot> {
5050 /** The default title of a row */
5151 tableTitle ( spot : Spot ) : string
5252}
53+
54+ /**
55+ * Special sentinel value for unique_key indicating that draft history
56+ * should not be stored for this spot. Spots with this unique_key will:
57+ * - Still be enhanced with OverType
58+ * - NOT be stored in the background service's openSpots map
59+ * - NOT appear in the popup table
60+ */
61+ export const DRAFT_STORAGE_UNSUPPORTED = "DRAFT_STORAGE_UNSUPPORTED" as const
62+
63+ /**
64+ * Abstract base class for enhancers that return spots with DRAFT_STORAGE_UNSUPPORTED.
65+ * Table methods throw exceptions since such spots won't appear in the table.
66+ */
67+ export abstract class CommentEnhancerNoDraftHistory <
68+ Spot extends CommentSpot = CommentSpot ,
69+ > implements CommentEnhancer < Spot >
70+ {
71+ abstract forSpotTypes ( ) : string [ ]
72+ abstract tryToEnhance (
73+ textarea : HTMLTextAreaElement ,
74+ location : StrippedLocation
75+ ) : Spot | null
76+ abstract enhance ( textarea : HTMLTextAreaElement , spot : Spot ) : OverTypeInstance
77+
78+ tableUpperDecoration ( _spot : Spot ) : never {
79+ throw new Error (
80+ "tableUpperDecoration should not be called for DRAFT_STORAGE_UNSUPPORTED spots"
81+ )
82+ }
83+
84+ tableTitle ( _spot : Spot ) : never {
85+ throw new Error (
86+ "tableTitle should not be called for DRAFT_STORAGE_UNSUPPORTED spots"
87+ )
88+ }
89+ }
You can’t perform that action at this time.
0 commit comments