Skip to content

Commit 4d0ad6a

Browse files
author
ntwigg
committed
Add a mock Overtype while we wait to merge.
1 parent bdd4662 commit 4d0ad6a

File tree

1 file changed

+44
-0
lines changed

1 file changed

+44
-0
lines changed
Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
/**
2+
* Mock implementation of Overtype for development
3+
* This wraps a textarea and provides a minimal interface
4+
*/
5+
export class OverType {
6+
public element: HTMLTextAreaElement
7+
public instanceId: number
8+
public initialized: boolean = true
9+
10+
private static instanceCount = 0
11+
12+
constructor(target: HTMLTextAreaElement) {
13+
this.element = target
14+
this.instanceId = ++OverType.instanceCount
15+
16+
// Store reference on the element
17+
;(target as any).overTypeInstance = this
18+
19+
// Apply basic styling or enhancement
20+
this.enhance()
21+
}
22+
23+
private enhance(): void {
24+
// Mock enhancement - could add basic styling, event handlers, etc.
25+
this.element.style.fontFamily =
26+
'Monaco, "Cascadia Code", "Roboto Mono", Consolas, "Courier New", monospace'
27+
this.element.style.fontSize = '14px'
28+
this.element.style.lineHeight = '1.5'
29+
}
30+
31+
getValue(): string {
32+
return this.element.value
33+
}
34+
35+
setValue(value: string): void {
36+
this.element.value = value
37+
}
38+
39+
destroy(): void {
40+
// Clean up any enhancements
41+
delete (this.element as any).overTypeInstance
42+
this.initialized = false
43+
}
44+
}

0 commit comments

Comments
 (0)