eidos
声明 eidos/schema、eidos/table 或 eidos/config。Lite 支持三者,Serve 支持 table。表格操作针对绑定表格并使用字段 ID。配置写入需 write 权限和 expectedVersion,版本过期时需重新读取并协调。watch 发送失效通知,不含初始值,收到通知后应重新读取。setViewConfig 替换配置,不会合并。
签名、参数及返回类型从 SDK 自动生成;可选成员不保证在每个宿主和上下文中存在。
EidosTable
Section titled “EidosTable”EidosTable.tableId
Section titled “EidosTable.tableId”支持宿主: Lite Serve Mobile
readonly tableId: string;EidosTable.viewId
Section titled “EidosTable.viewId”支持宿主: Lite Serve Mobile
readonly viewId: string;EidosTable.readContext
Section titled “EidosTable.readContext”支持宿主: Lite Serve Mobile
读取绑定表格的字段与已保存视图信息。
readContext(): Promise<EidosTableSnapshot>;返回值: Promise<EidosTableSnapshot>.
EidosTable.readRows
Section titled “EidosTable.readRows”支持宿主: Lite Serve Mobile
分页读取绑定表格中的记录。
readRows(options: { offset: number; limit: number;}): Promise<EidosFileRowPage>;| 参数 | 类型 | 必填 |
|---|---|---|
options |
{ offset: number; limit: number; } |
是 |
返回值: Promise<EidosFileRowPage>.
EidosTable.aggregate
Section titled “EidosTable.aggregate”支持宿主: Lite Serve Mobile
按字段 ID 和指定指标聚合记录。
aggregate(options: TableAggregateOptions): Promise<TableAggregateResult>;| 参数 | 类型 | 必填 |
|---|---|---|
options |
TableAggregateOptions |
是 |
返回值: Promise<TableAggregateResult>.
EidosTable.setViewConfig
Section titled “EidosTable.setViewConfig”支持宿主: Lite Serve Mobile
替换已保存视图的插件配置,调用前应自行合并需要保留的键。
setViewConfig(config: Record<string, unknown>): Promise<void>;| 参数 | 类型 | 必填 |
|---|---|---|
config |
Record<string, unknown> |
是 |
返回值: Promise<void>.
EidosTable.openRecord
Section titled “EidosTable.openRecord”支持宿主: Lite Serve Mobile
在宿主中打开记录。
openRecord(rowId: string): Promise<void>;| 参数 | 类型 | 必填 |
|---|---|---|
rowId |
string |
是 |
返回值: Promise<void>.
EidosTable.watch
Section titled “EidosTable.watch”支持宿主: Lite Serve Mobile
接收失效通知,收到后重新读取当前数据。
watch(listener: () => void): Disposable;| 参数 | 类型 | 必填 |
|---|---|---|
listener |
() => void |
是 |
返回值: Disposable.
关联类型: EidosTableSnapshot, TableAggregateOptions, TableAggregateResult, Disposable.
EidosCapabilities
Section titled “EidosCapabilities”EidosCapabilities.schema
Section titled “EidosCapabilities.schema”支持宿主: Lite Mobile
readonly schema?: EidosSchema;EidosCapabilities.table
Section titled “EidosCapabilities.table”支持宿主: Lite Serve Mobile
readonly table?: EidosTable;EidosCapabilities.config
Section titled “EidosCapabilities.config”支持宿主: Lite Mobile
readonly config?: EidosConfig;关联类型: EidosSchema, EidosTable, EidosConfig.
EidosSchema
Section titled “EidosSchema”EidosSchema.listTables
Section titled “EidosSchema.listTables”支持宿主: Lite Mobile
列出当前 Eidos 文件中的表格。
listTables(): Promise<Array<{ id: string; name: string;}>>;返回值: Promise<Array<{ id: string; name: string; }>>.
EidosSchema.readTable
Section titled “EidosSchema.readTable”支持宿主: Lite Mobile
读取当前文件中指定表格的字段。
readTable(tableId: string): Promise<{ fields: EidosFileFieldInfo[];}>;| 参数 | 类型 | 必填 |
|---|---|---|
tableId |
string |
是 |
返回值: Promise<{ fields: EidosFileFieldInfo[]; }>.
EidosConfig
Section titled “EidosConfig”EidosConfig.read
Section titled “EidosConfig.read”支持宿主: Lite Mobile
读取指定表格中本插件的配置及版本。
read(tableId: string): Promise<EidosConfigSnapshot>;| 参数 | 类型 | 必填 |
|---|---|---|
tableId |
string |
是 |
返回值: Promise<EidosConfigSnapshot>.
EidosConfig.write
Section titled “EidosConfig.write”支持宿主: Lite Mobile
expectedVersion 匹配时替换配置,版本过期会返回 STALE_REVISION。
write(tableId: string, input: { value: JsonObject | null; expectedVersion: string;}): Promise<EidosConfigSnapshot>;| 参数 | 类型 | 必填 |
|---|---|---|
tableId |
string |
是 |
input |
{ value: JsonObject | null; expectedVersion: string; } |
是 |
返回值: Promise<EidosConfigSnapshot>.
EidosConfig.watch
Section titled “EidosConfig.watch”支持宿主: Lite Mobile
订阅失效通知,不包含初始值;通知可能包含无关变更。
watch(tableId: string, listener: () => void): Disposable;| 参数 | 类型 | 必填 |
|---|---|---|
tableId |
string |
是 |
listener |
() => void |
是 |
返回值: Disposable.
关联类型: EidosConfigSnapshot, Disposable.