Options
All
  • Public
  • Public/Protected
  • All
Menu

External module properties

Introduction

The properties you define in the package.json file can be accessed with the piweb.properties module. To enable type checking, there is one function for each available datatype.

Definition of a property in the package.json file:

{
    "name": "myplot",
     ...
    "piweb_extension": {
         ...
        "propertygrid": {
            "categories": {
                "general": {
                    "name": "General",
                    "priority": 0
                }
            },
            "entries": {
                "myproperty": {
                    "name": "Do it right",
                    "description": "Determines whether to do it right",
                    "type": "boolean",
                    "default_value": false,
                    "category": "general"
                }
         }
        }
    }
}

For a complete reference of the package format, including the definition of properties, please read the chapter 'package definition'.


Access the property in your script:

import * as piweb from 'piweb';
import properties = piweb.properties;

properties.getBooleanProperty('myPropertyName')
see

package definition

Index

Variables

Private provider

provider: any = require.binding('PropertiesProvider')

Functions

getBooleanProperty

  • getBooleanProperty(id: string): boolean
  • Returns the value of the property with the name id as a boolean.

    host

    Parameters

    • id: string

      The name of the property.

    Returns boolean

getBrushProperty

  • getBrushProperty(id: string): Brush
  • Returns the value of the property with the name id as a brush.

    host

    Parameters

    • id: string

      The name of the property.

    Returns Brush

getColorProperty

  • getColorProperty(id: string): Color
  • Returns the value of the property with the name id as a color.

    host

    Parameters

    • id: string

      The name of the property.

    Returns Color

getColorSchemeProperty

  • getColorSchemeProperty(id: string): Color[]
  • Returns the value of the property with the name id as an array of colors.

    host

    Parameters

    • id: string

      The name of the property.

    Returns Color[]

getDoubleProperty

  • getDoubleProperty(id: string): number
  • Returns the value of the property with the name id as a floating point number.

    host

    Parameters

    • id: string

      The name of the property.

    Returns number

getEnumProperty

  • getEnumProperty(id: string): string
  • Returns the value of the property with the name id as an enumerated string.

    host

    Parameters

    • id: string

      The name of the property.

    Returns string

getFontProperty

  • getFontProperty(id: string): Font
  • Returns the value of the property with the name id as a font.

    host

    Parameters

    • id: string

      The name of the property.

    Returns Font

getIntegerProperty

  • getIntegerProperty(id: string): number
  • Returns the value of the property with the name id as an integral number.

    host

    Parameters

    • id: string

      The name of the property.

    Returns number

getPenProperty

  • getPenProperty(id: string): Pen
  • Returns the value of the property with the name id as a pen.

    host

    Parameters

    • id: string

      The name of the property.

    Returns Pen

getStringProperty

  • getStringProperty(id: string): string
  • Returns the value of the property with the name id as a string.

    host

    Parameters

    • id: string

      The name of the property.

    Returns string

Generated using TypeDoc