contract

package
v0.1.9 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 14, 2026 License: Apache-2.0 Imports: 2 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Overview

Package contract 定义浏览器和桌面阅读器共用的网页数据字段。

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CustomTags

func CustomTags(trees []reader.CustomTagTree) []map[string]any

CustomTags 将只读标签快照映射为共用界面的字段,不把 XML 当作 HTML。

func Fonts

func Fonts(values []reader.FontInfo) []reader.FontInfo

Fonts 复制字体声明并确保空列表编码为数组,不包含字体二进制数据。

func Outline

func Outline(tree reader.OutlineTree) reader.OutlineTree

Outline 复制大纲列表并规范化空数组,不修改阅读器的快照。

func Permissions

func Permissions(values []reader.DocumentPermissions) []reader.DocumentPermissions

Permissions 返回非 nil 数组,保证空结果在两种传输中一致。

func Search(report reader.SearchReport) reader.SearchReport

Search 复制搜索结果并规范化空数组,不修改阅读器的快照。

func Signatures

func Signatures(infos []reader.SignatureInfo) []map[string]any

Signatures 将阅读器的签名信息归一为浏览器和桌面共用的字段契约。

func Versions

func Versions(infos []reader.VersionInfo) []map[string]any

Versions 保持浏览器与桌面共用的版本字段和空数组语义。

Types

type PageLink struct {
	reader.PageLink

	Boundary *reader.AnnotationBoundary `json:"boundary"`
	Actions  []PageLink                 `json:"actions,omitempty"`
}

PageLink 保留网页对无效边界和空组合动作的表示。

func PageLinks(links []reader.PageLink) []PageLink

PageLinks 复制链接树,规范化空列表与无效边界。

type TextRun

type TextRun struct {
	reader.TextRun

	Source string `json:"source,omitempty"`
}

TextRun 使用阅读器字段契约,遮蔽网页文字层不暴露的来源字段。

func TextRuns

func TextRuns(runs []reader.TextRun) []TextRun

TextRuns 返回网页文字层契约;空文字和字符列表均为空数组。

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL