# Portable metadata · manual example

An explicitly hand-authored compact-format example for custom converters. Not a native generator fixture and not counted among the 20 native languages.

> Source: https://appgram.github.io/docsy/compact-sdk  
> Language: typescript  
> Symbols: 4 across 4 categories

## Categories

- [Clients](#clients) — 1 items
- [Models](#models) — 1 items
- [Hooks](#hooks) — 1 items
- [Enums](#enums) — 1 items

## Clients

### `AtlasClient`  <sub>class</sub>

An asynchronous client for the fictional Atlas document API.

**Properties**

| Name | Type | Required | Description | Default |

| --- | --- | --- | --- | --- |

| `baseUrl` | `string` | ✓ | The configured API origin. |  |

**Methods**

- `getDocument` — async → `Promise<Document>`  
  Fetch a document by its stable identifier.

  - `id: string` — Document identifier.

```typescript
declare class AtlasClient {
  constructor(options: { baseUrl: string });
  getDocument(id: string): Promise<Document>;
}
```

**Example**

```typescript
const client = new AtlasClient({ baseUrl: "https://api.example.com" });
const document = await client.getDocument("intro");
```

## Models

### `Document`  <sub>interface</sub>

A document returned by the Atlas API.

**Properties**

| Name | Type | Required | Description | Default |

| --- | --- | --- | --- | --- |

| `id` | `string` | ✓ | Stable identifier. |  |

| `title` | `string` | ✓ | Human-readable title. |  |

| `state` | `DocumentState` | ✓ | Publication state. |  |

```typescript
interface Document {
  id: string;
  title: string;
  state: DocumentState;
}
```

## Hooks

### `useDocument`  <sub>hook</sub>

A React hook for loading one document.

**Parameters**

| Name | Type | Required | Description |

| --- | --- | --- | --- |

| `id` | `string` | ✓ | Stable document identifier. |

**Returns** — `{ document?: Document; loading: boolean }` — The current document and loading state.

```typescript
declare function useDocument(id: string): {
  document?: Document;
  loading: boolean;
};
```

**Example**

```typescript
const { document, loading } = useDocument("intro");
```

## Enums

### `DocumentState`  <sub>enum</sub>

The publication state of a document.

**Values** — `draft`, `published`, `archived`
