Versions in this module Expand all Collapse all v0 v0.0.2 Apr 30, 2026 Changes in this version + type PageTarget struct + Name string + Prepare *PrepareSpec + RootSelector string + URL string + Viewport Viewport + WaitMS int + type PrepareSpec struct + AfterWaitMS int + Background string + Component string + MinHeight int + Props map[string]any + RootSelector string + Script string + ScriptFile string + Type string + WaitFor string + WaitForTimeoutMS int + Width int + type StyleEvalSpec struct + Attributes []string + IncludeBounds bool + Props []string + Report []string + Selector string + type Viewport struct + Height int + Width int v0.0.1 Apr 27, 2026 Changes in this version + const CatalogSchemaVersion + const DefaultPrepareAfterWait + const DefaultPrepareWaitTimeout + const InspectFormatBundle + const InspectFormatCSSJSON + const InspectFormatCSSMarkdown + const InspectFormatHTML + const InspectFormatInspectJSON + const InspectFormatMetadataJSON + const InspectFormatPNG + func BuildDirectReactGlobalScript(prepare *config.PrepareSpec) (string, error) + func CanonicalInspectFormat(format string) (string, error) + func CleanCatalogRelativePath(path string) string + func CloneJSON[T any](value T) (T, error) + func EnsureInspectSelectorExists(page *driver.Page, req InspectRequest) error + func InspectFormatRequiresExistingSelector(format string) bool + func LoadAndPreparePage(page *driver.Page, target config.Target) error + func LocatorAttributes(page *driver.Page, locator LocatorSpec, attrs []string) (map[string]string, error) + func LocatorComputedStyle(page *driver.Page, locator LocatorSpec, props []string) (map[string]string, error) + func LocatorText(page *driver.Page, locator LocatorSpec, opts TextOptions) (string, error) + func PrepareTarget(page *driver.Page, target config.Target) error + func RenderDiffMarkdown(diff SnapshotDiff) string + func RootSelectorForTarget(target config.Target) string + func RunDirectReactGlobalPrepare(page *driver.Page, prepare *config.PrepareSpec) error + func RunScriptPrepare(page *driver.Page, prepare *config.PrepareSpec) error + func SanitizeCatalogSlug(slug string) string + func SanitizeName(name string) string + func WriteInspectCSSMarkdown(path string, req InspectRequest, style StyleSnapshot) error + func WriteInspectIndex(outDir string, result InspectResult) error + func WriteInspectJSON(page *driver.Page, selector, path string) error + func WriteJSON(path string, data any) error + func WritePreparedHTML(page *driver.Page, selector, path string) error + type Bounds struct + Height float64 + Width float64 + X float64 + Y float64 + func LocatorBounds(page *driver.Page, locator LocatorSpec) (*Bounds, error) + type BrowserService struct + func NewBrowserService(ctx context.Context) (*BrowserService, error) + func (s *BrowserService) Browser() *driver.Browser + func (s *BrowserService) Close() + func (s *BrowserService) NewPage() (*PageService, error) + type Catalog struct + func NewCatalog(opts CatalogOptions) (*Catalog, error) + func (c *Catalog) AddFailure(target CatalogTargetRecord, failure CatalogFailureRecord) CatalogFailureRecord + func (c *Catalog) AddResult(target CatalogTargetRecord, result InspectResult) CatalogResultRecord + func (c *Catalog) AddTarget(target CatalogTargetRecord) CatalogTargetRecord + func (c *Catalog) ArtifactDir(slug string) string + func (c *Catalog) Manifest() CatalogManifest + func (c *Catalog) Options() CatalogOptions + func (c *Catalog) RecordPreflight(target CatalogTargetRecord, statuses []SelectorStatus) CatalogPreflightRecord + func (c *Catalog) Summary() CatalogSummary + func (c *Catalog) WriteIndex() (string, error) + func (c *Catalog) WriteManifest() (string, error) + type CatalogFailureRecord struct + Code string + Message string + Name string + Operation string + RecordedAt time.Time + Target CatalogTargetRecord + type CatalogManifest struct + ArtifactRoot string + CreatedAt time.Time + Failures []CatalogFailureRecord + OutDir string + Preflights []CatalogPreflightRecord + Results []CatalogResultRecord + SchemaVersion string + Summary CatalogSummary + Targets []CatalogTargetRecord + Title string + UpdatedAt time.Time + type CatalogOptions struct + ArtifactRoot string + IndexName string + OutDir string + Title string + type CatalogPreflightRecord struct + RecordedAt time.Time + Statuses []SelectorStatus + Target CatalogTargetRecord + type CatalogResultRecord struct + RecordedAt time.Time + Result InspectResult + Target CatalogTargetRecord + type CatalogSummary struct + ArtifactCount int + FailureCount int + PreflightCount int + ResultCount int + TargetCount int + type CatalogTargetRecord struct + Description string + Metadata map[string]any + Name string + Selector string + Slug string + URL string + Viewport config.Viewport + func NormalizeCatalogTarget(target CatalogTargetRecord) CatalogTargetRecord + type DiffChange struct + After any + Before any + Path string + type DiffOptions struct + IgnorePaths []string + type DirectReactGlobalPrepareResult struct + Bounds map[string]float64 + ComponentName string + OK bool + Props map[string]any + RootSelector string + type ElementHTML struct + Exists bool + HTML string + func LocatorHTML(page *driver.Page, locator LocatorSpec, outer bool) (ElementHTML, error) + type ElementSnapshot struct + Attributes map[string]string + Bounds *Bounds + Computed map[string]string + Exists *bool + Selector string + Text string + Visible *bool + func ExtractElement(page *driver.Page, locator LocatorSpec, extractors []ExtractorSpec) (ElementSnapshot, error) + type ExtractorKind string + const ExtractorAttributes + const ExtractorBounds + const ExtractorComputedStyle + const ExtractorExists + const ExtractorText + const ExtractorVisible + type ExtractorSpec struct + Attributes []string + Kind ExtractorKind + Props []string + Text TextOptions + type InspectAllOptions struct + Format string + OutDir string + OutputFile string + type InspectArtifactResult struct + HTML string + InspectJSON string + Metadata InspectMetadata + Screenshot string + Style *StyleSnapshot + func WriteInspectArtifacts(page *driver.Page, target config.Target, side string, req InspectRequest, ...) (InspectArtifactResult, error) + func WriteSingleInspectArtifact(page *driver.Page, req InspectRequest, metadata InspectMetadata, ...) (InspectArtifactResult, error) + type InspectMetadata struct + CreatedAt time.Time + Format string + Name string + PrepareType string + RootSelector string + Selector string + SelectorSource string + Side string + TargetName string + URL string + Viewport config.Viewport + type InspectRequest struct + Attributes []string + Name string + Props []string + Selector string + Source string + type InspectResult struct + OutputDir string + Results []InspectArtifactResult + func InspectPreparedPage(page *driver.Page, target config.Target, side string, ...) (InspectResult, error) + type LocatorSpec struct + Name string + Selector string + Source string + type PageService struct + func (p *PageService) Close() + func (p *PageService) LoadAndPrepareTarget(target config.Target) error + func (p *PageService) Page() *driver.Page + type PageSnapshot struct + Results []ProbeSnapshot + func SnapshotPage(page *driver.Page, probes []SnapshotProbeSpec) (PageSnapshot, error) + type ProbeSnapshot struct + Error string + Name string + Selector string + Snapshot ElementSnapshot + Source string + type ProbeSpec struct + Attributes []string + Name string + Props []string + Required bool + Selector string + Source string + type SelectorStatus struct + Bounds *Bounds + Error string + Exists bool + Name string + Selector string + Source string + TextStart string + Visible bool + func LocatorStatus(page *driver.Page, locator LocatorSpec) (SelectorStatus, error) + func PreflightProbes(page *driver.Page, probes []ProbeSpec) ([]SelectorStatus, error) + type SnapshotDiff struct + ChangeCount int + Changes []DiffChange + Equal bool + func DiffValues(before, after any, opts DiffOptions) (SnapshotDiff, error) + type SnapshotProbeSpec struct + Extractors []ExtractorSpec + Name string + Required bool + Selector string + Source string + type StyleSnapshot struct + Attributes map[string]string + Bounds *Bounds + Computed map[string]string + Exists bool + func EvaluateStyle(page *driver.Page, spec config.StyleSpec) (StyleSnapshot, error) + type TextOptions struct + NormalizeWhitespace bool + Trim bool