<!-- Public documentation export; not library implementation source. -->
# IExternalSaveLoadAdapter

[Integration guide](https://docs.lumencharts.com/charting-library/persistence#saveload-adapter) · [Reference index](https://docs.lumencharts.com/charting-library/api/)

Public contract reference. This declaration describes types and callback shapes; availability is constrained by the linked integration guide and the runtime capability. Legacy product-specific fields are not a promise of implementation.

## getAllCharts {#getallcharts}

```ts
getAllCharts(): Promise<ChartMetaInfo[]>;
```

Use the type signature above and the integration guide for the owning capability.

## removeChart {#removechart}

```ts
removeChart<T extends number | string>(id: T): Promise<void>;
```

Use the type signature above and the integration guide for the owning capability.

| Parameter | Type | Required |
| --- | --- | --- |
| `id` | `T` | Yes |

## saveChart {#savechart}

```ts
saveChart(chartData: ChartData): Promise<string>;
```

Use the type signature above and the integration guide for the owning capability.

| Parameter | Type | Required |
| --- | --- | --- |
| `chartData` | `ChartData` | Yes |

## getChartContent {#getchartcontent}

```ts
getChartContent(chartId: number): Promise<string>;
```

Use the type signature above and the integration guide for the owning capability.

| Parameter | Type | Required |
| --- | --- | --- |
| `chartId` | `number` | Yes |

## getAllStudyTemplates {#getallstudytemplates}

```ts
getAllStudyTemplates(): Promise<StudyTemplateMetaInfo[]>;
```

Use the type signature above and the integration guide for the owning capability.

## removeStudyTemplate {#removestudytemplate}

```ts
removeStudyTemplate(studyTemplateInfo: StudyTemplateMetaInfo): Promise<void>;
```

Use the type signature above and the integration guide for the owning capability.

| Parameter | Type | Required |
| --- | --- | --- |
| `studyTemplateInfo` | `StudyTemplateMetaInfo` | Yes |

## saveStudyTemplate {#savestudytemplate}

```ts
saveStudyTemplate(studyTemplateData: StudyTemplateData): Promise<void>;
```

Use the type signature above and the integration guide for the owning capability.

| Parameter | Type | Required |
| --- | --- | --- |
| `studyTemplateData` | `StudyTemplateData` | Yes |

## getStudyTemplateContent {#getstudytemplatecontent}

```ts
getStudyTemplateContent(
    studyTemplateInfo: StudyTemplateMetaInfo,
  ): Promise<string>;
```

Use the type signature above and the integration guide for the owning capability.

| Parameter | Type | Required |
| --- | --- | --- |
| `studyTemplateInfo` | `StudyTemplateMetaInfo` | Yes |

## getDrawingTemplates {#getdrawingtemplates}

```ts
getDrawingTemplates(toolName: string): Promise<string[]>;
```

Use the type signature above and the integration guide for the owning capability.

| Parameter | Type | Required |
| --- | --- | --- |
| `toolName` | `string` | Yes |

## loadDrawingTemplate {#loaddrawingtemplate}

```ts
loadDrawingTemplate(toolName: string, templateName: string): Promise<string>;
```

Use the type signature above and the integration guide for the owning capability.

| Parameter | Type | Required |
| --- | --- | --- |
| `toolName` | `string` | Yes |
| `templateName` | `string` | Yes |

## removeDrawingTemplate {#removedrawingtemplate}

```ts
removeDrawingTemplate(toolName: string, templateName: string): Promise<void>;
```

Use the type signature above and the integration guide for the owning capability.

| Parameter | Type | Required |
| --- | --- | --- |
| `toolName` | `string` | Yes |
| `templateName` | `string` | Yes |

## saveDrawingTemplate {#savedrawingtemplate}

```ts
saveDrawingTemplate(
    toolName: string,
    templateName: string,
    content: string,
  ): Promise<void>;
```

Use the type signature above and the integration guide for the owning capability.

| Parameter | Type | Required |
| --- | --- | --- |
| `toolName` | `string` | Yes |
| `templateName` | `string` | Yes |
| `content` | `string` | Yes |

## getChartTemplateContent {#getcharttemplatecontent}

```ts
getChartTemplateContent(templateName: string): Promise<ChartTemplate>;
```

Use the type signature above and the integration guide for the owning capability.

| Parameter | Type | Required |
| --- | --- | --- |
| `templateName` | `string` | Yes |

## getAllChartTemplates {#getallcharttemplates}

```ts
getAllChartTemplates(): Promise<string[]>;
```

Use the type signature above and the integration guide for the owning capability.

## saveChartTemplate {#savecharttemplate}

```ts
saveChartTemplate(
    newName: string,
    theme: ChartTemplateContent,
  ): Promise<void>;
```

Use the type signature above and the integration guide for the owning capability.

| Parameter | Type | Required |
| --- | --- | --- |
| `newName` | `string` | Yes |
| `theme` | `ChartTemplateContent` | Yes |

## removeChartTemplate {#removecharttemplate}

```ts
removeChartTemplate(templateName: string): Promise<void>;
```

Use the type signature above and the integration guide for the owning capability.

| Parameter | Type | Required |
| --- | --- | --- |
| `templateName` | `string` | Yes |

## saveLineToolsAndGroups {#savelinetoolsandgroups}

```ts
saveLineToolsAndGroups(
    layoutId: string | undefined,
    chartId: string | number,
    state: LineToolsAndGroupsState,
  ): Promise<void>;
```

Use the type signature above and the integration guide for the owning capability.

| Parameter | Type | Required |
| --- | --- | --- |
| `layoutId` | `string &#124; undefined` | Yes |
| `chartId` | `string &#124; number` | Yes |
| `state` | `LineToolsAndGroupsState` | Yes |

## loadLineToolsAndGroups {#loadlinetoolsandgroups}

```ts
loadLineToolsAndGroups(
    layoutId: string | undefined,
    chartId: string | number,
    requestType: LineToolsAndGroupsLoadRequestType,
    requestContext: LineToolsAndGroupsLoadRequestContext,
  ): Promise<Partial<LineToolsAndGroupsState> | null>;
```

Use the type signature above and the integration guide for the owning capability.

| Parameter | Type | Required |
| --- | --- | --- |
| `layoutId` | `string &#124; undefined` | Yes |
| `chartId` | `string &#124; number` | Yes |
| `requestType` | `LineToolsAndGroupsLoadRequestType` | Yes |
| `requestContext` | `LineToolsAndGroupsLoadRequestContext` | Yes |

## Related types

- [ChartMetaInfo](https://docs.lumencharts.com/charting-library/api/ChartMetaInfo)
- [ChartData](https://docs.lumencharts.com/charting-library/api/ChartData)
- [StudyTemplateMetaInfo](https://docs.lumencharts.com/charting-library/api/StudyTemplateMetaInfo)
- [StudyTemplateData](https://docs.lumencharts.com/charting-library/api/StudyTemplateData)
- [ChartTemplate](https://docs.lumencharts.com/charting-library/api/ChartTemplate)
- [ChartTemplateContent](https://docs.lumencharts.com/charting-library/api/ChartTemplateContent)
- [LineToolsAndGroupsState](https://docs.lumencharts.com/charting-library/api/LineToolsAndGroupsState)
- [LineToolsAndGroupsLoadRequestType](https://docs.lumencharts.com/charting-library/api/LineToolsAndGroupsLoadRequestType)
- [LineToolsAndGroupsLoadRequestContext](https://docs.lumencharts.com/charting-library/api/LineToolsAndGroupsLoadRequestContext)

---
Documentation page: https://docs.lumencharts.com/charting-library/api/IExternalSaveLoadAdapter
