Repository navigation
Expand file tree
/
Copy pathtypes.ts
More file actions
55 lines (54 loc) · 1.93 KB
/
Copy pathtypes.ts
File metadata and controls
55 lines (54 loc) · 1.93 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
import type { GeoreferencedMap } from "@allmaps/annotation";
import type { StyleSpecification } from "maplibre-gl";
import type { WebGL2RenderOptions } from "@allmaps/render/webgl2";
import type { WarpedMapEffects } from "./map-options.ts";
export type { WarpedMapEffects } from "./map-options.ts";
import type { Camera } from "./camera.ts";
import type { SourceAssets } from "./sources.ts";
export type RenderLayer = {
effects?: WarpedMapEffects;
maps: Array<{ map: GeoreferencedMap; options?: Partial<WebGL2RenderOptions> }>;
/** Optional caller revision for inputs beyond the serialized geometry/options. */
revision?: string;
};
export type RenderJob = {
id: string;
layers: string[];
camera: Camera;
size: [number, number];
format: "webp" | "jpg";
styles?: { lower: StyleSpecification; upper: StyleSpecification };
/** Optional bottom-aligned title/subtitle with a soft contrast halo. */
textOverlay?: {
title: string;
subtitle?: string;
font?: string;
/** Title size at 1200 × 630, in pixels (default: 76); subtitle scales proportionally. */
textSize?: number;
};
};
/** JSON only: no Svelte components, callbacks, absolute asset paths or running app. */
export type RenderPlan = {
version: 2;
epoch: number;
/** Require fresh sources even when a previous snapshot exists. */
refresh?: boolean;
publicUrl?: string;
assets: SourceAssets;
layers: Record<string, RenderLayer>;
jobs: RenderJob[];
resources: Record<string, { base64: string; extension: "json" }>;
/** Caller-supplied fonts; omitted base64 uses an installed font family. */
fonts?: Record<string, { family: string; base64?: string }>;
};
export type RenderImage = { path: string; width: number; height: number };
export type RenderResult = {
images: Record<string, RenderImage>;
resources: Record<string, string>;
};
export type RenderOptions = {
assetRoot: string;
cacheRoot: string;
outputRoot: string;
offline?: boolean;
};