Options
All
  • Public
  • Public/Protected
  • All
Menu

External module "children"

Index

Variables

Const scopedEval

scopedEval: eval = eval

Const templateCache

templateCache: Map<any, any> = new Map()

Functions

clearTemplateCache

  • clearTemplateCache(): void

fetchJSONSync

  • fetchJSONSync(path: string, options?: any): string
  • Parameters

    • path: string
    • Optional options: any

    Returns string

getChildrenProperty

  • getChildrenProperty(options?: { jsonx?: defs.jsonx; props?: any }): any
  • returns a valid jsonx.children property

    example

    const sampleJSONX = { component: 'div', props: { id: 'generatedJSONX', className:'jsonx', }, children: [ { component: 'p', props: { style: { color: 'red', }, }, children:'hello world', }, { component: 'div', children: [ { component: 'ul', children: [ { component: 'li', children:'list', }, ], }, ], }, ], }; const JSONXChildren = getChildrenProperty({ jsonx: sampleJSONX, }); //=> [ [jsonx Object],[jsonx Object]] const JSONXChildrenPTag = getChildrenProperty({ jsonx: sampleJSONX.children[ 0 ], }); //=>hello world

    Parameters

    • Default value options: { jsonx?: defs.jsonx; props?: any } = {}
      • Optional jsonx?: defs.jsonx
      • Optional props?: any

    Returns any

    returns a valid jsonx.children property that's either an array of JSONX objects or a string

getChildrenProps

  • getChildrenProps(options?: { childjsonx?: defs.jsonx; jsonx?: defs.jsonx; props?: any; renderIndex?: undefined | number }): undefined | jsonx
  • Used to pass properties down to child components if passprops is set to true

    Parameters

    • Default value options: { childjsonx?: defs.jsonx; jsonx?: defs.jsonx; props?: any; renderIndex?: undefined | number } = {}
      • Optional childjsonx?: defs.jsonx
      • Optional jsonx?: defs.jsonx
      • Optional props?: any
      • Optional renderIndex?: undefined | number

        React key property

    Returns undefined | jsonx

    returns a valid Valid JSONX Child object or a string

getChildrenTemplate

  • getChildrenTemplate(template: string | any): any

getJSONXChildren

  • getJSONXChildren(this: Context, options?: defs.Config): string | null | undefined | Array<ReactElementLike> | Array<defs.JSONReactElement>
  • returns React Child Elements via JSONX

    property

    {object} this - options for getReactElementFromJSONX

    property

    {Object} [this.componentLibraries] - react components to render with JSONX

    property

    {boolean} [this.debug=false] - use debug messages

    property

    {function} [this.logError=console.error] - error logging function

    property

    {string[]} [this.boundedComponents=[]] - list of components that require a bound this context (usefult for redux router)

    Parameters

    • this: Context
    • Default value options: defs.Config = { jsonx: {} }

    Returns string | null | undefined | Array<ReactElementLike> | Array<defs.JSONReactElement>