# GC.Spread.Sheets.IO

## Content

# Namespace: IO

[Spread](GC.Spread).[Sheets](GC.Spread.Sheets).IO

## Table of contents

### Enumerations

- [ErrorCode](../enums/GC.Spread.Sheets.IO.ErrorCode)

### Type aliases

- [GetFileFunctionType](GC.Spread.Sheets.IO#getfilefunctiontype)
- [GetPartialValuesErrorCallbackType](GC.Spread.Sheets.IO#getpartialvalueserrorcallbacktype)
- [GetPartialValuesSuccessCallbackType](GC.Spread.Sheets.IO#getpartialvaluessuccesscallbacktype)

### Functions

- [getPartialValues](GC.Spread.Sheets.IO#getpartialvalues)
- [registerMaxDigitWidth](GC.Spread.Sheets.IO#registermaxdigitwidth)

## Type aliases

### <a id="getfilefunctiontype" name="getfilefunctiontype"></a> GetFileFunctionType

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

#### Type declaration

▸ (`filePath`): `File` \| `Blob`

**`description`** get file by file path.

##### Parameters

| Name | Type | Description |
| :------ | :------ | :------ |
| `filePath` | `string` | the file path. |

##### Returns

`File` \| `Blob`

- Returns the file or file blob.

___

### <a id="getpartialvalueserrorcallbacktype" name="getpartialvalueserrorcallbacktype"></a> GetPartialValuesErrorCallbackType

Ƭ **GetPartialValuesErrorCallbackType**: (`errorMsg`: `string`) => `void`

#### Type declaration

▸ (`errorMsg`): `void`

**`description`** the error callback of get partial values.

##### Parameters

| Name | Type | Description |
| :------ | :------ | :------ |
| `errorMsg` | `string` | the error message. |

##### Returns

`void`

___

### <a id="getpartialvaluessuccesscallbacktype" name="getpartialvaluessuccesscallbacktype"></a> GetPartialValuesSuccessCallbackType

Ƭ **GetPartialValuesSuccessCallbackType**: (`externalValues`: [`ExternalPartialValues`](GC.Spread.Sheets#externalpartialvalues)) => `void`

#### Type declaration

▸ (`externalValues`): `void`

**`description`** the success callback of get partial values.

##### Parameters

| Name | Type | Description |
| :------ | :------ | :------ |
| `externalValues` | [`ExternalPartialValues`](GC.Spread.Sheets#externalpartialvalues) | the external value list. |

##### Returns

`void`

## Functions

### <a id="getpartialvalues" name="getpartialvalues"></a> getPartialValues

▸ **getPartialValues**(`refList`, `getFile`, `getPartialValuesSuccessCallback`, `getPartialValuesErrorCallback`): `void`

Gets the the values of specific reference path list from file directly.

**`static`**

**`example`**
```javascript
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);
});
```

#### Parameters

| Name | Type | Description |
| :------ | :------ | :------ |
| `refList` | [`IExternalReference`](../interfaces/GC.Spread.Sheets.IExternalReference)[] | The array of external reference. |
| `getFile` | [`GetFileFunctionType`](GC.Spread.Sheets.IO#getfilefunctiontype) | The function which return file or blob by the specified file path. |
| `getPartialValuesSuccessCallback` | [`GetPartialValuesSuccessCallbackType`](GC.Spread.Sheets.IO#getpartialvaluessuccesscallbacktype) | The success callback function which called when get values successfully. |
| `getPartialValuesErrorCallback` | [`GetPartialValuesErrorCallbackType`](GC.Spread.Sheets.IO#getpartialvalueserrorcallbacktype) | The error callback function which called when get values failed. |

#### Returns

`void`

___

### <a id="registermaxdigitwidth" name="registermaxdigitwidth"></a> registerMaxDigitWidth

▸ **registerMaxDigitWidth**(`fontFamily`, `fontSize`, `maxDigitWidth`): `void`

Register a unknown max digit width info to IO.

**`example`**
```javascript
// Register max digit width for a custom font
GC.Spread.Sheets.IO.registerMaxDigitWidth("Arial", 12, 7.2);
```

#### Parameters

| Name | Type | Description |
| :------ | :------ | :------ |
| `fontFamily` | `string` | The font family of default style's font. |
| `fontSize` | `number` | The font size of default style's font(in point). |
| `maxDigitWidth` | `number` | The  max digit width of default style's font. |

#### Returns

`void`
