logologo
开始
教程
手册
开发
插件
API
首页
English
简体中文
日本語
한국어
Español
Português
Deutsch
Français
Русский
开始
教程
手册
开发
插件
API
首页
logologo
API Overview

@nocobase/auth

AuthManager
Auth
BaseAuth

@nocobase/cache

CacheManager
Cache

@nocobase/cli

NocoBase CLI
全局环境变量

@nocobase/client

Application (Client)
Plugin (Client)

@nocobase/database

Collection
Field

interfaces

BaseInterface
Filter Operators

RelationRepository

BelongsToManyRepository
BelongsToRepository
HasManyRepository
HasOneRepository
Repository

Repository 共享参数

CreateOptions
DestroyOptions
FindOneOptions
FindOptions
Transaction 事务参数
UpdateOptions

@nocobase/data-source-manager

DataSourceManager
DataSource (abstract)
ICollectionManager
ICollection
IField
IModel
IRepository

@nocobase/flow-engine

DataSourceManager (FlowEngine)
FlowContext
FlowEngine
FlowModel
FlowResource

@nocobase/logger

Logger

@nocobase/server

AppCommand
Application (Server)
AuditManager
Context (Server)
Migration
Plugin (Server)

@nocobase/sdk

Auth (SDK)
Storage (SDK)

@nocobase/telemetry

Metric
Telemetry
Trace
Previous PageField
Next PageFilter Operators

#BaseInterface

#概览

BaseInterface 是所有 Interface 类型的基础类,用户可以自行继承此类实现自定义的 Interface 逻辑。

class CustomInterface extends BaseInterface {
  async toValue(value: string, ctx?: any): Promise<any> {
    // 自定义的 toValue 逻辑
  }

  toString(value: any, ctx?: any) {
    // 自定义的 toString 逻辑
  }
}
// 注册 Interface
db.interfaceManager.registerInterfaceType('customInterface', CustomInterface)

#接口

#toValue(value: string, ctx?: any): Promise

将外部的字符串转换为 interface 的实际值,值可直接传递给 Repository 进行写入操作

#toString(value: any, ctx?: any)

将 interface 的实际值转换为 string 类型,string 类型可用作导出、展示时使用