> ## Documentation Index
> Fetch the complete documentation index at: https://docs.markpdf.tech/llms.txt
> Use this file to discover all available pages before exploring further.

# Referencia

> tipos createConvertStore, ConvertStore y @markpdf/svelte.

\#Referencia

## `createConvertStore(client)`

```ts theme={null}
function createConvertStore(client: MarkpdfClient): ConvertStore
```

<ParamField body="client" type="MarkpdfClient" required>
  Instancia de `MarkpdfClient` (reexportada desde `@markpdf/svelte`, idéntica a `@markpdf/sdk`).
</ParamField>

Devuelve `ConvertStore`: una tienda Svelte (`Readable<ConvertState>`) con dos métodos agregados.

## `ConvertStore`

```ts theme={null}
interface ConvertStore extends Readable<ConvertState> {
  convert(file: File, options?: ConvertOptions): Promise<void>;
  reset(): void;
}
```

### `convert(file, options)`

Cargue un `File`/`Blob` a través de `POST /convert` (multiparte), informando el progreso a través de `XMLHttpRequest` (la tienda actualiza su estado en cada evento `progress`).

<ParamField body="file" type="File" required>
  `<input type="file">` archivo, arrastrar y soltar, etc.
</ParamField>

<ParamField body="options" type="ConvertOptions" />

Devuelve `Promise<void>`: se resuelve cuando la tienda ha terminado de actualizarse (lee `$store.markdown`/`$store.json` para el resultado, no el valor de retorno).

### `reset()`

Devuelve la tienda a su estado inicial (`status: "idle"`, sin `markdown`/`json`/`error`).

## `ConvertState`

```ts theme={null}
interface ConvertState {
  status: "idle" | "uploading" | "converting" | "success" | "error";
  progress: number;      // 0-100, solo vávavalid durante "uploading"
  markdown: string | null;
  json: JsonResult | null;
  error: MarkpdfError | null;
}
```

## `MarkpdfClient` (reexportado)

```ts theme={null}
import { MarkpdfClient } from "@markpdf/svelte";

const client = new MarkpdfClient({
  apiKey: "YOUR_API_KEY",
  baseUrl: "https://api.markpdf.tech",
  timeoutMs: 300_000,
  maxRetries: 2,
});
```

Idéntico al cliente [`@markpdf/sdk`](/docs/public/es/sdks/nodejs/reference#markpdfclient): mismos métodos (`convertFile`, `convertFromUrl`, `convertStream`, `pdfIndex`, `getJob`) y opciones de constructor.

## Tipos

```ts theme={null}
import type {
  ConvertOptions,
  ConvertResult,
  Job,
  JsonResult,
  MarkpdfClientOptions,
} from "@markpdf/svelte";

import type { ConvertStore, ConvertState, ConvertStatus } from "@markpdf/svelte";
```
