// SPDX-License-Identifier: MIT

package pdfexport

type workerInput struct {
	Markdown string           `json:"markdown"`
	RepoMeta workerRepoMeta   `json:"repoMeta"`
	Config   workerConfigWrap `json:"config"`

	ManifestSHA string `json:"manifestSHA"`
}

type workerRepoMeta struct {
	Owner             string      `json:"owner"`
	Repo              string      `json:"repo"`
	Path              string      `json:"path"`
	RepoID            interface{} `json:"repoID"`
	CommitSHA         string      `json:"commitSHA"`
	CommitTimeRFC3339 string      `json:"commitTimeRFC3339"`
}

type workerConfigWrap struct {
	PDF pdfConfig `json:"pdf"`
}

// pdfConfig matches the required worker config surface (JSON keys and values).
type pdfConfig struct {
	Determinism string `json:"determinism"` // strict|relaxed
	Timestamp   string `json:"timestamp"`   // commit_time|render_time
	Typography  string `json:"typography"`  // basic|professional

	Mermaid struct {
		Strategy string `json:"strategy"` // fast|balanced|prestige
		Caption  bool   `json:"caption"`
	} `json:"mermaid"`

	OrphansWidows struct {
		Enforce bool `json:"enforce"`
	} `json:"orphansWidows"`

	Footer struct {
		Enabled bool `json:"enabled"`
	} `json:"footer"`
}

