How do I use Constants in uxp?

As stated in the title。

  require('photoshop').app.activeDocument.layers.forEach((layer) => {
    console.log(layer)
    if (layer.kind === LayerKind.TEXT) {
      console.log('文本图层')
    }
  })

But an error is reported

Uncaught ReferenceError: LayerKind is not defined

What did I miss?
Thank you~

import {constants} from "photoshop"
// OR
// const constants = require("photoshop").constants

console.log(constants.LayerKind.TEXT)
1 Like

Ok~I think I got the right answer。
Thank you very much for your help.