Skip to content

Commit 84a053e

Browse files
muandgraham
andauthored
Apply suggestions from code review
Co-authored-by: David Graham <[email protected]>
1 parent 4e425ff commit 84a053e

File tree

2 files changed

+6
-6
lines changed

2 files changed

+6
-6
lines changed

src/index.ts

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -50,11 +50,11 @@ export default class IncludeFragmentElement extends HTMLElement {
5050
this._attached = false
5151
}
5252

53-
static get observedAttributes() {
53+
static get observedAttributes(): string[] {
5454
return ['src']
5555
}
5656

57-
get src() {
57+
get src(): string {
5858
const src = this.getAttribute('src')
5959
if (src) {
6060
const link = this.ownerDocument!.createElement('a')
@@ -69,19 +69,19 @@ export default class IncludeFragmentElement extends HTMLElement {
6969
this.setAttribute('src', val)
7070
}
7171

72-
get accept() {
72+
get accept(): string {
7373
return this.getAttribute('accept') || ''
7474
}
7575

7676
set accept(val: string) {
7777
this.setAttribute('accept', val)
7878
}
7979

80-
get data() {
80+
get data(): Promise<string> {
8181
return getData(this)
8282
}
8383

84-
attributeChangedCallback(attribute: string) {
84+
attributeChangedCallback(attribute: string): void {
8585
if (attribute === 'src') {
8686
// Source changed after attached so replace element.
8787
if (this._attached) {

tsconfig.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"compilerOptions": {
3-
"module": "esnext",
3+
"module": "es2020",
44
"target": "es2017",
55
"strict": true,
66
"declaration": true,

0 commit comments

Comments
 (0)