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

# Types

> Shared TypeScript types exported by @qirtaas/core (and re-exported by the React and Vue packages).

All types below are exported from `@qirtaas/core` and re-exported by
`@qirtaas/react` and `@qirtaas/vue`.

```ts theme={null}
import type {
  Json,
  Locale,
  Theme,
  SaveState,
  ErrorCode,
  AutosaveOptions,
} from "@qirtaas/core";
```

## Json

```ts theme={null}
type Json = Record<string, unknown>;
```

Document content in **TipTap JSON** form — what `onChange` delivers, `getJSON()`
returns, and `initialContent` accepts.

## Locale

```ts theme={null}
type Locale = "en" | "ar";
```

Editor UI and content language/direction. `"ar"` renders the full RTL
experience.

## Theme

```ts theme={null}
type Theme = "light" | "dark";
```

Color theme. Switchable live via `setTheme` on any instance/handle.

## SaveState

```ts theme={null}
type SaveState = "idle" | "saving" | "saved" | "error";
```

Autosave/document lifecycle state, surfaced via `onSaveStateChange`. Typical
use: a save badge that shows a spinner on `saving`, a checkmark on `saved`, and
a retry affordance on `error`.

## ErrorCode

```ts theme={null}
type ErrorCode =
  | "doc_too_large"   // content exceeds the backend's max document size
  | "load_failed"     // the document could not be fetched
  | "unauthorized"    // auth failed and could not be recovered by a token refresh
  | "network"         // a request failed at the network layer
  | (string & {});    // open union — new codes may be added
```

Stable codes passed to `onError`. Treat the union as open: switch on the codes
you handle and fall through for anything unknown.

## AutosaveOptions

```ts theme={null}
interface AutosaveOptions {
  /** Default true. When false, the host drives persistence via save(). */
  enabled?: boolean;
  /** Debounce window in ms. Default 1500. */
  debounceMs?: number;
}
```

Passed as the editor's `autosave` option. With `{ enabled: false }`, nothing is
persisted until you call `save()` on the editor instance/handle — see
[Manual save](/sdk/editor#manual-save-autosave-off).

## Instance & options interfaces

The full option/handle shapes are documented on their own pages:

* [`EditorMountOptions` / `EditorInstance`](/sdk/editor)
* [`RendererMountOptions` / `RendererInstance`](/sdk/renderer)
* [`QirtaasClientOptions` / `QirtaasClient`](/sdk/client)
