File size: 1,530 Bytes
008947a
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
export type LocationResult = {
  display_name: string
  latitude: number
  longitude: number
  country: string
  region: string
  country_code: string
  provider: string
}

export type BBox = {
  west: number
  south: number
  east: number
  north: number
}

export type StylePreset = {
  id: string
  name: string
  description: string
  preview: string
  background: string
  text: string
  water: string
  parks: string
  road_motorway: string
  road_primary: string
  road_secondary: string
  road_tertiary: string
  road_residential: string
  road_default: string
  gradient: string
}

export type Typography = {
  title: string
  subtitle: string
  caption: string
  coordinates: string
  font_family: string
  title_size: number
  subtitle_size: number
  caption_size: number
  coordinate_size: number
  letter_spacing: number
  line_height: number
  alignment: 'left' | 'center' | 'right'
  show_coordinates: boolean
  show_divider: boolean
}

export type LayerState = {
  motorway: boolean
  primary: boolean
  secondary: boolean
  residential: boolean
  water: boolean
  parks: boolean
}

export type PosterRequest = {
  location: LocationResult
  bbox: BBox
  distance_m: number
  zoom: number | null
  network_type: 'all' | 'drive' | 'walk' | 'bike'
  style_id: string
  colors: Record<string, string>
  typography: Typography
  layout: string
  layers: LayerState
  size: { preset: string; width_in?: number; height_in?: number }
}

export type PreviewPhase = 'idle' | 'preparing' | 'rendering' | 'success' | 'error'