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 either {@link Action1Interface} or a generation 2 constructor.

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

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

    Parameters

    • actionMetadata: ActionMetadataModel

      Action metadata that describes the action

    • action: ActionConstructor | Action1Interface

      Action instance that implements {@link Action1Interface} or a generation 2 constructor

    • internal: boolean

      Should be ignored or be set to false

    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 either {@link Function1Interface} or a generation 2 constructor.

    class MyFunction {
    myParameter: string

    async execute() {
    ...
    }
    }

    zySdk.services.registry.registerFunction(MyActionMetadata, MyFunction)

    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