domelementtype

Introduction

domelementtype is a utility library that defines all types of DOM nodes in the htmlparser2 library.

How to Install

ohpm install domelementtype 

For details about the OpenHarmony ohpm environment configuration, see OpenHarmony HAR.

How to Use

  1. Import files and code dependencies.

     import { ElementType, isTag } from 'domelementtype'
    
  2. Define enum classes.

       ElementType.Text
       ElementType.Comment
       ElementType.Directive
       ElementType.CDATA
       ...
       isTag({ type:ElementType.Text})
    

Available APIs

Checks whether a node is a tag.

isTag(elem: { type: ElementType; }): boolean

Constraints

This project has been verified in the following version:

  • DevEco Studio Version: 4.1 Canary (4.1.3.317), OpenHarmony SDK: API 11 (4.1.0.36)

  • DevEco Studio Version��DevEco Studio 5.1.0 Canary1(5.1.0.229)��OpenHarmony SDK:5.1.0.229 API16��5.1.0.46����

Directory Structure

|---- domelementtype
|     |---- entry  # Sample code
|           |---- src
|                 |---- ohosTest
|                       |---- ets
|                             |---- test
|                                   |---- Ability.test.ets  # Unit test
|     |---- README.md  # Readme
|     |---- README_zh.md  # Readme
|     |---- README.OpenSource  # Open source description
|     |---- CHANGELOG.md  # Changelog                 

How to Contribute

If you find any problem when using domelementtype, submit an issue or a PR.

License

This project is licensed under BSD License.