[]
        
(Showing Draft Content)

GC.Spread.Sheets.IO

命名空间: IO

Spread.Sheets.IO

Table of contents

枚举

类型别名

函数

Type aliases

GetFileFunctionType

Ƭ GetFileFunctionType: (filePath: string) => File | Blob

Type declaration

▸ (filePath): File | Blob

description 获取文件流

Parameters
属性名 类型 说明
filePath string 文件路径
Returns

File | Blob

  • 返回文件或文件流

GetPartialValuesErrorCallbackType

Ƭ GetPartialValuesErrorCallbackType: (errorMsg: string) => void

Type declaration

▸ (errorMsg): void

description 获取值时错误回调

Parameters
属性名 类型 说明
errorMsg string 错误信息
Returns

void


GetPartialValuesSuccessCallbackType

Ƭ GetPartialValuesSuccessCallbackType: (externalValues: ExternalPartialValues) => void

Type declaration

▸ (externalValues): void

description 获取值时成功回调

Parameters
属性名 类型 说明
externalValues ExternalPartialValues 外部值列表
Returns

void

Functions

getPartialValues

getPartialValues(refList, getFile, getPartialValuesSuccessCallback, getPartialValuesErrorCallback): void

直接从文件中获取特定引用路径列表的值

static

代码示例

function getFile (path) {
  // return file by path
}
let refList = spread.getExternalReferences(true);
GC.Spread.Sheets.IO.getPartialValues(refList, getFile, (externalValues) => {
  // successCallback
  spread.updateExternalReference(externalValues);
}, (errorMsg) => {
  // errorCallback
  console.log(errorMsg);
});

参数

属性名 类型 说明
refList IExternalReference[] 外部引用的数组
getFile GetFileFunctionType 根据指定的文件路径返回文件或 Blob 的函数
getPartialValuesSuccessCallback GetPartialValuesSuccessCallbackType 在成功获取部分值时调用的回调函数
getPartialValuesErrorCallback GetPartialValuesErrorCallbackType 在获取部分值失败时调用的错误回调函数

返回值

void


registerMaxDigitWidth

registerMaxDigitWidth(fontFamily, fontSize, maxDigitWidth): void

将未知的最大数字宽度信息注册到 IO

参数

属性名 类型 说明
fontFamily string 默认样式字体的字体系列
fontSize number 默认样式字体的字号(以点为单位)
maxDigitWidth number 默认样式字体的最大数字宽度

返回值

void