Options
All
  • Public
  • Public/Protected
  • All
Menu

This services allows registration of components, actions and themes

Registrations should happen the soonest as possible at Plugin startup

Hierarchy

  • RegistryInterface

Index

Methods

  • Registers an action

    An action is a piece of logic executed by the mobile app. most of the time when a component is pressed An Action is a Typescript class that implements ActionInterface and provide an execute method as per this example

    class MyAction implements ActionInterface {
    async execute(properties: PropertyModel[]) {
    ...
    }
    }

    const myActionInstance = new MyAction()

    zySdk.services.registry.registerAction(MyActionMetadata, myActionInstance)

    Parameters

    Returns void

  • registerComponent(componentMetadata: ComponentMetadataModel, component: CustomElementConstructor, internal?: boolean): void
  • Registers a visual component. The component must be a custom element, compliant with WebComponents specifications

    class MyComponent extends HTMLElement {
    ...
    }

    zySdk.services.registry.registerComponent(MyComponentMetadata, MyComponent)

    Parameters

    • componentMetadata: ComponentMetadataModel

      Component metadata that describes the component

    • component: CustomElementConstructor

      CustomElement Class to register. The component does not need to register the custom element

    • Optional internal: boolean

      Should be ignored or be set to false

    Returns void

  • Registers a function

    A function is a piece of logic executed by the mobile app. when a formula is being evaluated A function is a Typescript class that implements FunctionInterface and provide an execute method as per this example

    class MyFunction implements FunctionInterface {
    async execute(properties: FunctionParameterModel[]) {
    ...
    }
    }

    const myActionInstance = new MyAction()

    zySdk.services.registry.registerAction(MyActionMetadata, myActionInstance)

    Parameters

    Returns any

  • Registers a Theme

    const theme = {
    name: 'MyTheme',
    theme: {
    primaryColor: '#4f7d96',
    primaryTextColor: '#ffffff',
    secondaryColor: '#fe844b',
    secondaryTextColor: '#ffffff',
    backgroundColor: '#f0f6f9',
    textColor: '#474f5b',
    tertiaryColor: '#0000000a',
    tertiaryTextColor: '#000000',
    rtl: false
    }
    }

    zySdk.services.registry.registerTheme(theme)

    Parameters

    • predefinedTheme: PredefinedThemeModel

      Theme to register

    • Optional internal: boolean

      Should be ignored or be set to false

    Returns void