# RegenerateResult

```ts
type RegenerateResult = 
  | {
  kind: "image";
  newVariants: VariantPreset[];
  ok: true;
  sourceUsed: VariantPreset | "raw";
  variants: AssetVariant[];
}
  | {
  dispatch: unknown;
  kind: "video";
  ok: true;
  regenerated: string[] | "default";
};
```

Defined in: packages/sdk/src/index.ts:444

Returned by `aq.assets.regenerate(...)`. The shape varies by kind —
images return immediately with the merged variant list; videos
return a dispatch handle (the actual transcode runs in a background
job and finishes async).

## Union Members

### Type Literal

```ts
{
  kind: "image";
  newVariants: VariantPreset[];
  ok: true;
  sourceUsed: VariantPreset | "raw";
  variants: AssetVariant[];
}
```

#### kind

```ts
kind: "image";
```

#### newVariants

```ts
newVariants: VariantPreset[];
```

Presets newly written this run. Useful for showing "added X".

#### ok

```ts
ok: true;
```

#### sourceUsed

```ts
sourceUsed: VariantPreset | "raw";
```

Which source the server read to derive the new variants:
  - `"original"` / `"raw"` → lossless source bytes (best)
  - `"xl"` / `"lg"` / `"md"` / `"sm"` / `"thumb"` → a previously
    encoded WebP variant was used as the source. Output is
    re-encoded WebP — fine for thumb/sm from lg, lossier when
    working from already-small sources.

The no-upscale clamp still applies: deriving `lg` (1920) from
a 640 `sm` source produces a 640-side `lg` variant, not a
stretched 1920.

#### variants

```ts
variants: AssetVariant[];
```

Full variant set after the merge.

***

### Type Literal

```ts
{
  dispatch: unknown;
  kind: "video";
  ok: true;
  regenerated: string[] | "default";
}
```