Launch Week Day 1: Socket for Jira Is Now Available.Learn More
Socket
Book a DemoSign in
Socket

@dlenroc/roku-dom

Package Overview
Dependencies
Maintainers
1
Versions
8
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install
Package was removed
Sorry, it seems this package was removed from the registry

@dlenroc/roku-dom

DOM-like representation of the channel

latest
Source
npmnpm
Version
2.0.1
Version published
Maintainers
1
Created
Source

@dlenroc/roku-dom · NPM Version

DOM-like representation of the app-ui

Installation

npm install @dlenroc/roku-dom

Usage

⚠️ render() must be called for synchronizing DOM with application state

import { Document } from '@dlenroc/roku-dom';
import { ECPExecutor } from '@dlenroc/roku-ecp';
import { ODCExecutor } from '@dlenroc/roku-odc';

const document = new Document({
  ecp: new ECPExecutor({ address: 'http://<ip>:8060' }),
  odc: new ODCExecutor({ address: 'http://<ip>:8061' }),
});

// Sync DOM
await document.render();
const element = document.cssSelect('[text="Play"]');
console.log(element?.isFocused);

Document

Everything from Element

get context(): 'ECP' | 'ODC'
set context(context: 'ECP' | 'ODC')
get fields(): Record<string, string[]>
set fields(fields: Record<string, string[]>)
get focusedElement(): Element
get isKeyboardShown(): boolean
render(): Promise<void>

Element

get sdk(): SDK
get document(): Document
get parent(): Element | null
get parents(): Element[]
get siblings(): Element[]
get prev(): Element | null
get next(): Element | null
get children(): Element[]
get tag(): string
get path(): string
get index(): number
get attributes(): Record<string, string>
get text(): string
get bounds(): Rect | null
get isConnected(): boolean
get isFocused(): boolean
get isInFocusChain(): boolean
get isDisplayed(): boolean
isSameNode(element: Element): boolean
clear(): Promise<void>
type(text: string): Promise<void>
append(text: string): Promise<void>
select(): Promise<void>
focus(): Promise<void>
cssSelect(css: string): Element | null
cssSelect(css: string, timeoutInSeconds: number): Promise<Element | null>
cssSelectAll(css: string): Element[]
cssSelectAll(css: string, timeoutInSeconds: number): Promise<Element[]>
xpathSelect(xpath: string): Element | null
xpathSelect(xpath: string, timeoutInSeconds: number): Promise<Element | null>
xpathSelectAll(xpath: string): Element[]
xpathSelectAll(xpath: string, timeoutInSeconds: number): Promise<Element[]>
toString(): string

Keywords

roku

FAQs

Package last updated on 12 Jan 2024

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts