Skip to content
This repository was archived by the owner on Jul 6, 2025. It is now read-only.

Commit 9348d76

Browse files
committed
Update typings
1 parent 71e3258 commit 9348d76

File tree

1 file changed

+7
-10
lines changed

1 file changed

+7
-10
lines changed

framework/core/nomodule.ts

Lines changed: 7 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,9 @@
1-
(function (document: any) {
1+
/// <reference lib="dom" />
2+
(function (document: Document) {
23
var contarinEl = document.createElement('div')
34
var hEl = document.createElement('h2')
45
var pEl = document.createElement('p')
5-
var style: Record<string, string> = {
6+
var style: Partial<CSSStyleDeclaration> = {
67
position: 'fixed',
78
top: '0',
89
left: '0',
@@ -17,25 +18,21 @@
1718
textAlign: 'center',
1819
boxShadow: '0 1px 5px rgba(0,0,0,0.1)'
1920
}
20-
var hStyle: Record<string, string> = {
21+
var hStyle: Partial<CSSStyleDeclaration> = {
2122
padding: '0',
2223
margin: '0',
2324
lineHeight: '1.2',
2425
fontSize: '24px',
2526
fontWeight: '700',
2627
color: '#000',
2728
}
28-
for (var key in style) {
29-
contarinEl.style[key] = style[key]
30-
}
31-
for (var key in hStyle) {
32-
hEl[key] = hStyle[key]
33-
}
29+
Object.assign(contarinEl.style, style)
30+
Object.assign(hEl.style, hStyle)
3431
// todo: i18n
3532
// todo: add browser info
3633
hEl.innerText = 'Your browser is out of date.'
3734
pEl.innerHTML = 'Aleph.js requires <a href="https://caniuse.com/es6-module" style="font-weight:500;color:#000;">ES module</a> support during development.'
3835
contarinEl.appendChild(hEl)
3936
contarinEl.appendChild(pEl)
4037
document.body.appendChild(contarinEl)
41-
})((window as any).document)
38+
})(window.document)

0 commit comments

Comments
 (0)