/
githubmirror
/
taro
Обзор
Документация
Войти
/
githubmirror
/
taro
Код
Запросы
0
Пакеты
0
Релизы
0
Аналитика
Безопасность
main
packages/taro-platform-harmony-cpp/src/runtime/runtime-cpp/bom/window.ts
57 строк
1 KB
ZakaryCode
fix(harmony): update cpp plugin
08 май 2025, 17:24
08 май 2025, 17:24
3d682fa
Код
Авторство
О чём код?
import _display from '@ohos.display' import ohosWindow from '@ohos.window' import { TaroEventTarget } from '../dom/eventTarget' import { History } from './history' import { Location } from './location' import { navigator as nav } from './navigator' import type { TaroDocument } from '../dom/document' import type { TaroElement } from '../dom/element/element' export class Window extends TaroEventTarget { public _doc: TaroDocument public __taroAppConfig: any public __ohos = ohosWindow public __oh_display: typeof _display public location: any public history: any public navigator = nav constructor () { super() this.location = new Location({ window: this }) this.history = new History(this.location, { window: this }) this.__oh_display = _display.getDefaultDisplaySync() } get document (): TaroDocument { return this._doc } get devicePixelRatio () { return this.__oh_display.densityPixels } get getComputedStyle () { return this.document.getComputedStyle } setTimeout (...args: Parameters<typeof setTimeout>) { setTimeout(...args) } clearTimeout (...args: Parameters<typeof clearTimeout>) { clearTimeout(...args) } } export const getComputedStyle = (element: TaroElement) => { return element.getComputedStyle() } export const window = new Window() export const location = window.location export const history = window.history