内置对象
let b: Boolean = new Boolean(1)console.log(b)let n: Number = new Number(true)console.log(n)let s: String = new String('cqs')console.log(s)let d: Date = new Date()console.log(d)let r: RegExp = /^1/console.log(r)let e: Error = new Error("error!")console.log(e)let xhr: XMLHttpRequest = new XMLHttpRequest();
。。。
dom对象
//dom Element HTML(元素名称,例如:Div)Element HTMLElementlet div = document.querySelector('div');let divList: NodeList = document.querySelectorAll('div');divList.forEach(item => {})
多个dom类型
let divLists: NodeListOf<HTMLDivElement | HTMLElement> = document.querySelectorAll('div input')
其他类型。。
let local: Storage = localStoragelet lo: Location = locationlet promise: Promise<string> = new Promise(r => r(''))