Socket
Socket
Sign inDemoInstall

rhino-ext-runtime

Package Overview
Dependencies
0
Maintainers
1
Versions
2
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    rhino-ext-runtime

扩展点运行时 SDK


Version published
Maintainers
1
Install size
34.1 kB
Created

Readme

Source

扩展点运行时 SDK

安装

> tnpm i rhino-ext-runtime -S

开始使用

import ExtRuntime from 'rhino-ext-runtime';
import { BasePagePlugin, RhinoSchemaHelpers } from 'rhino-ext-runtime';

// 初始化一个运行时实例
const extRuntime = new ExtRuntime();

// 设置扩展应用加载启用逻辑
extRuntime.setDetector(({ data, pageInfo }) => [
  {
    appPath: 'cdn.com',
    pages: [
      'pageFolderName1',
      'pageFolderName2',
    ]
  }
]);

// 获取用户配置的字段信息
const { fieldsConfig, blocksConfig } = await extRuntime.declareFields();

// 声明扩展点
const result = await extRuntime.declareHook('myHookName', { data });

// 更新表格某一行的组件信息
const modifiedArrayItemData = ExtRuntime.RhinoSchemaHelpers.updatePropsOfArrayItem(
  {
    arrayItemData: data
    fieldsConfig: [
      {
        fieldCode,
        blockCode,
        props: {
          foo: 'abc',
          bar: 'efg'
        },
      }
    ]
  }
);

FAQs

Last updated on 13 Apr 2021

Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc