# @univerjs-pro/docs-exchange-client

> Language fallback: requested `zh-CN`; content is `en-US`.

- Human documentation: [https://docs.univer.ai/zh-CN/reference/packages/plugins/univerjs-pro/docs-exchange-client](https://docs.univer.ai/zh-CN/reference/packages/plugins/univerjs-pro/docs-exchange-client)

- Agent Markdown: [https://docs.univer.ai/zh-CN/reference/packages/plugins/univerjs-pro/docs-exchange-client.md](https://docs.univer.ai/zh-CN/reference/packages/plugins/univerjs-pro/docs-exchange-client.md)

- Requested language: `zh-CN`

- Content language: `en-US`

- Documentation version: `1.0.0-rc.0`

- Source: [packages/plugins/univerjs-pro/docs-exchange-client.mdx](https://github.com/dream-num/documentation/blob/dev/content/reference/packages/plugins/univerjs-pro/docs-exchange-client.mdx)

---

Document import and export client integration for Web SDK.

```typescript
// [!code word:UniverDocsExchangeClientPlugin]
// [!code word:IUniverDocsExchangeClientConfig]
import { UniverDocsExchangeClientPlugin } from '@univerjs-pro/docs-exchange-client'

univer.registerPlugin(UniverDocsExchangeClientPlugin)
```

## Entry Points

* Facade: `@univerjs-pro/docs-exchange-client/facade`
* Locale: `@univerjs-pro/docs-exchange-client/locale/*`

## Facade API

```typescript
import '@univerjs-pro/docs-exchange-client/facade'

importDocToUnitIdAsync(file: File | string, options?: IExchangeDocImportOption): Promise<string | undefined>
importDocToSnapshotAsync(file: File | string, options?: IExchangeDocImportOption): Promise<IDocumentData | undefined>
exportDocByUnitIdAsync(unitId: string): Promise<File | undefined>
exportDocBySnapshotAsync(snapshot: IDocumentData): Promise<File | undefined>
transformSnapshotJsonToDocumentDataAsync(json: ISnapshotBlockJsonResponse): Promise<IDocumentData>
transformDocumentDataToSnapshotJsonAsync(documentData: IDocumentData): Promise<ISnapshotBlockJson>
```

Use `IExchangeDocImportOption.docType` to select the document flavor:

```ts
import { ExchangeDocType } from '@univerjs-pro/exchange-client'

const unitId = await univerAPI.importDocToUnitIdAsync(file, {
  docType: ExchangeDocType.MODERN,
})
```

## IUniverDocsExchangeClientConfig

```ts
import type { MenuConfig } from '@univerjs/ui'

export interface IUniverDocsExchangeClientConfig {
  menu?: MenuConfig
}
```
