moonbit-brandbook

Import, audit, benchmark, and export production-ready brand systems from MoonBit design tokens.

brand
design-system
markdown
html
generator
moon add cyypyhon123/moonbit-brandbook@0.2.1
Download zip
Version
0.2.1
License
Apache-2.0
Last updated
4 hours ago
Downloads
3

Dependencies

README

#moonbit-brandbook

moonbit-brandbook is a MoonBit library and CLI for turning structured design tokens into a reviewable, portable brand system. It combines JSON/YAML import, schema and accessibility audits, deterministic Markdown/HTML/CSS/theme exports, and a measurable validation pipeline.

#Project positioning

The project sits between a design-token source of truth and the documentation and code artifacts consumed by product teams. Its core promise is traceability: semantic tokens, component contracts, asset rules, and rendered guides are handled by one typed pipeline.

#Core capabilities

  • Parse a strict, useful subset of JSON and YAML with source diagnostics.
  • Model semantic colors, typography, assets, components, misuse rules, aliases, and token provenance.
  • Run schema, contrast, asset-safety, typography-rhythm, content, and component contract audits with actionable findings.
  • Export Markdown, static HTML, CSS custom properties, theme JSON/YAML, Tailwind-compatible tokens, Figma-style tokens, and an artifact manifest.
  • Generate deterministic light/dark/minimal templates, theme diffs, catalog queries, release readiness checks, and a real parser/render benchmark.

#Quick start

moon update moon run cmd/main -- demo moon run cmd/main -- benchmark moon test --target all

///|
test {
let book = moonbit_brandbook()
let report = book.validate_with_policy(ValidationPolicy::strict())
assert_false(report.has_errors())
assert_true(book.to_theme_json().contains("colors"))
}

#CLI

moon run cmd/main -- help moon run cmd/main -- demo --format html moon run cmd/main -- validate --input examples/brandbook.json moon run cmd/main -- render --format tailwind --text <document> moon run cmd/main -- render --format html --input examples/brandbook.json --output _build/brandbook.html moon run cmd/main -- benchmark

--text and --input are mutually exclusive. File input is UTF-8 JSON/YAML; --output writes the rendered artifact instead of standard output. Validation and rendering errors return a non-zero process exit code.

#Architecture

input -> parser + diagnostics -> BrandBook -> audits -> RenderBundle ->exporters. The root package is reusable; cmd/main is a thin CLI adapter.

#Benchmark

See docs/benchmarks/latest.md for the latest measured small/medium/large parser and renderer run. Values are clock units from moonbitlang/core/env.now() and must be rerun for a different machine.

#Testing and CI

moon fmt --check moon check --deny-warn --target all moon test --deny-warn --target all moon test --enable-coverage --target native moon coverage report -f summary moon info git diff --exit-code

GitHub Actions runs these gates on Ubuntu, macOS, and Windows. Publishing is a manual workflow that runs the preflight before moon publish.

#License

Apache-2.0. See LICENSE.

#
AccessibilityPolicy

pub struct AccessibilityPolicy {
normal_min_x100 : Int
large_min_x100 : Int
error_below_x100 : Int
require_text_surface_pairs : Bool
} derive(Eq,
Debug
)

#
AccessibilityPolicy::for_thresholds

fn AccessibilityPolicy::for_thresholds(normal_min_x100 : Int, large_min_x100 : Int) -> AccessibilityPolicy

#
AccessibilityPolicy::wcag_aa

#
AccessibilityPolicy::wcag_aaa

#
ApiContract

pub struct ApiContract {
module_name : String
version : String
entries : Array[ApiEntry]
} derive(Eq,
Debug
)

#
ApiContract::brandbook

fn ApiContract::brandbook() -> ApiContract

#
ApiContract::contains

fn ApiContract::contains(self : ApiContract, name : String) -> Bool

#
ApiContract::entry

fn ApiContract::entry(self : ApiContract, name : String) -> ApiEntry?

#
ApiContract::kinds

fn ApiContract::kinds(self : ApiContract) -> Array[String]

#
ApiContract::len

fn ApiContract::len(self : ApiContract) -> Int

#
ApiContract::names

fn ApiContract::names(self : ApiContract) -> Array[String]

#
ApiContract::release_notes

fn ApiContract::release_notes(self : ApiContract, previous : ApiContract) -> Array[String]

#
ApiContract::to_json

fn ApiContract::to_json(self : ApiContract) -> String

#
ApiContract::to_markdown

fn ApiContract::to_markdown(self : ApiContract) -> String

#
ApiEntry

pub struct ApiEntry {
name : String
kind : String
description : String
since : String
} derive(Eq,
Debug
)

A small machine-readable description of the stable public surface.

#
ApiEntry::new

fn ApiEntry::new(name : String, kind : String, description : String, since : String) -> ApiEntry

#
ApiEntry::to_json

fn ApiEntry::to_json(self : ApiEntry) -> String

#
ApiEntry::to_markdown

fn ApiEntry::to_markdown(self : ApiEntry) -> String

#
AssetPolicy

pub struct AssetPolicy {
allowed_extensions : Array[String]
min_width_px : Int
max_path_length : Int
reject_parent_segments : Bool
require_primary_asset : Bool
} derive(Eq,
Debug
)

#
AssetPolicy::default

fn AssetPolicy::default() -> AssetPolicy

#
AssetPolicy::strict

fn AssetPolicy::strict() -> AssetPolicy

#
AssetPolicy::with_min_width

fn AssetPolicy::with_min_width(self : AssetPolicy, width : Int) -> AssetPolicy

#
AssetSet

pub struct AssetSet {
primary_logo : Logo
alternate_logos : Array[Logo]
imagery_style : String
} derive(Eq,
Debug
)

#
AssetSet::all_paths

fn AssetSet::all_paths(self : AssetSet) -> Array[String]

#
AssetSet::audit

fn AssetSet::audit(self : AssetSet, policy : AssetPolicy) -> AuditReport

#
AssetSet::to_asset_index

fn AssetSet::to_asset_index(self : AssetSet) -> String

#
AssetSet::to_asset_manifest

fn AssetSet::to_asset_manifest(self : AssetSet) -> String

#
AssetSet::to_html

fn AssetSet::to_html(self : AssetSet) -> String

#
AuditReport

pub struct AuditReport {
findings : Array[Finding]
} derive(Eq,
Debug
)

#
AuditReport::contains_path

fn AuditReport::contains_path(self : AuditReport, path : String) -> Bool

#
AuditReport::error_count

fn AuditReport::error_count(self : AuditReport) -> Int

#
AuditReport::from_findings

fn AuditReport::from_findings(findings : Array[Finding]) -> AuditReport

#
AuditReport::has_errors

fn AuditReport::has_errors(self : AuditReport) -> Bool

#
AuditReport::info_count

fn AuditReport::info_count(self : AuditReport) -> Int

#
AuditReport::paths

fn AuditReport::paths(self : AuditReport) -> Array[String]

#
AuditReport::summary

fn AuditReport::summary(self : AuditReport) -> String

#
AuditReport::to_markdown

fn AuditReport::to_markdown(self : AuditReport) -> String

#
AuditReport::warning_count

fn AuditReport::warning_count(self : AuditReport) -> Int

#
BackgroundRule

pub enum BackgroundRule {
LightOnly
DarkOnly
LightOrDark
Monochrome
} derive(Eq,
Debug
)

#
BackgroundRule::describe

fn BackgroundRule::describe(self : BackgroundRule) -> String

#
BackgroundRule::light_or_dark

fn BackgroundRule::light_or_dark() -> BackgroundRule

#
BenchmarkMeasurement

pub struct BenchmarkMeasurement {
name : String
operations : Int
token_count : Int
input_bytes : Int
output_bytes : Int
elapsed_units : UInt64
} derive(Eq,
Debug
)

#
BenchmarkReport

pub struct BenchmarkReport {
toolchain : String
measurements : Array[BenchmarkMeasurement]
} derive(Eq,
Debug
)

#
BenchmarkReport::is_comparable

fn BenchmarkReport::is_comparable(self : BenchmarkReport) -> Bool

#
BenchmarkReport::largest_input

#
BenchmarkReport::measurement_named

fn BenchmarkReport::measurement_named(self : BenchmarkReport, name : String) -> BenchmarkMeasurement?

#
BenchmarkReport::scenario_names

fn BenchmarkReport::scenario_names(self : BenchmarkReport) -> Array[String]

#
BenchmarkReport::slowest

#
BenchmarkReport::summary

#
BenchmarkReport::summary_json

fn BenchmarkReport::summary_json(self : BenchmarkReport) -> String

#
BenchmarkReport::summary_markdown

fn BenchmarkReport::summary_markdown(self : BenchmarkReport) -> String

#
BenchmarkReport::to_markdown

fn BenchmarkReport::to_markdown(self : BenchmarkReport) -> String

#
BenchmarkSummary

pub struct BenchmarkSummary {
scenarios : Int
total_operations : Int
total_tokens : Int
total_input_bytes : Int
total_output_bytes : Int
total_elapsed_units : UInt64
fastest_scenario : String
largest_scenario : String
} derive(Eq,
Debug
)

Derived benchmark statistics used in human-readable performance reports.

#
BenchmarkSummary::average_input_bytes

fn BenchmarkSummary::average_input_bytes(self : BenchmarkSummary) -> Int

#
BenchmarkSummary::average_output_bytes

fn BenchmarkSummary::average_output_bytes(self : BenchmarkSummary) -> Int

#
BenchmarkSummary::average_tokens

fn BenchmarkSummary::average_tokens(self : BenchmarkSummary) -> Int

#
BenchmarkSummary::is_measured

fn BenchmarkSummary::is_measured(self : BenchmarkSummary) -> Bool

#
BenchmarkSummary::output_expansion_percent

fn BenchmarkSummary::output_expansion_percent(self : BenchmarkSummary) -> Int

#
BenchmarkSummary::to_json

fn BenchmarkSummary::to_json(self : BenchmarkSummary) -> String

#
BenchmarkSummary::to_markdown

fn BenchmarkSummary::to_markdown(self : BenchmarkSummary) -> String

#
BoundaryCase

pub struct BoundaryCase {
name : String
input : String
expected_valid : Bool
focus : String
} derive(Eq,
Debug
)

Reusable boundary cases for callers that want a predictable preflight suite.

#
BoundaryCase::is_empty

fn BoundaryCase::is_empty(self : BoundaryCase) -> Bool

#
BoundaryCase::new

fn BoundaryCase::new(name : String, input : String, expected_valid : Bool, focus : String) -> BoundaryCase

#
BoundaryCase::to_markdown

fn BoundaryCase::to_markdown(self : BoundaryCase) -> String

#
BoundaryResult

pub struct BoundaryResult {
case_name : String
expected_valid : Bool
actual_valid : Bool
diagnostics : String
} derive(Eq,
Debug
)

#
BoundaryResult::passed

fn BoundaryResult::passed(self : BoundaryResult) -> Bool

#
BoundaryResult::to_markdown

fn BoundaryResult::to_markdown(self : BoundaryResult) -> String

#
BoundarySuite

pub struct BoundarySuite {
name : String
cases : Array[BoundaryCase]
} derive(Eq,
Debug
)

#
BoundarySuite::case_names

fn BoundarySuite::case_names(self : BoundarySuite) -> Array[String]

#
BoundarySuite::document_edges

fn BoundarySuite::document_edges() -> BoundarySuite

#
BoundarySuite::failures

#
BoundarySuite::len

fn BoundarySuite::len(self : BoundarySuite) -> Int

#
BoundarySuite::new

fn BoundarySuite::new(name : String, cases : Array[BoundaryCase]) -> BoundarySuite

#
BoundarySuite::parser_edges

fn BoundarySuite::parser_edges() -> BoundarySuite

#
BoundarySuite::passed

fn BoundarySuite::passed(self : BoundarySuite) -> Bool

#
BoundarySuite::run

#
BoundarySuite::to_json

fn BoundarySuite::to_json(self : BoundarySuite) -> String

#
BoundarySuite::to_markdown

fn BoundarySuite::to_markdown(self : BoundarySuite) -> String

#
BrandBook

pub struct BrandBook {
name : String
tagline : String
voice : Voice
assets : AssetSet
palette : Palette
typography : Typography
components : Array[ComponentSpec]
forbidden : Array[MisuseRule]
metadata : Meta
} derive(Eq,
Debug
)

#
BrandBook::accessibility_score

fn BrandBook::accessibility_score(self : BrandBook) -> Int

#
BrandBook::asset_health

fn BrandBook::asset_health(self : BrandBook) -> Int

#
BrandBook::audit

fn BrandBook::audit(self : BrandBook) -> AuditReport

#
BrandBook::audit_components

fn BrandBook::audit_components(self : BrandBook, policy : ComponentPolicy) -> AuditReport

#
BrandBook::audit_content

fn BrandBook::audit_content(self : BrandBook, policy : ContentPolicy) -> ContentReport

#
BrandBook::component_contracts_markdown

fn BrandBook::component_contracts_markdown(self : BrandBook) -> String

#
BrandBook::component_names

fn BrandBook::component_names(self : BrandBook) -> Array[String]

#
BrandBook::component_score

fn BrandBook::component_score(self : BrandBook) -> Int

#
BrandBook::component_state_names

fn BrandBook::component_state_names(self : BrandBook) -> Array[String]

#
BrandBook::component_token_names

fn BrandBook::component_token_names(self : BrandBook) -> Array[String]

#
BrandBook::components_using_token

fn BrandBook::components_using_token(self : BrandBook, token : String) -> Array[String]

#
BrandBook::content_is_ready

fn BrandBook::content_is_ready(self : BrandBook) -> Bool

#
BrandBook::content_json

fn BrandBook::content_json(self : BrandBook) -> String

#
BrandBook::content_markdown

fn BrandBook::content_markdown(self : BrandBook) -> String

#
BrandBook::content_score

fn BrandBook::content_score(self : BrandBook) -> Int

#
BrandBook::diff_theme

fn BrandBook::diff_theme(self : BrandBook, other : BrandBook) -> ThemeDiff

#
BrandBook::export_manifest_json

fn BrandBook::export_manifest_json(self : BrandBook) -> String

#
BrandBook::export_manifest_markdown

fn BrandBook::export_manifest_markdown(self : BrandBook) -> String

#
BrandBook::find_component

fn BrandBook::find_component(self : BrandBook, name : String) -> ComponentSpec?

#
BrandBook::find_components_by_state

fn BrandBook::find_components_by_state(self : BrandBook, state : String) -> Array[ComponentSpec]

#
BrandBook::find_components_by_token

fn BrandBook::find_components_by_token(self : BrandBook, token : String) -> Array[ComponentSpec]

#
BrandBook::find_misuse

fn BrandBook::find_misuse(self : BrandBook, title : String) -> MisuseRule?

#
BrandBook::guide_outline

fn BrandBook::guide_outline(self : BrandBook) -> GuideOutline

#
BrandBook::guide_toc

fn BrandBook::guide_toc(self : BrandBook) -> String

#
BrandBook::is_publishable

fn BrandBook::is_publishable(self : BrandBook) -> Bool

#
BrandBook::is_release_ready

fn BrandBook::is_release_ready(self : BrandBook) -> Bool

#
BrandBook::missing_references

fn BrandBook::missing_references(self : BrandBook) -> Array[String]

#
BrandBook::misuse_titles

fn BrandBook::misuse_titles(self : BrandBook) -> Array[String]

#
BrandBook::pipeline

fn BrandBook::pipeline(self : BrandBook) -> PipelineResult

#
BrandBook::principles

fn BrandBook::principles(self : BrandBook) -> Array[String]

#
BrandBook::quality_score

fn BrandBook::quality_score(self : BrandBook) -> Int

#
BrandBook::reference_graph

fn BrandBook::reference_graph(self : BrandBook) -> ReferenceGraph

#
BrandBook::release_markdown

fn BrandBook::release_markdown(self : BrandBook) -> String

#
BrandBook::release_report

fn BrandBook::release_report(self : BrandBook, policy : ReleasePolicy) -> ReleaseReport

#
BrandBook::render_bundle

fn BrandBook::render_bundle(self : BrandBook) -> RenderBundle

#
BrandBook::render_code_examples

fn BrandBook::render_code_examples(self : BrandBook) -> String

#
BrandBook::render_color_section

fn BrandBook::render_color_section(self : BrandBook) -> String

#
BrandBook::render_component_catalog

fn BrandBook::render_component_catalog(self : BrandBook) -> String

#
BrandBook::render_component_section

fn BrandBook::render_component_section(self : BrandBook) -> String

#
BrandBook::render_css_layers

fn BrandBook::render_css_layers(self : BrandBook) -> String

#
BrandBook::render_css_reset

fn BrandBook::render_css_reset() -> String

#
BrandBook::render_full_markdown

fn BrandBook::render_full_markdown(self : BrandBook) -> String

#
BrandBook::render_html_accessibility_panel

fn BrandBook::render_html_accessibility_panel(self : BrandBook) -> String

#
BrandBook::render_html_component_catalog

fn BrandBook::render_html_component_catalog(self : BrandBook) -> String

#
BrandBook::render_html_manifest_panel

fn BrandBook::render_html_manifest_panel(self : BrandBook) -> String

#
BrandBook::render_html_reference_tables

fn BrandBook::render_html_reference_tables(self : BrandBook) -> String

#
BrandBook::render_html_theme_panel

fn BrandBook::render_html_theme_panel(self : BrandBook) -> String

#
BrandBook::render_html_voice_panel

fn BrandBook::render_html_voice_panel(self : BrandBook) -> String

#
BrandBook::render_json_example

fn BrandBook::render_json_example(self : BrandBook) -> String

#
BrandBook::render_logo_section

fn BrandBook::render_logo_section(self : BrandBook) -> String

#
BrandBook::render_metadata_panel

fn BrandBook::render_metadata_panel(self : BrandBook) -> String

#
BrandBook::render_misuse_section

fn BrandBook::render_misuse_section(self : BrandBook) -> String

#
BrandBook::render_reference_tables

fn BrandBook::render_reference_tables(self : BrandBook) -> String

#
BrandBook::render_section

fn BrandBook::render_section(self : BrandBook, section : String) -> String

#
BrandBook::render_typography_section

fn BrandBook::render_typography_section(self : BrandBook) -> String

#
BrandBook::render_voice_section

fn BrandBook::render_voice_section(self : BrandBook) -> String

#
BrandBook::render_yaml_example

fn BrandBook::render_yaml_example(self : BrandBook) -> String

#
BrandBook::search_tokens

fn BrandBook::search_tokens(self : BrandBook, query : String) -> Array[CatalogEntry]

#
BrandBook::theme_document

fn BrandBook::theme_document(self : BrandBook) -> ThemeDocument

#
BrandBook::to_accessibility_markdown

fn BrandBook::to_accessibility_markdown(self : BrandBook) -> String

#
BrandBook::to_css

fn BrandBook::to_css(self : BrandBook) -> String

#
BrandBook::to_figma_tokens

fn BrandBook::to_figma_tokens(self : BrandBook) -> String

#
BrandBook::to_html

fn BrandBook::to_html(self : BrandBook) -> String

#
BrandBook::to_html_navigation

fn BrandBook::to_html_navigation(self : BrandBook) -> String

#
BrandBook::to_markdown

fn BrandBook::to_markdown(self : BrandBook) -> String

#
BrandBook::to_markdown_toc

fn BrandBook::to_markdown_toc(self : BrandBook) -> String

#
BrandBook::to_tailwind_theme

fn BrandBook::to_tailwind_theme(self : BrandBook) -> String

#
BrandBook::to_theme_json

fn BrandBook::to_theme_json(self : BrandBook) -> String

#
BrandBook::to_theme_yaml

fn BrandBook::to_theme_yaml(self : BrandBook) -> String

#
BrandBook::token_catalog_markdown

fn BrandBook::token_catalog_markdown(self : BrandBook) -> String

#
BrandBook::token_catalog_stats

fn BrandBook::token_catalog_stats(self : BrandBook) -> CatalogStats

#
BrandBook::validate_with_policy

fn BrandBook::validate_with_policy(self : BrandBook, policy : ValidationPolicy) -> AuditReport

#
BrandDocumentResult

pub struct BrandDocumentResult {
value : BrandBook?
diagnostics : DiagnosticBag
} derive(Eq,
Debug
)

#
BrandQualityReport

pub struct BrandQualityReport {
score : Int
dimensions : Array[QualityDimension]
audit : AuditReport
} derive(Eq,
Debug
)

#
BrandQualityReport::action_items

fn BrandQualityReport::action_items(self : BrandQualityReport) -> Array[String]

#
BrandQualityReport::audit_markdown

fn BrandQualityReport::audit_markdown(self : BrandQualityReport) -> String

#
BrandQualityReport::dimension

fn BrandQualityReport::dimension(self : BrandQualityReport, name : String) -> QualityDimension?

#
BrandQualityReport::dimension_names

fn BrandQualityReport::dimension_names(self : BrandQualityReport) -> Array[String]

#
BrandQualityReport::from_brand_book

fn BrandQualityReport::from_brand_book(book : BrandBook) -> BrandQualityReport

#
BrandQualityReport::passed

fn BrandQualityReport::passed(self : BrandQualityReport, threshold : Int) -> Bool

#
BrandQualityReport::score_label

fn BrandQualityReport::score_label(self : BrandQualityReport) -> String

#
BrandQualityReport::strongest_dimension

fn BrandQualityReport::strongest_dimension(self : BrandQualityReport) -> QualityDimension?

#
BrandQualityReport::to_badges

fn BrandQualityReport::to_badges(self : BrandQualityReport) -> Array[String]

#
BrandQualityReport::to_json

fn BrandQualityReport::to_json(self : BrandQualityReport) -> String

#
BrandQualityReport::to_markdown

fn BrandQualityReport::to_markdown(self : BrandQualityReport) -> String

#
BrandQualityReport::weakest_dimension

fn BrandQualityReport::weakest_dimension(self : BrandQualityReport) -> QualityDimension?

#
BrandTemplate

pub struct BrandTemplate {
name : String
description : String
tags : Array[String]
} derive(Eq,
Debug
)

Deterministic, reusable starter brand books for examples and integration tests.

#
BrandTemplate::dark_variant

fn BrandTemplate::dark_variant(book : BrandBook) -> BrandBook

#
BrandTemplate::describe

fn BrandTemplate::describe() -> String

#
BrandTemplate::is_named

fn BrandTemplate::is_named(self : BrandTemplate, name : String) -> Bool

#
BrandTemplate::light_variant

fn BrandTemplate::light_variant(book : BrandBook) -> BrandBook

#
BrandTemplate::metadata

fn BrandTemplate::metadata() -> BrandTemplate

#
BrandTemplate::minimal

fn BrandTemplate::minimal() -> BrandBook

#
BrandTemplate::new

fn BrandTemplate::new(name : String, description : String, tags : Array[String]) -> BrandTemplate

#
BrandTemplate::tagged

fn BrandTemplate::tagged(self : BrandTemplate, tag : String) -> Bool

#
BrandTemplate::template_names

fn BrandTemplate::template_names() -> Array[String]

#
BrandTemplate::to_json

fn BrandTemplate::to_json(self : BrandTemplate) -> String

#
BrandTemplate::to_markdown

fn BrandTemplate::to_markdown(self : BrandTemplate) -> String

#
BrandTemplate::with_accent

fn BrandTemplate::with_accent(book : BrandBook, name : String, value : String, role : String) -> BrandBook

#
BrandTemplate::with_name

fn BrandTemplate::with_name(book : BrandBook, name : String) -> BrandBook

#
BrandTemplate::with_palette

fn BrandTemplate::with_palette(book : BrandBook, palette : Palette) -> BrandBook

#
BrandTemplate::with_tagline

fn BrandTemplate::with_tagline(book : BrandBook, tagline : String) -> BrandBook

#
CatalogEntry

pub struct CatalogEntry {
path : String
name : String
kind : TokenKind
value : ThemeValue
description : String
} derive(Eq,
Debug
)

#
CatalogEntry::from_theme_token

fn CatalogEntry::from_theme_token(token : ThemeToken) -> CatalogEntry

#
CatalogStats

pub struct CatalogStats {
total : Int
color_count : Int
number_count : Int
text_count : Int
boolean_count : Int
described_count : Int
} derive(Eq,
Debug
)

#
CatalogStats::documentation_rate

fn CatalogStats::documentation_rate(self : CatalogStats) -> Int

#
CatalogStats::summary

fn CatalogStats::summary(self : CatalogStats) -> String

#
CliCommand

pub enum CliCommand {
Help
Version
Demo
Validate
Render
Benchmark
} derive(Eq,
Debug
)

#
CliCommand::render

fn CliCommand::render() -> CliCommand

#
CliFormat

pub enum CliFormat {
Markdown
Html
Css
Json
Yaml
Tailwind
Figma
} derive(Eq,
Debug
)

#
CliFormat::css

fn CliFormat::css() -> CliFormat

#
CliFormat::figma

fn CliFormat::figma() -> CliFormat

#
CliFormat::html

fn CliFormat::html() -> CliFormat

#
CliFormat::json

fn CliFormat::json() -> CliFormat

#
CliFormat::markdown

fn CliFormat::markdown() -> CliFormat

#
CliFormat::tailwind

fn CliFormat::tailwind() -> CliFormat

#
CliFormat::yaml

fn CliFormat::yaml() -> CliFormat

#
CliParseResult

pub struct CliParseResult {
request : CliRequest?
errors : Array[String]
} derive(Eq,
Debug
)

#
CliRequest

pub struct CliRequest {
command : CliCommand
format : CliFormat
input : String
input_path : String
output : String
} derive(Eq,
Debug
)

#
CliRequest::new

fn CliRequest::new(command : CliCommand, format : CliFormat, input : String, output : String) -> CliRequest

#
CliResult

pub struct CliResult {
output : String
errors : Array[String]
exit_code : Int
} derive(Eq,
Debug
)

#
ColorToken

pub struct ColorToken {
name : String
value : String
role : String
} derive(Eq,
Debug
)

#
ColorToken::blend_with

fn ColorToken::blend_with(self : ColorToken, other : ColorToken, percent : Int) -> ColorToken

#
ColorToken::can_be_text_on

fn ColorToken::can_be_text_on(self : ColorToken, background : ColorToken) -> Bool

#
ColorToken::contrast_against

fn ColorToken::contrast_against(self : ColorToken, background : ColorToken) -> ContrastPair

#
ColorToken::css_var

fn ColorToken::css_var(self : ColorToken) -> String

#
ColorToken::darken

fn ColorToken::darken(self : ColorToken, percent : Int) -> ColorToken

#
ColorToken::hex

fn ColorToken::hex(name : String, value : String, role~ : String) -> ColorToken

#
ColorToken::is_dark

fn ColorToken::is_dark(self : ColorToken) -> Bool

#
ColorToken::is_light

fn ColorToken::is_light(self : ColorToken) -> Bool

#
ColorToken::lighten

fn ColorToken::lighten(self : ColorToken, percent : Int) -> ColorToken

#
ColorToken::relative_luminance_x10000

fn ColorToken::relative_luminance_x10000(self : ColorToken) -> Int

#
ColorToken::rgb

fn ColorToken::rgb(self : ColorToken) -> RgbColor?

#
ComponentPolicy

pub struct ComponentPolicy {
min_anatomy_parts : Int
min_states : Int
min_tokens : Int
require_purpose : Bool
require_focus_state : Bool
require_disabled_state : Bool
} derive(Eq,
Debug
)

Validation policy for component contracts.

#
ComponentPolicy::default

#
ComponentPolicy::requiring_disabled

fn ComponentPolicy::requiring_disabled(self : ComponentPolicy, required : Bool) -> ComponentPolicy

#
ComponentPolicy::requiring_focus

fn ComponentPolicy::requiring_focus(self : ComponentPolicy, required : Bool) -> ComponentPolicy

#
ComponentPolicy::strict

#
ComponentPolicy::with_minimums

fn ComponentPolicy::with_minimums(self : ComponentPolicy, anatomy : Int, states : Int, tokens : Int) -> ComponentPolicy

#
ComponentSpec

pub struct ComponentSpec {
name : String
purpose : String
anatomy : Array[String]
tokens : Array[String]
states : Array[String]
} derive(Eq,
Debug
)

#
ComponentSpec::anatomy_names

fn ComponentSpec::anatomy_names(self : ComponentSpec) -> Array[String]

#
ComponentSpec::audit

fn ComponentSpec::audit(self : ComponentSpec, policy : ComponentPolicy, path : String) -> AuditReport

#
ComponentSpec::contract_json

fn ComponentSpec::contract_json(self : ComponentSpec) -> String

#
ComponentSpec::contract_markdown

fn ComponentSpec::contract_markdown(self : ComponentSpec) -> String

#
ComponentSpec::has_state

fn ComponentSpec::has_state(self : ComponentSpec, state : String) -> Bool

#
ComponentSpec::has_token

fn ComponentSpec::has_token(self : ComponentSpec, token : String) -> Bool

#
ComponentSpec::is_documented

fn ComponentSpec::is_documented(self : ComponentSpec) -> Bool

#
ComponentSpec::quality_score

fn ComponentSpec::quality_score(self : ComponentSpec) -> Int

#
ComponentSpec::render_anatomy_list

fn ComponentSpec::render_anatomy_list(self : ComponentSpec) -> String

#
ComponentSpec::render_state_matrix

fn ComponentSpec::render_state_matrix(self : ComponentSpec) -> String

#
ComponentSpec::render_token_checklist

fn ComponentSpec::render_token_checklist(self : ComponentSpec) -> String

#
ComponentSpec::render_usage_card

fn ComponentSpec::render_usage_card(self : ComponentSpec) -> String

#
ComponentSpec::slug

fn ComponentSpec::slug(self : ComponentSpec) -> String

#
ComponentSpec::state_matrix

fn ComponentSpec::state_matrix(self : ComponentSpec) -> Array[String]

#
ComponentSpec::state_names

fn ComponentSpec::state_names(self : ComponentSpec) -> Array[String]

#
ComponentSpec::to_html

fn ComponentSpec::to_html(self : ComponentSpec) -> String

#
ComponentSpec::to_html_card

fn ComponentSpec::to_html_card(self : ComponentSpec) -> String

#
ComponentSpec::to_html_state_list

fn ComponentSpec::to_html_state_list(self : ComponentSpec) -> String

#
ComponentSpec::to_markdown

fn ComponentSpec::to_markdown(self : ComponentSpec) -> String

#
ComponentSpec::token_names

fn ComponentSpec::token_names(self : ComponentSpec) -> Array[String]

#
ComponentSpec::token_usage

fn ComponentSpec::token_usage(self : ComponentSpec, token : String) -> String

#
ContentPolicy

pub struct ContentPolicy {
min_principles : Int
min_misuse_rules : Int
require_imagery_guidance : Bool
require_tagline : Bool
forbid_placeholder_words : Bool
} derive(Eq,
Debug
)

A focused content-health check for brand guidance that is not captured by token schema validation alone.

#
ContentPolicy::allowing_placeholders

fn ContentPolicy::allowing_placeholders(self : ContentPolicy, allowed : Bool) -> ContentPolicy

#
ContentPolicy::default

fn ContentPolicy::default() -> ContentPolicy

#
ContentPolicy::requiring_imagery

fn ContentPolicy::requiring_imagery(self : ContentPolicy, required : Bool) -> ContentPolicy

#
ContentPolicy::strict

#
ContentPolicy::with_minimums

fn ContentPolicy::with_minimums(self : ContentPolicy, principles : Int, misuse_rules : Int) -> ContentPolicy

#
ContentReport

pub struct ContentReport {
score : Int
findings : Array[Finding]
suggestions : Array[String]
} derive(Eq,
Debug
)

#
ContentReport::has_errors

fn ContentReport::has_errors(self : ContentReport) -> Bool

#
ContentReport::summary

fn ContentReport::summary(self : ContentReport) -> String

#
ContentReport::to_json

fn ContentReport::to_json(self : ContentReport) -> String

#
ContentReport::to_markdown

fn ContentReport::to_markdown(self : ContentReport) -> String

#
ContrastGrade

pub enum ContrastGrade {
Fail
AaLarge
Aa
Aaa
} derive(Eq,
Debug
)

#
ContrastGrade::label

fn ContrastGrade::label(self : ContrastGrade) -> String

#
ContrastPair

pub struct ContrastPair {
foreground : ColorToken
background : ColorToken
ratio_x100 : Int
grade : ContrastGrade
} derive(Eq,
Debug
)

#
ContrastPair::describe

fn ContrastPair::describe(self : ContrastPair) -> String

#
ContrastPair::passes

fn ContrastPair::passes(self : ContrastPair, policy : AccessibilityPolicy) -> Bool

#
ContrastPair::passes_large_text

fn ContrastPair::passes_large_text(self : ContrastPair, policy : AccessibilityPolicy) -> Bool

#
ContrastPair::ratio_text

fn ContrastPair::ratio_text(self : ContrastPair) -> String

#
CssExportOptions

pub struct CssExportOptions {
selector : String
include_comment : Bool
} derive(Eq,
Debug
)

#
CssExportOptions::default

#
Diagnostic

pub struct Diagnostic {
severity : DiagnosticSeverity
path : String
message : String
location : SourceLocation?
} derive(Eq,
Debug
)

#
Diagnostic::error

fn Diagnostic::error(path : String, message : String, location : SourceLocation?) -> Diagnostic

#
Diagnostic::location_text

fn Diagnostic::location_text(self : Diagnostic) -> String

#
Diagnostic::note

fn Diagnostic::note(path : String, message : String) -> Diagnostic

#
Diagnostic::to_json

fn Diagnostic::to_json(self : Diagnostic) -> String

#
Diagnostic::to_markdown

fn Diagnostic::to_markdown(self : Diagnostic) -> String

#
Diagnostic::to_text

fn Diagnostic::to_text(self : Diagnostic) -> String

#
Diagnostic::warning

fn Diagnostic::warning(path : String, message : String, location : SourceLocation?) -> Diagnostic

#
DiagnosticBag

pub struct DiagnosticBag {
items : Array[Diagnostic]
} derive(Eq,
Debug
)

#
DiagnosticBag::empty

#
DiagnosticBag::errors

#
DiagnosticBag::has_errors

fn DiagnosticBag::has_errors(self : DiagnosticBag) -> Bool

#
DiagnosticBag::merge

#
DiagnosticBag::notes

#
DiagnosticBag::push

fn DiagnosticBag::push(self : DiagnosticBag, diagnostic : Diagnostic) -> DiagnosticBag

#
DiagnosticBag::sorted

#
DiagnosticBag::summary

fn DiagnosticBag::summary(self : DiagnosticBag) -> String

#
DiagnosticBag::to_json

fn DiagnosticBag::to_json(self : DiagnosticBag) -> String

#
DiagnosticBag::to_markdown

fn DiagnosticBag::to_markdown(self : DiagnosticBag) -> String

#
DiagnosticBag::to_text

fn DiagnosticBag::to_text(self : DiagnosticBag) -> String

#
DiagnosticBag::warnings

fn DiagnosticBag::warnings(self : DiagnosticBag) -> Array[Diagnostic]

#
DiagnosticSeverity

pub enum DiagnosticSeverity {
Note
Warning
Error
} derive(Eq,
Debug
)

#
DiagnosticSeverity::label

fn DiagnosticSeverity::label(self : DiagnosticSeverity) -> String

#
DocumentFormat

pub enum DocumentFormat {
Auto
Json
Yaml
} derive(Eq,
Debug
)

#
DocumentFormat::auto

#
DocumentFormat::json

#
DocumentFormat::yaml

#
ExportEntry

pub struct ExportEntry {
name : String
format : String
extension : String
output_bytes : Int
description : String
} derive(Eq,
Debug
)

#
ExportEntry::new

fn ExportEntry::new(name : String, format : String, extension : String, output_bytes : Int, description : String) -> ExportEntry

#
ExportManifest

pub struct ExportManifest {
project : String
version : String
entries : Array[ExportEntry]
} derive(Eq,
Debug
)

#
ExportManifest::add

#
ExportManifest::empty

fn ExportManifest::empty(project : String, version : String) -> ExportManifest

#
ExportManifest::for_brand_book

fn ExportManifest::for_brand_book(book : BrandBook) -> ExportManifest

#
ExportManifest::formats

fn ExportManifest::formats(self : ExportManifest) -> Array[String]

#
ExportManifest::len

fn ExportManifest::len(self : ExportManifest) -> Int

#
ExportManifest::to_json

fn ExportManifest::to_json(self : ExportManifest) -> String

#
ExportManifest::to_markdown

fn ExportManifest::to_markdown(self : ExportManifest) -> String

#
ExportManifest::total_bytes

fn ExportManifest::total_bytes(self : ExportManifest) -> Int

#
Finding

pub struct Finding {
severity : Severity
path : String
message : String
} derive(Eq,
Debug
)

#
Finding::info

fn Finding::info(path : String, message : String) -> Finding

#
FontToken

pub struct FontToken {
name : String
fallback : String
usage : String
} derive(Eq,
Debug
)

#
FontToken::css_family

fn FontToken::css_family(self : FontToken) -> String

#
FontToken::css_variable_name

fn FontToken::css_variable_name(self : FontToken) -> String

#
FontToken::fallback_chain

fn FontToken::fallback_chain(self : FontToken) -> Array[String]

#
FontToken::has_fallback

fn FontToken::has_fallback(self : FontToken) -> Bool

#
FontToken::usage_label

fn FontToken::usage_label(self : FontToken) -> String

#
GradientToken

pub struct GradientToken {
name : String
stops : Array[String]
angle : Int
usage : String
} derive(Eq,
Debug
)

#
GradientToken::to_css_value

fn GradientToken::to_css_value(self : GradientToken) -> String

#
GuideOutline

pub struct GuideOutline {
title : String
sections : Array[GuideSection]
} derive(Eq,
Debug
)

#
GuideOutline::add

fn GuideOutline::add(self : GuideOutline, section : GuideSection) -> GuideOutline

#
GuideOutline::empty

fn GuideOutline::empty(title : String) -> GuideOutline

#
GuideOutline::find

fn GuideOutline::find(self : GuideOutline, id : String) -> GuideSection?

#
GuideOutline::for_brand_book

fn GuideOutline::for_brand_book(book : BrandBook) -> GuideOutline

#
GuideOutline::ids

fn GuideOutline::ids(self : GuideOutline) -> Array[String]

#
GuideOutline::len

fn GuideOutline::len(self : GuideOutline) -> Int

#
GuideOutline::non_empty

fn GuideOutline::non_empty(self : GuideOutline) -> Array[GuideSection]

#
GuideOutline::to_json

fn GuideOutline::to_json(self : GuideOutline) -> String

#
GuideOutline::to_markdown

fn GuideOutline::to_markdown(self : GuideOutline) -> String

#
GuideOutline::to_toc

fn GuideOutline::to_toc(self : GuideOutline) -> String

#
GuideSection

pub struct GuideSection {
id : String
title : String
summary : String
body : String
order : Int
} derive(Eq,
Debug
)

A structured outline for generated brand guides and documentation consumers.

#
GuideSection::anchor

fn GuideSection::anchor(self : GuideSection) -> String

#
GuideSection::is_empty

fn GuideSection::is_empty(self : GuideSection) -> Bool

#
GuideSection::new

fn GuideSection::new(id : String, title : String, summary : String, body : String, order : Int) -> GuideSection

#
GuideSection::to_json

fn GuideSection::to_json(self : GuideSection) -> String

#
GuideSection::to_markdown

fn GuideSection::to_markdown(self : GuideSection) -> String

#
JsonPair

pub struct JsonPair {
key : String
value : JsonValue
} derive(Eq,
Debug
)

#
JsonPair::new

fn JsonPair::new(key : String, value : JsonValue) -> JsonPair

#
JsonParseResult

pub struct JsonParseResult {
value : JsonValue?
diagnostics : DiagnosticBag
} derive(Eq,
Debug
)

#
JsonValue

pub enum JsonValue {
JNull
JBool(Bool)
JNumber(String)
JString(String)
JArray(Array[JsonValue])
JObject(Array[JsonPair])
} derive(Eq,
Debug
)

#
JsonValue::array_value

fn JsonValue::array_value(self : JsonValue) -> Array[JsonValue]?

#
JsonValue::number_value

fn JsonValue::number_value(self : JsonValue) -> String?

#
JsonValue::object_field

fn JsonValue::object_field(self : JsonValue, key : String) -> JsonValue?

#
JsonValue::object_value

fn JsonValue::object_value(self : JsonValue) -> Array[JsonPair]?

#
JsonValue::string

fn JsonValue::string(value : String) -> JsonValue

#
JsonValue::string_value

fn JsonValue::string_value(self : JsonValue) -> String?

pub struct Logo {
name : String
path : String
min_width_px : Int
clear_space : Space
background : BackgroundRule
} derive(Eq,
Debug
)

#
Logo::audit

fn Logo::audit(self : Logo, policy : AssetPolicy) -> AuditReport

#
Logo::extension

fn Logo::extension(self : Logo) -> String

#
Logo::is_raster

fn Logo::is_raster(self : Logo) -> Bool

#
Logo::is_vector

fn Logo::is_vector(self : Logo) -> Bool

#
Logo::new

fn Logo::new(name : String, path : String, min_width_px : Int, clear_space : Space, background : BackgroundRule) -> Logo

#
Logo::to_html

fn Logo::to_html(self : Logo) -> String

#
Logo::to_markdown

fn Logo::to_markdown(self : Logo) -> String

#
Meta

pub struct Meta {
source : String
maintainer : String
license : String
} derive(Eq,
Debug
)

#
Meta::is_complete

fn Meta::is_complete(self : Meta) -> Bool

#
Meta::is_publishable

fn Meta::is_publishable(self : Meta) -> Bool

#
Meta::summary

fn Meta::summary(self : Meta) -> String

#
Meta::to_json

fn Meta::to_json(self : Meta) -> String

#
MisuseRule

pub struct MisuseRule {
title : String
reason : String
replacement : String
} derive(Eq,
Debug
)

#
MisuseRule::is_actionable

fn MisuseRule::is_actionable(self : MisuseRule) -> Bool

#
MisuseRule::to_html

fn MisuseRule::to_html(self : MisuseRule) -> String

#
MisuseRule::to_json

fn MisuseRule::to_json(self : MisuseRule) -> String

#
MisuseRule::to_markdown

fn MisuseRule::to_markdown(self : MisuseRule) -> String

#
Palette

pub struct Palette {
colors : Array[ColorToken]
gradients : Array[GradientToken]
} derive(Eq,
Debug
)

#
Palette::audit_contrast

fn Palette::audit_contrast(self : Palette, policy : AccessibilityPolicy) -> AuditReport

#
Palette::color_named

fn Palette::color_named(self : Palette, name : String) -> ColorToken?

#
Palette::color_names

fn Palette::color_names(self : Palette) -> Array[String]

#
Palette::contrast_matrix_markdown

fn Palette::contrast_matrix_markdown(self : Palette) -> String

#
Palette::contrast_pairs

fn Palette::contrast_pairs(self : Palette) -> Array[ContrastPair]

#
Palette::dark_colors

fn Palette::dark_colors(self : Palette) -> Array[ColorToken]

#
Palette::dark_variant

fn Palette::dark_variant(self : Palette, percent : Int) -> Palette

#
Palette::hex_values

fn Palette::hex_values(self : Palette) -> Array[String]

#
Palette::light_colors

fn Palette::light_colors(self : Palette) -> Array[ColorToken]

#
Palette::light_variant

fn Palette::light_variant(self : Palette, percent : Int) -> Palette

#
Palette::nearest_color

fn Palette::nearest_color(self : Palette, value : RgbColor) -> ColorToken?

#
Palette::recommended_text_color

fn Palette::recommended_text_color(self : Palette, background : ColorToken) -> ColorToken?

#
Palette::render_color_table

fn Palette::render_color_table(self : Palette) -> String

#
Palette::render_css_layer

fn Palette::render_css_layer(self : Palette) -> String

#
Palette::render_gradient_table

fn Palette::render_gradient_table(self : Palette) -> String

#
Palette::render_html_color_table

fn Palette::render_html_color_table(self : Palette) -> String

#
Palette::to_css

fn Palette::to_css(self : Palette, options? : CssExportOptions) -> String

#
Palette::to_html

fn Palette::to_html(self : Palette) -> String

#
Palette::to_markdown

fn Palette::to_markdown(self : Palette) -> String

#
Palette::validate_colors

fn Palette::validate_colors(self : Palette) -> AuditReport

#
PipelineEvent

pub struct PipelineEvent {
stage : PipelineStage
passed : Bool
message : String
} derive(Eq,
Debug
)

#
PipelineEvent::new

fn PipelineEvent::new(stage : PipelineStage, passed : Bool, message : String) -> PipelineEvent

#
PipelineEvent::status

fn PipelineEvent::status(self : PipelineEvent) -> String

#
PipelineResult

pub struct PipelineResult {
value : BrandBook?
events : Array[PipelineEvent]
diagnostics : DiagnosticBag
exports : RenderBundle?
} derive(Eq,
Debug
)

#
PipelineResult::event

#
PipelineResult::event_count

fn PipelineResult::event_count(self : PipelineResult) -> Int

#
PipelineResult::failed_events

fn PipelineResult::failed_events(self : PipelineResult) -> Array[PipelineEvent]

#
PipelineResult::succeeded

fn PipelineResult::succeeded(self : PipelineResult) -> Bool

#
PipelineResult::summary

fn PipelineResult::summary(self : PipelineResult) -> String

#
PipelineResult::to_json

fn PipelineResult::to_json(self : PipelineResult) -> String

#
PipelineResult::to_markdown

fn PipelineResult::to_markdown(self : PipelineResult) -> String

#
PipelineStage

pub enum PipelineStage {
ReadInput
ParseDocument
ValidateSchema
ValidateAccessibility
ValidateContent
BuildExports
} derive(Eq,
Debug
)

The import pipeline keeps parsing, policy validation, and rendering as explicit stages so callers can inspect partial failures.

#
PipelineStage::label

fn PipelineStage::label(self : PipelineStage) -> String

#
PipelineStage::ordinal

fn PipelineStage::ordinal(self : PipelineStage) -> Int

#
PolicyCatalog

pub struct PolicyCatalog {
name : String
rules : Array[PolicyRule]
} derive(Eq,
Debug
)

#
PolicyCatalog::all_ids_non_empty

fn PolicyCatalog::all_ids_non_empty(self : PolicyCatalog) -> Bool

#
PolicyCatalog::all_rationales_non_empty

fn PolicyCatalog::all_rationales_non_empty(self : PolicyCatalog) -> Bool

#
PolicyCatalog::brandbook

fn PolicyCatalog::brandbook() -> PolicyCatalog

#
PolicyCatalog::checklist

fn PolicyCatalog::checklist(self : PolicyCatalog) -> Array[String]

#
PolicyCatalog::ci_message

fn PolicyCatalog::ci_message(self : PolicyCatalog) -> String

#
PolicyCatalog::compact_json

fn PolicyCatalog::compact_json(self : PolicyCatalog) -> String

#
PolicyCatalog::contains

fn PolicyCatalog::contains(self : PolicyCatalog, id : String) -> Bool

#
PolicyCatalog::coverage_label

fn PolicyCatalog::coverage_label(self : PolicyCatalog) -> String

#
PolicyCatalog::coverage_score

fn PolicyCatalog::coverage_score(self : PolicyCatalog) -> Int

#
PolicyCatalog::critical_ids

fn PolicyCatalog::critical_ids(self : PolicyCatalog) -> Array[String]

#
PolicyCatalog::error_count

fn PolicyCatalog::error_count(self : PolicyCatalog) -> Int

#
PolicyCatalog::errors

#
PolicyCatalog::filter_severity

fn PolicyCatalog::filter_severity(self : PolicyCatalog, severity : String) -> Array[PolicyRule]

#
PolicyCatalog::first_error

fn PolicyCatalog::first_error(self : PolicyCatalog) -> PolicyRule?

#
PolicyCatalog::first_rule

fn PolicyCatalog::first_rule(self : PolicyCatalog) -> PolicyRule?

#
PolicyCatalog::has_errors

fn PolicyCatalog::has_errors(self : PolicyCatalog) -> Bool

#
PolicyCatalog::has_required_sections

fn PolicyCatalog::has_required_sections(self : PolicyCatalog) -> Bool

#
PolicyCatalog::has_rule_with_title

fn PolicyCatalog::has_rule_with_title(self : PolicyCatalog, title : String) -> Bool

#
PolicyCatalog::has_warnings

fn PolicyCatalog::has_warnings(self : PolicyCatalog) -> Bool

#
PolicyCatalog::ids_markdown

fn PolicyCatalog::ids_markdown(self : PolicyCatalog) -> String

#
PolicyCatalog::is_complete

fn PolicyCatalog::is_complete(self : PolicyCatalog) -> Bool

#
PolicyCatalog::is_empty

fn PolicyCatalog::is_empty(self : PolicyCatalog) -> Bool

#
PolicyCatalog::json_rule_ids

fn PolicyCatalog::json_rule_ids(self : PolicyCatalog) -> String

#
PolicyCatalog::last_rule

fn PolicyCatalog::last_rule(self : PolicyCatalog) -> PolicyRule?

#
PolicyCatalog::len

fn PolicyCatalog::len(self : PolicyCatalog) -> Int

#
PolicyCatalog::markdown_checklist

fn PolicyCatalog::markdown_checklist(self : PolicyCatalog) -> String

#
PolicyCatalog::name_text

fn PolicyCatalog::name_text(self : PolicyCatalog) -> String

#
PolicyCatalog::note_count

fn PolicyCatalog::note_count(self : PolicyCatalog) -> Int

#
PolicyCatalog::rationales

fn PolicyCatalog::rationales(self : PolicyCatalog) -> Array[String]

#
PolicyCatalog::rationales_markdown

fn PolicyCatalog::rationales_markdown(self : PolicyCatalog) -> String

#
PolicyCatalog::ready

fn PolicyCatalog::ready(self : PolicyCatalog) -> Bool

#
PolicyCatalog::ready_for_ci

fn PolicyCatalog::ready_for_ci(self : PolicyCatalog) -> Bool

#
PolicyCatalog::ready_summary

fn PolicyCatalog::ready_summary(self : PolicyCatalog) -> String

#
PolicyCatalog::rule

fn PolicyCatalog::rule(self : PolicyCatalog, id : String) -> PolicyRule?

#
PolicyCatalog::rule_at

fn PolicyCatalog::rule_at(self : PolicyCatalog, index : Int) -> PolicyRule?

#
PolicyCatalog::rule_count_for

fn PolicyCatalog::rule_count_for(self : PolicyCatalog, severity : String) -> Int

#
PolicyCatalog::rule_for_path

fn PolicyCatalog::rule_for_path(self : PolicyCatalog, path : String) -> PolicyRule?

#
PolicyCatalog::rule_ids

fn PolicyCatalog::rule_ids(self : PolicyCatalog) -> Array[String]

#
PolicyCatalog::rule_ids_csv

fn PolicyCatalog::rule_ids_csv(self : PolicyCatalog) -> String

#
PolicyCatalog::rule_titles_csv

fn PolicyCatalog::rule_titles_csv(self : PolicyCatalog) -> String

#
PolicyCatalog::rule_titles_markdown

fn PolicyCatalog::rule_titles_markdown(self : PolicyCatalog) -> String

#
PolicyCatalog::search

fn PolicyCatalog::search(self : PolicyCatalog, text : String) -> Array[PolicyRule]

#
PolicyCatalog::search_ids

fn PolicyCatalog::search_ids(self : PolicyCatalog, text : String) -> Array[String]

#
PolicyCatalog::severity_counts

fn PolicyCatalog::severity_counts(self : PolicyCatalog) -> Array[Int]

#
PolicyCatalog::severity_labels

fn PolicyCatalog::severity_labels(self : PolicyCatalog) -> Array[String]

#
PolicyCatalog::severity_summary

fn PolicyCatalog::severity_summary(self : PolicyCatalog) -> String

#
PolicyCatalog::status

fn PolicyCatalog::status(self : PolicyCatalog) -> String

#
PolicyCatalog::status_line

fn PolicyCatalog::status_line(self : PolicyCatalog) -> String

#
PolicyCatalog::summary

fn PolicyCatalog::summary(self : PolicyCatalog) -> String

#
PolicyCatalog::titles

fn PolicyCatalog::titles(self : PolicyCatalog) -> Array[String]

#
PolicyCatalog::to_json

fn PolicyCatalog::to_json(self : PolicyCatalog) -> String

#
PolicyCatalog::to_markdown

fn PolicyCatalog::to_markdown(self : PolicyCatalog) -> String

#
PolicyCatalog::unique_severities

fn PolicyCatalog::unique_severities(self : PolicyCatalog) -> Array[String]

#
PolicyCatalog::warning_count

fn PolicyCatalog::warning_count(self : PolicyCatalog) -> Int

#
PolicyCatalog::warnings

fn PolicyCatalog::warnings(self : PolicyCatalog) -> Array[PolicyRule]

#
PolicyRule

pub struct PolicyRule {
id : String
title : String
rationale : String
severity : String
} derive(Eq,
Debug
)

Explainable policy metadata keeps CI failures actionable for humans.

#
PolicyRule::new

fn PolicyRule::new(id : String, title : String, rationale : String, severity : String) -> PolicyRule

#
PolicyRule::to_json

fn PolicyRule::to_json(self : PolicyRule) -> String

#
PolicyRule::to_markdown

fn PolicyRule::to_markdown(self : PolicyRule) -> String

#
QualityDimension

pub struct QualityDimension {
name : String
score : Int
summary : String
} derive(Eq,
Debug
)

One independently scored health dimension in a brand book review.

#
QualityDimension::label

fn QualityDimension::label(self : QualityDimension) -> String

#
QualityDimension::new

fn QualityDimension::new(name : String, score : Int, summary : String) -> QualityDimension

#
QualityDimension::passed

fn QualityDimension::passed(self : QualityDimension, threshold : Int) -> Bool

#
QualityDimension::to_json

fn QualityDimension::to_json(self : QualityDimension) -> String

#
ReferenceEdge

pub struct ReferenceEdge {
source : String
target : String
kind : ReferenceKind
} derive(Eq,
Debug
)

#
ReferenceGraph

pub struct ReferenceGraph {
edges : Array[ReferenceEdge]
} derive(Eq,
Debug
)

#
ReferenceGraph::add

fn ReferenceGraph::add(self : ReferenceGraph, source : String, target : String, kind : ReferenceKind) -> ReferenceGraph

#
ReferenceGraph::add_alias

fn ReferenceGraph::add_alias(self : ReferenceGraph, source : String, target : String) -> ReferenceGraph

#
ReferenceGraph::edge_count

fn ReferenceGraph::edge_count(self : ReferenceGraph) -> Int

#
ReferenceGraph::edges_of

#
ReferenceGraph::empty

#
ReferenceGraph::missing_targets

fn ReferenceGraph::missing_targets(self : ReferenceGraph, known : Array[String]) -> Array[String]

#
ReferenceGraph::node_count

fn ReferenceGraph::node_count(self : ReferenceGraph) -> Int

#
ReferenceGraph::sources_for

fn ReferenceGraph::sources_for(self : ReferenceGraph, target : String) -> Array[String]

#
ReferenceGraph::targets_for

fn ReferenceGraph::targets_for(self : ReferenceGraph, source : String) -> Array[String]

#
ReferenceGraph::to_markdown

fn ReferenceGraph::to_markdown(self : ReferenceGraph) -> String

#
ReferenceKind

pub enum ReferenceKind {
ComponentToken
ComponentState
PaletteRole
ThemeAlias
} derive(Eq,
Debug
)

#
ReleaseCheck

pub struct ReleaseCheck {
name : String
passed : Bool
message : String
} derive(Eq,
Debug
)

#
ReleaseCheck::new

fn ReleaseCheck::new(name : String, passed : Bool, message : String) -> ReleaseCheck

#
ReleaseCheck::status

fn ReleaseCheck::status(self : ReleaseCheck) -> String

#
ReleasePolicy

pub struct ReleasePolicy {
minimum_score : Int
require_accessibility : Bool
require_content : Bool
require_non_empty_exports : Bool
required_formats : Array[String]
} derive(Eq,
Debug
)

Release gates that combine validation, content, accessibility, and export checks.

#
ReleasePolicy::default

fn ReleasePolicy::default() -> ReleasePolicy

#
ReleasePolicy::strict

#
ReleasePolicy::with_content_requirement

fn ReleasePolicy::with_content_requirement(self : ReleasePolicy, required : Bool) -> ReleasePolicy

#
ReleasePolicy::with_formats

fn ReleasePolicy::with_formats(self : ReleasePolicy, formats : Array[String]) -> ReleasePolicy

#
ReleasePolicy::with_minimum_score

fn ReleasePolicy::with_minimum_score(self : ReleasePolicy, score : Int) -> ReleasePolicy

#
ReleaseReport

pub struct ReleaseReport {
ready : Bool
checks : Array[ReleaseCheck]
score : Int
} derive(Eq,
Debug
)

#
ReleaseReport::check_named

fn ReleaseReport::check_named(self : ReleaseReport, name : String) -> ReleaseCheck?

#
ReleaseReport::failed_checks

fn ReleaseReport::failed_checks(self : ReleaseReport) -> Array[ReleaseCheck]

#
ReleaseReport::passed

fn ReleaseReport::passed(self : ReleaseReport) -> Bool

#
ReleaseReport::passed_checks

fn ReleaseReport::passed_checks(self : ReleaseReport) -> Array[ReleaseCheck]

#
ReleaseReport::summary

fn ReleaseReport::summary(self : ReleaseReport) -> String

#
ReleaseReport::to_json

fn ReleaseReport::to_json(self : ReleaseReport) -> String

#
ReleaseReport::to_markdown

fn ReleaseReport::to_markdown(self : ReleaseReport) -> String

#
RenderArtifact

pub struct RenderArtifact {
name : String
format : String
content : String
} derive(Eq,
Debug
)

Named render artifacts allow integrations to consume one deterministic bundle.

#
RenderArtifact::bytes

fn RenderArtifact::bytes(self : RenderArtifact) -> Int

#
RenderArtifact::file_name

fn RenderArtifact::file_name(self : RenderArtifact) -> String

#
RenderArtifact::header

fn RenderArtifact::header(self : RenderArtifact) -> String

#
RenderArtifact::is_empty

fn RenderArtifact::is_empty(self : RenderArtifact) -> Bool

#
RenderArtifact::new

fn RenderArtifact::new(name : String, format : String, content : String) -> RenderArtifact

#
RenderBundle

pub struct RenderBundle {
name : String
artifacts : Array[RenderArtifact]
} derive(Eq,
Debug
)

#
RenderBundle::add

fn RenderBundle::add(self : RenderBundle, artifact : RenderArtifact) -> RenderBundle

#
RenderBundle::artifact

fn RenderBundle::artifact(self : RenderBundle, name : String, format : String) -> RenderArtifact?

#
RenderBundle::artifact_names

fn RenderBundle::artifact_names(self : RenderBundle) -> Array[String]

#
RenderBundle::empty

fn RenderBundle::empty(name : String) -> RenderBundle

#
RenderBundle::for_brand_book

fn RenderBundle::for_brand_book(book : BrandBook) -> RenderBundle

#
RenderBundle::formats

fn RenderBundle::formats(self : RenderBundle) -> Array[String]

#
RenderBundle::is_empty

fn RenderBundle::is_empty(self : RenderBundle) -> Bool

#
RenderBundle::len

fn RenderBundle::len(self : RenderBundle) -> Int

#
RenderBundle::manifest_json

fn RenderBundle::manifest_json(self : RenderBundle) -> String

#
RenderBundle::manifest_markdown

fn RenderBundle::manifest_markdown(self : RenderBundle) -> String

#
RenderBundle::non_empty

fn RenderBundle::non_empty(self : RenderBundle) -> Array[RenderArtifact]

#
RenderBundle::total_bytes

fn RenderBundle::total_bytes(self : RenderBundle) -> Int

#
RgbColor

pub struct RgbColor {
red : Int
green : Int
blue : Int
} derive(Eq,
Debug
)

An integer RGB value used for deterministic token analysis.

#
RgbColor::average

fn RgbColor::average(self : RgbColor, other : RgbColor) -> RgbColor

#
RgbColor::black

fn RgbColor::black() -> RgbColor

#
RgbColor::blend

fn RgbColor::blend(self : RgbColor, other : RgbColor, percent : Int) -> RgbColor

#
RgbColor::channel

fn RgbColor::channel(self : RgbColor, name : String) -> Int?

#
RgbColor::complementary

fn RgbColor::complementary(self : RgbColor) -> RgbColor

#
RgbColor::contrast_ratio_x100

fn RgbColor::contrast_ratio_x100(self : RgbColor, other : RgbColor) -> Int

#
RgbColor::darken

fn RgbColor::darken(self : RgbColor, percent : Int) -> RgbColor

#
RgbColor::describe

fn RgbColor::describe(self : RgbColor) -> String

#
RgbColor::distance_to

fn RgbColor::distance_to(self : RgbColor, other : RgbColor) -> Int

#
RgbColor::from_hex

fn RgbColor::from_hex(value : String) -> RgbColor?

#
RgbColor::inverted

fn RgbColor::inverted(self : RgbColor) -> RgbColor

#
RgbColor::is_dark

fn RgbColor::is_dark(self : RgbColor) -> Bool

#
RgbColor::is_grayscale

fn RgbColor::is_grayscale(self : RgbColor) -> Bool

#
RgbColor::is_light

fn RgbColor::is_light(self : RgbColor) -> Bool

#
RgbColor::lighten

fn RgbColor::lighten(self : RgbColor, percent : Int) -> RgbColor

#
RgbColor::luminance_x10000

fn RgbColor::luminance_x10000(self : RgbColor) -> Int

#
RgbColor::new

fn RgbColor::new(red : Int, green : Int, blue : Int) -> RgbColor

#
RgbColor::same_as

fn RgbColor::same_as(self : RgbColor, other : RgbColor) -> Bool

#
RgbColor::to_css_rgb

fn RgbColor::to_css_rgb(self : RgbColor) -> String

#
RgbColor::to_hex

fn RgbColor::to_hex(self : RgbColor) -> String

#
RgbColor::white

fn RgbColor::white() -> RgbColor

#
RgbColor::with_blue

fn RgbColor::with_blue(self : RgbColor, blue : Int) -> RgbColor

#
RgbColor::with_green

fn RgbColor::with_green(self : RgbColor, green : Int) -> RgbColor

#
RgbColor::with_red

fn RgbColor::with_red(self : RgbColor, red : Int) -> RgbColor

#
Severity

pub enum Severity {
Info
Warning
Error
} derive(Eq,
Debug
)

#
Severity::label

fn Severity::label(self : Severity) -> String

#
SourceLocation

pub struct SourceLocation {
line : Int
column : Int
offset : Int
} derive(Eq,
Debug
)

#
SourceLocation::new

fn SourceLocation::new(line : Int, column : Int, offset : Int) -> SourceLocation

#
SourceLocation::to_string

fn SourceLocation::to_string(self : SourceLocation) -> String

#
Space

pub enum Space {
Pixels(Int)
Multiplier(Double)
} derive(Eq,
Debug
)

#
Space::describe

fn Space::describe(self : Space) -> String

#
Space::multiplier

fn Space::multiplier(value : Double) -> Space

#
Space::pixels

fn Space::pixels(value : Int) -> Space

#
ThemeAlias

pub struct ThemeAlias {
name : TokenPath
target : TokenPath
} derive(Eq,
Debug
)

#
ThemeChange

pub struct ThemeChange {
path : String
before : ThemeToken
after : ThemeToken
} derive(Eq,
Debug
)

#
ThemeDiff

pub struct ThemeDiff {
added : Array[ThemeToken]
removed : Array[ThemeToken]
changed : Array[ThemeChange]
} derive(Eq,
Debug
)

#
ThemeDiff::between

fn ThemeDiff::between(before : ThemeDocument, after : ThemeDocument) -> ThemeDiff

#
ThemeDiff::change_count

fn ThemeDiff::change_count(self : ThemeDiff) -> Int

#
ThemeDiff::has_breaking_changes

fn ThemeDiff::has_breaking_changes(self : ThemeDiff) -> Bool

#
ThemeDiff::is_empty

fn ThemeDiff::is_empty(self : ThemeDiff) -> Bool

#
ThemeDiff::migration_steps

fn ThemeDiff::migration_steps(self : ThemeDiff) -> Array[String]

#
ThemeDiff::summary

fn ThemeDiff::summary(self : ThemeDiff) -> String

#
ThemeDiff::to_markdown

fn ThemeDiff::to_markdown(self : ThemeDiff) -> String

#
ThemeDocument

pub struct ThemeDocument {
tokens : Array[ThemeToken]
aliases : Array[ThemeAlias]
provenance : Array[ThemeProvenance]
} derive(Eq,
Debug
)

#
ThemeDocument::add

#
ThemeDocument::audit_theme

fn ThemeDocument::audit_theme(self : ThemeDocument, policy : ThemePolicy) -> AuditReport

#
ThemeDocument::color_tokens

fn ThemeDocument::color_tokens(self : ThemeDocument) -> Array[ThemeToken]

#
ThemeDocument::description_rate

fn ThemeDocument::description_rate(self : ThemeDocument) -> Int

#
ThemeDocument::descriptions

fn ThemeDocument::descriptions(self : ThemeDocument) -> Array[String]

#
ThemeDocument::documentation_rate

fn ThemeDocument::documentation_rate(self : ThemeDocument) -> Int

#
ThemeDocument::empty

#
ThemeDocument::find

fn ThemeDocument::find(self : ThemeDocument, path : String) -> ThemeToken?

#
ThemeDocument::has_duplicate_paths

fn ThemeDocument::has_duplicate_paths(self : ThemeDocument) -> Bool

#
ThemeDocument::has_kind

fn ThemeDocument::has_kind(self : ThemeDocument, kind : TokenKind) -> Bool

#
ThemeDocument::has_only_documented_tokens

fn ThemeDocument::has_only_documented_tokens(self : ThemeDocument) -> Bool

#
ThemeDocument::kind_counts

fn ThemeDocument::kind_counts(self : ThemeDocument) -> Array[Int]

#
ThemeDocument::kind_label_counts

fn ThemeDocument::kind_label_counts(self : ThemeDocument) -> Array[String]

#
ThemeDocument::layer_for

fn ThemeDocument::layer_for(self : ThemeDocument, path : String) -> Int?

#
ThemeDocument::map_paths

fn ThemeDocument::map_paths(self : ThemeDocument, transform : ThemeTransform) -> ThemeDocument

#
ThemeDocument::merge_layers

fn ThemeDocument::merge_layers(layers : Array[ThemeDocument]) -> ThemeDocument

#
ThemeDocument::metric_json

fn ThemeDocument::metric_json(self : ThemeDocument) -> String

#
ThemeDocument::metric_markdown

fn ThemeDocument::metric_markdown(self : ThemeDocument) -> String

#
ThemeDocument::metrics

#
ThemeDocument::number_tokens

fn ThemeDocument::number_tokens(self : ThemeDocument) -> Array[ThemeToken]

#
ThemeDocument::only_kind

fn ThemeDocument::only_kind(self : ThemeDocument, kind : TokenKind) -> ThemeDocument

#
ThemeDocument::override_token

fn ThemeDocument::override_token(self : ThemeDocument, token : ThemeToken, source : String) -> ThemeDocument

#
ThemeDocument::paths

fn ThemeDocument::paths(self : ThemeDocument) -> Array[String]

#
ThemeDocument::paths_for_kind

fn ThemeDocument::paths_for_kind(self : ThemeDocument, kind : TokenKind) -> Array[String]

#
ThemeDocument::provenance

fn ThemeDocument::provenance(self : ThemeDocument, path : String) -> String?

#
ThemeDocument::rename_prefix

fn ThemeDocument::rename_prefix(self : ThemeDocument, from : String, to : String) -> ThemeDocument

#
ThemeDocument::select_prefix

fn ThemeDocument::select_prefix(self : ThemeDocument, prefix : String) -> ThemeDocument

#
ThemeDocument::select_prefix_kind

fn ThemeDocument::select_prefix_kind(self : ThemeDocument, prefix : String) -> ThemeDocument

#
ThemeDocument::sorted

#
ThemeDocument::to_figma

fn ThemeDocument::to_figma(self : ThemeDocument) -> String

#
ThemeDocument::to_json

fn ThemeDocument::to_json(self : ThemeDocument, pretty? : Bool) -> String

#
ThemeDocument::to_path_list

fn ThemeDocument::to_path_list(self : ThemeDocument) -> String

#
ThemeDocument::to_summary_markdown

fn ThemeDocument::to_summary_markdown(self : ThemeDocument) -> String

#
ThemeDocument::to_tailwind

fn ThemeDocument::to_tailwind(self : ThemeDocument) -> String

#
ThemeDocument::to_yaml

fn ThemeDocument::to_yaml(self : ThemeDocument) -> String

#
ThemeDocument::token_count

fn ThemeDocument::token_count(self : ThemeDocument) -> Int

#
ThemeDocument::undocumented_paths

fn ThemeDocument::undocumented_paths(self : ThemeDocument) -> Array[String]

#
ThemeDocument::value_for

fn ThemeDocument::value_for(self : ThemeDocument, path : String) -> ThemeValue?

#
ThemeDocument::values_for_kind

fn ThemeDocument::values_for_kind(self : ThemeDocument, kind : TokenKind) -> Array[ThemeValue]

#
ThemeDocument::with_alias

fn ThemeDocument::with_alias(self : ThemeDocument, name : String, target : String) -> ThemeDocument

#
ThemeDocument::with_prefix

fn ThemeDocument::with_prefix(self : ThemeDocument, prefix : String) -> ThemeDocument

#
ThemeDocument::with_source

fn ThemeDocument::with_source(self : ThemeDocument, source : String) -> ThemeDocument

#
ThemeDocument::without_prefix

fn ThemeDocument::without_prefix(self : ThemeDocument, prefix : String) -> ThemeDocument

#
ThemePolicy

pub struct ThemePolicy {
require_descriptions : Bool
require_unique_paths : Bool
allowed_prefix : String
min_color_tokens : Int
reject_empty_values : Bool
} derive(Eq,
Debug
)

#
ThemePolicy::default

fn ThemePolicy::default() -> ThemePolicy

#
ThemePolicy::strict

fn ThemePolicy::strict() -> ThemePolicy

#
ThemePolicy::with_prefix

fn ThemePolicy::with_prefix(self : ThemePolicy, prefix : String) -> ThemePolicy

#
ThemeProvenance

pub struct ThemeProvenance {
path : String
layer : Int
source : String
} derive(Eq,
Debug
)

#
ThemeProvenance::new

fn ThemeProvenance::new(path : String, layer : Int, source : String) -> ThemeProvenance

#
ThemeToken

pub struct ThemeToken {
path : TokenPath
kind : TokenKind
value : ThemeValue
description : String
} derive(Eq,
Debug
)

#
ThemeToken::boolean

fn ThemeToken::boolean(path : String, value : Bool, description : String) -> ThemeToken

#
ThemeToken::color

fn ThemeToken::color(path : String, value : String, description : String) -> ThemeToken

#
ThemeToken::is_empty

fn ThemeToken::is_empty(self : ThemeToken) -> Bool

#
ThemeToken::is_valid

fn ThemeToken::is_valid(self : ThemeToken) -> Bool

#
ThemeToken::number

fn ThemeToken::number(path : String, value : Int, description : String) -> ThemeToken

#
ThemeToken::text

fn ThemeToken::text(path : String, value : String, description : String) -> ThemeToken

#
ThemeTransform

pub enum ThemeTransform {
Prefix(String)
Rename(String, String)
FilterKind(TokenKind)
DropPrefix(String)
} derive(Eq,
Debug
)

Transformations for turning a theme document into stable variants without losing descriptions or aliases.

#
ThemeTransform::drop_prefix

fn ThemeTransform::drop_prefix(value : String) -> ThemeTransform

#
ThemeTransform::filter_kind

fn ThemeTransform::filter_kind(kind : TokenKind) -> ThemeTransform

#
ThemeTransform::prefix

fn ThemeTransform::prefix(value : String) -> ThemeTransform

#
ThemeTransform::rename

fn ThemeTransform::rename(from : String, to : String) -> ThemeTransform

#
ThemeValue

pub enum ThemeValue {
ColorValue(String)
NumberValue(Int)
TextValue(String)
BooleanValue(Bool)
} derive(Eq,
Debug
)

#
TokenCatalog

pub struct TokenCatalog {
entries : Array[CatalogEntry]
} derive(Eq,
Debug
)

#
TokenCatalog::add

#
TokenCatalog::booleans

fn TokenCatalog::booleans(self : TokenCatalog) -> Array[CatalogEntry]

#
TokenCatalog::by_kind

fn TokenCatalog::by_kind(self : TokenCatalog, kind : TokenKind) -> Array[CatalogEntry]

#
TokenCatalog::by_prefix

fn TokenCatalog::by_prefix(self : TokenCatalog, prefix : String) -> Array[CatalogEntry]

#
TokenCatalog::colors

#
TokenCatalog::contains

fn TokenCatalog::contains(self : TokenCatalog, path : String) -> Bool

#
TokenCatalog::empty

fn TokenCatalog::empty() -> TokenCatalog

#
TokenCatalog::entries

#
TokenCatalog::find

fn TokenCatalog::find(self : TokenCatalog, path : String) -> CatalogEntry?

#
TokenCatalog::from_brand_book

fn TokenCatalog::from_brand_book(book : BrandBook) -> TokenCatalog

#
TokenCatalog::from_theme_document

fn TokenCatalog::from_theme_document(document : ThemeDocument) -> TokenCatalog

#
TokenCatalog::grouped_markdown

fn TokenCatalog::grouped_markdown(self : TokenCatalog) -> String

#
TokenCatalog::is_empty

fn TokenCatalog::is_empty(self : TokenCatalog) -> Bool

#
TokenCatalog::len

fn TokenCatalog::len(self : TokenCatalog) -> Int

#
TokenCatalog::names

fn TokenCatalog::names(self : TokenCatalog) -> Array[String]

#
TokenCatalog::names_for_query

fn TokenCatalog::names_for_query(self : TokenCatalog, query : String) -> Array[String]

#
TokenCatalog::numbers

#
TokenCatalog::paths

fn TokenCatalog::paths(self : TokenCatalog) -> Array[String]

#
TokenCatalog::paths_for_prefix

fn TokenCatalog::paths_for_prefix(self : TokenCatalog, prefix : String) -> Array[String]

#
TokenCatalog::query

fn TokenCatalog::query(self : TokenCatalog, query : TokenQuery) -> Array[CatalogEntry]

#
TokenCatalog::search

fn TokenCatalog::search(self : TokenCatalog, query : String) -> Array[CatalogEntry]

#
TokenCatalog::stats

#
TokenCatalog::texts

#
TokenCatalog::to_markdown

fn TokenCatalog::to_markdown(self : TokenCatalog) -> String

#
TokenKind

pub enum TokenKind {
Color
Number
Text
Boolean
} derive(Eq,
Debug
)

#
TokenMetrics

pub struct TokenMetrics {
total : Int
colors : Int
numbers : Int
texts : Int
booleans : Int
aliases : Int
documented : Int
empty_values : Int
} derive(Eq,
Debug
)

Distribution metrics for reviewing a theme before it is exported.

#
TokenMetrics::density_score

fn TokenMetrics::density_score(self : TokenMetrics) -> Int

#
TokenMetrics::documentation_rate

fn TokenMetrics::documentation_rate(self : TokenMetrics) -> Int

#
TokenMetrics::empty_rate

fn TokenMetrics::empty_rate(self : TokenMetrics) -> Int

#
TokenMetrics::is_healthy

fn TokenMetrics::is_healthy(self : TokenMetrics) -> Bool

#
TokenMetrics::kind_count

fn TokenMetrics::kind_count(self : TokenMetrics, kind : TokenKind) -> Int

#
TokenMetrics::to_json

fn TokenMetrics::to_json(self : TokenMetrics) -> String

#
TokenMetrics::to_markdown

fn TokenMetrics::to_markdown(self : TokenMetrics) -> String

#
TokenPath

pub struct TokenPath {
segments : Array[String]
} derive(Eq,
Debug
)

#
TokenPath::canonical

fn TokenPath::canonical(self : TokenPath) -> String

#
TokenPath::css_name

fn TokenPath::css_name(self : TokenPath, prefix : String) -> String

#
TokenPath::from_string

fn TokenPath::from_string(text : String) -> TokenPath

#
TokenPath::is_empty

fn TokenPath::is_empty(self : TokenPath) -> Bool

#
TokenPath::new

fn TokenPath::new(segments : Array[String]) -> TokenPath

#
TokenQuery

pub struct TokenQuery {
kind : TokenKind?
prefix : String
text : String
value : String
} derive(Eq,
Debug
)

#
TokenQuery::empty

fn TokenQuery::empty() -> TokenQuery

#
TokenQuery::parse

fn TokenQuery::parse(text : String) -> TokenQuery

#
TokenQuery::with_kind

fn TokenQuery::with_kind(self : TokenQuery, kind : TokenKind) -> TokenQuery

#
TokenQuery::with_prefix

fn TokenQuery::with_prefix(self : TokenQuery, prefix : String) -> TokenQuery

#
TokenQuery::with_text

fn TokenQuery::with_text(self : TokenQuery, text : String) -> TokenQuery

#
TypeStep

pub struct TypeStep {
name : String
size_px : Int
line_height_px : Int
} derive(Eq,
Debug
)

#
TypeStep::css_line_height

fn TypeStep::css_line_height(self : TypeStep) -> String

#
TypeStep::css_size

fn TypeStep::css_size(self : TypeStep) -> String

#
TypeStep::css_variable_name

fn TypeStep::css_variable_name(self : TypeStep) -> String

#
TypeStep::description

fn TypeStep::description(self : TypeStep) -> String

#
TypeStep::is_accessible

fn TypeStep::is_accessible(self : TypeStep) -> Bool

#
TypeStep::is_valid

fn TypeStep::is_valid(self : TypeStep, policy : TypographyPolicy) -> Bool

#
TypeStep::line_gap

fn TypeStep::line_gap(self : TypeStep) -> Int

#
TypeStep::ratio_to

fn TypeStep::ratio_to(self : TypeStep, other : TypeStep) -> Int

#
TypeStep::ratio_x100

fn TypeStep::ratio_x100(self : TypeStep) -> Int

#
Typography

pub struct Typography {
families : Array[FontToken]
scale : Array[TypeStep]
} derive(Eq,
Debug
)

#
Typography::accessible_step_count

fn Typography::accessible_step_count(self : Typography) -> Int

#
Typography::audit_rhythm

fn Typography::audit_rhythm(self : Typography, policy : TypographyPolicy) -> AuditReport

#
Typography::average_line_ratio

fn Typography::average_line_ratio(self : Typography) -> Int

#
Typography::css_variable_map

fn Typography::css_variable_map(self : Typography) -> String

#
Typography::family_for_usage

fn Typography::family_for_usage(self : Typography, usage : String) -> FontToken?

#
Typography::family_names

fn Typography::family_names(self : Typography) -> Array[String]

#
Typography::font_stack

fn Typography::font_stack(self : Typography, name : String) -> String

#
Typography::has_step

fn Typography::has_step(self : Typography, name : String) -> Bool

#
Typography::is_valid

fn Typography::is_valid(self : Typography) -> Bool

#
Typography::largest_step

fn Typography::largest_step(self : Typography) -> TypeStep?

#
Typography::render_family_table

fn Typography::render_family_table(self : Typography) -> String

#
Typography::render_html_scale_table

fn Typography::render_html_scale_table(self : Typography) -> String

#
Typography::render_scale_table

fn Typography::render_scale_table(self : Typography) -> String

#
Typography::scale_names

fn Typography::scale_names(self : Typography) -> Array[String]

#
Typography::smallest_step

fn Typography::smallest_step(self : Typography) -> TypeStep?

#
Typography::step_named

fn Typography::step_named(self : Typography, name : String) -> TypeStep?

#
Typography::to_css

fn Typography::to_css(self : Typography, selector? : String) -> String

#
Typography::to_html

fn Typography::to_html(self : Typography) -> String

#
Typography::to_markdown

fn Typography::to_markdown(self : Typography) -> String

#
Typography::to_scale_markdown

fn Typography::to_scale_markdown(self : Typography) -> String

#
Typography::total_rhythm_units

fn Typography::total_rhythm_units(self : Typography) -> Int

#
Typography::validate_scale

fn Typography::validate_scale(self : Typography) -> AuditReport

#
TypographyPolicy

pub struct TypographyPolicy {
min_size_px : Int
max_size_px : Int
min_line_height_px : Int
min_line_ratio_x100 : Int
max_line_ratio_x100 : Int
require_fallback : Bool
require_monotonic_scale : Bool
} derive(Eq,
Debug
)

Policy used when checking a type scale for readable production output.

#
TypographyPolicy::default

#
TypographyPolicy::strict

#
TypographyPolicy::with_fallback_requirement

fn TypographyPolicy::with_fallback_requirement(self : TypographyPolicy, required : Bool) -> TypographyPolicy

#
TypographyPolicy::with_line_ratio_bounds

fn TypographyPolicy::with_line_ratio_bounds(self : TypographyPolicy, minimum_x100 : Int, maximum_x100 : Int) -> TypographyPolicy

#
TypographyPolicy::with_monotonic_requirement

fn TypographyPolicy::with_monotonic_requirement(self : TypographyPolicy, required : Bool) -> TypographyPolicy

#
TypographyPolicy::with_size_bounds

fn TypographyPolicy::with_size_bounds(self : TypographyPolicy, minimum : Int, maximum : Int) -> TypographyPolicy

#
ValidationPolicy

pub struct ValidationPolicy {
min_colors : Int
min_component_states : Int
min_logo_width : Int
require_metadata_license : Bool
require_component_tokens : Bool
} derive(Eq,
Debug
)

#
ValidationPolicy::default

#
ValidationPolicy::strict

#
ValidationPolicy::with_min_colors

fn ValidationPolicy::with_min_colors(self : ValidationPolicy, count : Int) -> ValidationPolicy

#
ValidationPolicy::with_min_logo_width

fn ValidationPolicy::with_min_logo_width(self : ValidationPolicy, width : Int) -> ValidationPolicy

#
Voice

pub struct Voice {
tone : String
writing_principles : Array[String]
} derive(Eq,
Debug
)

#
Voice::has_principle

fn Voice::has_principle(self : Voice, phrase : String) -> Bool

#
Voice::is_complete

fn Voice::is_complete(self : Voice) -> Bool

#
Voice::principle_count

fn Voice::principle_count(self : Voice) -> Int

#
Voice::to_html

fn Voice::to_html(self : Voice) -> String

#
Voice::to_json

fn Voice::to_json(self : Voice) -> String

#
Voice::to_markdown

fn Voice::to_markdown(self : Voice) -> String

#
YamlParseResult

pub struct YamlParseResult {
value : JsonValue?
diagnostics : DiagnosticBag
} derive(Eq,
Debug
)

#
asset_extension

fn asset_extension(path : String) -> String

#
asset_has_supported_extension

fn asset_has_supported_extension(path : String, extensions : Array[String]) -> Bool

#
benchmark_fixture_json

fn benchmark_fixture_json(token_count : Int) -> String

#
boundary_report_json

fn boundary_report_json() -> String

#
boundary_report_markdown

fn boundary_report_markdown() -> String

#
cli_help

fn cli_help() -> String

#
cli_user_args

fn cli_user_args(args : Array[String]) -> Array[String]

#
compare_stable_names

fn compare_stable_names(left : String, right : String) -> Int

#
example_cli_commands

fn example_cli_commands() -> Array[String]

#
example_colors

fn example_colors() -> Array[String]

#
example_document_json

fn example_document_json(token_count : Int) -> String

#
example_document_sizes

fn example_document_sizes() -> Array[Int]

#
example_document_summary

fn example_document_summary(token_count : Int) -> String

#
example_document_yaml

fn example_document_yaml(token_count : Int) -> String

#
example_schema_document

fn example_schema_document() -> String

#
import_brand_book

fn import_brand_book(text : String, format : DocumentFormat) -> PipelineResult

#
import_brand_book_auto

fn import_brand_book_auto(text : String) -> PipelineResult

#
is_quoted

fn is_quoted(text : String) -> Bool

#
is_safe_asset_path

fn is_safe_asset_path(path : String) -> Bool

#
json_escape

fn json_escape(text : String) -> String

#
moonbit_brandbook

fn moonbit_brandbook() -> BrandBook

Build the bundled MoonBit brand book example.

#
moonbit_brandbook_with

fn moonbit_brandbook_with(name~ : String, tagline~ : String) -> BrandBook

Build the bundled example with a custom name and tagline.

#
normalize_asset_path

fn normalize_asset_path(path : String) -> String

#
normalize_identifier

fn normalize_identifier(text : String) -> String

#
parse_brand_document

fn parse_brand_document(text : String) -> BrandDocumentResult

#
parse_brand_document_as

fn parse_brand_document_as(text : String, format : DocumentFormat) -> BrandDocumentResult

#
parse_cli

fn parse_cli(args : Array[String]) -> CliParseResult

#
parse_json

fn parse_json(text : String) -> JsonParseResult

#
parse_json_with_limit

fn parse_json_with_limit(text : String, max_depth : Int) -> JsonParseResult

#
parse_yaml

fn parse_yaml(text : String) -> YamlParseResult

#
policy_catalog

fn policy_catalog() -> PolicyCatalog

#
policy_json

fn policy_json() -> String

#
policy_markdown

fn policy_markdown() -> String

#
public_api_contract

fn public_api_contract() -> ApiContract

#
public_api_json

fn public_api_json() -> String

#
public_api_markdown

fn public_api_markdown() -> String

#
run_benchmarks

fn run_benchmarks() -> BenchmarkReport

#
run_boundary_suites

fn run_boundary_suites() -> Bool

#
run_cli

fn run_cli(request : CliRequest, input : String?) -> CliResult

#
schema_child

fn schema_child(path : String, child : String) -> String

#
schema_index

fn schema_index(path : String, index : Int) -> String

#
schema_is_array_path

fn schema_is_array_path(path : String) -> Bool

#
schema_leaf

fn schema_leaf(path : String) -> String

#
schema_parent

fn schema_parent(path : String) -> String

#
schema_path

fn schema_path(parts : Array[String]) -> String

#
split_lines_preserve

fn split_lines_preserve(text : String) -> Array[String]

#
standard_boundary_suites

fn standard_boundary_suites() -> Array[BoundarySuite]

#
trim_ascii

fn trim_ascii(text : String) -> String

#
validate_angle_degrees

fn validate_angle_degrees(angle : Int) -> Bool

#
validate_hex_token

fn validate_hex_token(text : String) -> Bool

#
validate_identifier

fn validate_identifier(text : String) -> Bool

#
validate_name

fn validate_name(text : String, max_length : Int) -> Bool

#
validate_non_negative_integer

fn validate_non_negative_integer(value : Int) -> Bool

#
validate_pipeline

fn validate_pipeline(book : BrandBook) -> PipelineResult

#
validate_positive_integer

fn validate_positive_integer(value : Int) -> Bool

#
version

fn version() -> String

A compact semantic version for generated brand guides.