Options
All
  • Public
  • Public/Protected
  • All
Menu

Class Item

The Item class provides methods to get and set properties of an item

example
import Xjs from '@xjsframework/xjs';
import Item from '@xjsframework/xjs/core/app';
import ItemProps from '@xjsframework/xjs/props/item-props';

const xjs = new Xjs();
const item = new Item(xjs);

const { id, srcId } = await item.getCurrentItem();
item.setProperty(ItemProps.customName, { id, srcId, value: 'SomeName' });

Hierarchy

  • Item

Index

Constructors

constructor

Properties

Private configUrl

configUrl: string

Private internal

internal: any

Methods

getConfiguration

  • getConfiguration(): Promise<Record<string, unknown> | string>
  • Get an item's configuration

    Returns Promise<Record<string, unknown> | string>

getCurrentItem

getItemList

  • getItemList(srcId: string): Promise<string[]>
  • Get the linked item ids of the specified source.

    Parameters

    • srcId: string

      Source ID

    Returns Promise<string[]>

Private getLinkedItem

  • getLinkedItem(srcId: string): Promise<string>

Private getPlacements

getProperty

  • getProperty(prop: IPropertyType, param: IPropertyParam): Promise<unknown>
  • Get item property

    Parameters

    • prop: IPropertyType

      Item Property object

    • param: IPropertyParam

      Params that would be used to modify the property key

    Returns Promise<unknown>

setConfiguration

  • setConfiguration(config: Record<string, unknown>): Promise<void>
  • Set an item's configuration

    Parameters

    • config: Record<string, unknown>

      A generic JSON object that would be persisted in the presentation

    Returns Promise<void>

setProperty

  • setProperty(prop: IPropertyType, param: IPropertyParam): Promise<string>
  • Set item property

    Parameters

    • prop: IPropertyType

      Item Property object

    • param: IPropertyParam

      Params that would be passed to the underlying core function

    Returns Promise<string>

Generated using TypeDoc