drip-table
Version:
A tiny and powerful enterprise-class solution for building tables.
52 lines (51 loc) • 2.03 kB
TypeScript
/**
* This file is part of the drip-table project.
* @link : https://drip-table.jd.com/
* @author : Emil Zhai (root@derzh.com)
* @modifier : Emil Zhai (root@derzh.com)
* @copyright: Copyright (c) 2021 JD Network Technology Co., Ltd.
*/
import { DripTableRecordTypeBase } from "../../types";
import { SandboxEvaluate } from "../../utils/sandbox";
/**
* 格式化变量用于提供给渲染函数
* @param v 任意数据
* @returns 渲染字符串
*/
export declare const stringify: (v: unknown) => string;
export declare type FinalizeString =
/**
* 格式化模板字符串,填充变量值
* @param mode 格式化模式
* @param text 模板字符串
* @param record 填充数据源对象
* @param recordIndex 填充数据源下标
* @param ext 透传自定义额外数据
* @returns 最终字符串
*/
(mode: 'plain' | 'key' | 'pattern' | 'script', text: string, record: DripTableRecordTypeBase, recordIndex: number, ext: unknown) => string;
/**
* 抑制事件处理函数默认行为
* @param e 事件对象
* @returns boolean
*/
export declare const preventEvent: (e: React.BaseSyntheticEvent) => boolean;
/**
* 获取对象的经过数据处理后的最终值 WHAT THE HELL IS THIS??
* @param execute 执行器
* @param data 基础对象
* @param indexes 下标或下标数组
* @param defaultValue 默认值
* @param dataProcess 数据处理的语句
* @returns 值
*/
export declare const dataProcessIndex: (execute: SandboxEvaluate, data: unknown, indexes: string | number | readonly (string | number)[] | undefined, defaultValue?: unknown, dataProcess?: string | undefined) => any;
/**
* 获取数据处理的运行结果 WHAT THE HELL IS THIS??
* @param execute 执行器
* @param data 基础对象
* @param indexes 下标或下标数组
* @param funcText 数据处理的语句
* @returns 值
*/
export declare const dataProcessValue: (execute: SandboxEvaluate, data: unknown, indexes: string | number | readonly (string | number)[] | undefined, funcText?: string) => unknown;