Skip to content

Commit a998992

Browse files
author
Paavan Bhavsar
committed
Add typing for Global type to include sessionStorage
1 parent d3f278a commit a998992

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

globals.d.ts

+9
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
declare namespace NodeJS {
2+
// By default, Typescript does not have sessionStorage on the Global type. We add it here.
3+
interface Global {
4+
sessionStorage: {
5+
getItem: (key: string) => string
6+
setItem: (key: string, value: string) => void
7+
}
8+
}
9+
}

0 commit comments

Comments
 (0)