# This file is automatically generated by pyo3_stub_gen
# ruff: noqa: E501, F401

import builtins
import decimal
import enum
import os
import pathlib
import typing
from symbolica import ComplexFloat, Float
from symbolica.core import Expression

__all__ = [
    "AUTO",
    "Angle",
    "Auto",
    "Color",
    "CutPartition",
    "Cycle",
    "Dash",
    "DebugLevel",
    "DiagramRender",
    "DiagramView",
    "DirectionBasis",
    "DotCodec",
    "DotEdgeData",
    "DotHalfEdgeData",
    "DotVertexData",
    "DrawOptions",
    "DrawingSelectors",
    "EdgeSignature",
    "EdgeSpec",
    "Flow",
    "Fraction",
    "GlobalData",
    "Graph",
    "GraphStyleOptions",
    "HalfEdgeSpec",
    "INHERIT",
    "Inherit",
    "Insets",
    "LayoutFrame",
    "LayoutSettings",
    "LayoutStream",
    "Length",
    "Mark",
    "MathSymbol",
    "NodeSpec",
    "NodeStore",
    "Orientation",
    "OrientedCut",
    "Anchor",
    "Compass",
    "DanglingTangent",
    "DashPattern",
    "Edge",
    "EdgeDrawing",
    "EdgeLengthResolution",
    "EdgeValue",
    "HalfEdge",
    "HalfEdgeDrawing",
    "HalfEdgeValue",
    "LabelLayout",
    "LayoutAlgorithm",
    "LayoutDirection",
    "LayoutNodes",
    "MarkDirection",
    "MarkOrientation",
    "MarkPosition",
    "MarkSymbol",
    "Node",
    "NodeDrawing",
    "NodeValue",
    "Pattern",
    "Placement",
    "RankAlignment",
    "RoutePoints",
    "Routing",
    "StrokeCap",
    "StrokeJoin",
    "TextStyle",
    "Ratio",
    "RelativeLength",
    "RenderSettings",
    "Stroke",
    "Subgraph",
    "TextLabel",
    "TraversalTree",
    "TypstBind",
    "TypstCall",
    "TypstModule",
    "TypstRef",
    "build",
    "edge",
    "node",
    "sink",
    "source",
]

_RealLabel: typing.TypeAlias = Float | int | float | str | decimal.Decimal
_ExpressionLabel: typing.TypeAlias = Expression | ComplexFloat | _RealLabel | complex | tuple[_RealLabel, _RealLabel] | None
_LabelKey: typing.TypeAlias = typing.Callable[[typing.Any], _ExpressionLabel] | None

class _TypstValueRef(typing.Protocol): ...
class _TypstContentRef(typing.Protocol): ...
class _TypstFunctionRef(typing.Protocol):
    def call(self, *args: _NativeValue, **kwargs: _NativeValue) -> TypstCall: ...
    def bind(self, *args: _NativeValue, **kwargs: _NativeValue) -> TypstBind: ...

_FunctionExpression: typing.TypeAlias = _TypstFunctionRef | TypstBind
_TypstExpression: typing.TypeAlias = _TypstValueRef | _TypstContentRef | _FunctionExpression | TypstCall
_NativeArray: typing.TypeAlias = builtins.list["_NativeValue"] | builtins.tuple["_NativeValue", ...]
_NativeDict: typing.TypeAlias = builtins.dict[builtins.str, "_NativeValue"]
_NativeValue: typing.TypeAlias = (
    None
    | builtins.bool
    | builtins.int
    | builtins.float
    | builtins.str
    | Auto
    | Inherit
    | LayoutAlgorithm
    | LayoutDirection
    | LabelLayout
    | RankAlignment
    | LayoutNodes
    | Placement
    | Compass
    | Routing
    | RoutePoints
    | DanglingTangent
    | Anchor
    | Pattern
    | EdgeLengthResolution
    | DebugLevel
    | StrokeCap
    | StrokeJoin
    | TextStyle
    | DashPattern
    | MarkSymbol
    | MarkPosition
    | MarkOrientation
    | MarkDirection
    | Length
    | Ratio
    | RelativeLength
    | Angle
    | Fraction
    | Color
    | Stroke
    | Dash
    | Insets
    | Mark
    | TextLabel
    | MathSymbol
    | _TypstExpression
    | _NativeArray
    | _NativeDict
)
_ValueExpression: typing.TypeAlias = _TypstValueRef | TypstCall
_Number: typing.TypeAlias = builtins.int | builtins.float | _ValueExpression | Inherit
_Integer: typing.TypeAlias = builtins.int | _ValueExpression | Inherit
_Boolean: typing.TypeAlias = builtins.bool | _ValueExpression | Inherit
_LengthValue: typing.TypeAlias = builtins.int | builtins.float | Length | Ratio | RelativeLength | _ValueExpression | Inherit
_LengthArray: typing.TypeAlias = builtins.list[_LengthValue] | builtins.tuple[_LengthValue, ...]
_Paint: typing.TypeAlias = Color | _ValueExpression | Inherit
_StrokeValue: typing.TypeAlias = Stroke | Color | Length | builtins.int | builtins.float | _ValueExpression | Inherit
_DashValue: typing.TypeAlias = Dash | _ValueExpression | Inherit
_StaticContent: typing.TypeAlias = builtins.str | TextLabel | MathSymbol | _TypstContentRef | TypstCall | Inherit
_Content: typing.TypeAlias = _StaticContent | _FunctionExpression
_Dictionary: typing.TypeAlias = _NativeDict | _ValueExpression | Inherit
_StyleValue: typing.TypeAlias = _NativeDict | _ValueExpression | _FunctionExpression
_Style: typing.TypeAlias = _StyleValue | Inherit
_StyleLayers: typing.TypeAlias = _Style | builtins.list[_NativeDict] | builtins.tuple[_NativeDict, ...]
_PlacementValue: typing.TypeAlias = Placement | _NativeDict | _TypstExpression | None | Inherit
_CompassValue: typing.TypeAlias = Compass | None | Inherit
_RoutingValue: typing.TypeAlias = Routing | None | Inherit
_DanglingTangentValue: typing.TypeAlias = DanglingTangent | Auto | Inherit
_AnchorValue: typing.TypeAlias = Anchor | Auto | None | Inherit
_Radius: typing.TypeAlias = builtins.int | builtins.float | builtins.list[builtins.int | builtins.float] | builtins.tuple[builtins.int | builtins.float, ...] | _ValueExpression | Inherit
_Padding: typing.TypeAlias = builtins.int | builtins.float | _NativeArray | _NativeDict | Insets | _ValueExpression | Inherit
_OptionalString: typing.TypeAlias = builtins.str | None
_OptionalHalfEdgeSpec: typing.TypeAlias = HalfEdgeSpec | None
_EndpointTarget: typing.TypeAlias = NodeSpec | Node | builtins.int | builtins.str
_HalfEdgeTarget: typing.TypeAlias = HalfEdge | builtins.int
_GraphItem: typing.TypeAlias = NodeSpec | EdgeSpec
_OptionalGlobalData: typing.TypeAlias = GlobalData | None
_OptionalDotCodec: typing.TypeAlias = DotCodec | None
_OptionalRenderSettings: typing.TypeAlias = RenderSettings | None
_OptionalPaint: typing.TypeAlias = _Paint | None
_OptionalLengthValue: typing.TypeAlias = _LengthValue | None
_OptionalStrokeCap: typing.TypeAlias = StrokeCap | None | Inherit
_OptionalStrokeJoin: typing.TypeAlias = StrokeJoin | None | Inherit
_OptionalDashValue: typing.TypeAlias = _DashValue | None
_OptionalStrokeValue: typing.TypeAlias = _StrokeValue | None
_MarkAnchor: typing.TypeAlias = Anchor | Inherit
_MarkShorten: typing.TypeAlias = _LengthValue | None | Auto
_TextStyleValue: typing.TypeAlias = TextStyle | Inherit
_AutoOptionalStaticContent: typing.TypeAlias = _StaticContent | None | Auto
_OptionalStaticContent: typing.TypeAlias = _StaticContent | None
_AutoOptionalContent: typing.TypeAlias = _Content | None | Auto
_OptionalContent: typing.TypeAlias = _Content | None
_OptionalStyle: typing.TypeAlias = _Style | None
_OptionalStyleLayers: typing.TypeAlias = _StyleLayers | None
_OptionalBoolean: typing.TypeAlias = _Boolean | None
_OptionalInteger: typing.TypeAlias = _Integer | None
_DrawingCoordinate: typing.TypeAlias = builtins.int | builtins.float | _ValueExpression
_DrawingPointDict = typing.TypedDict(
    "_DrawingPointDict",
    {"x": _DrawingCoordinate, "y": _DrawingCoordinate},
)
_DrawingPoint: typing.TypeAlias = builtins.list[_DrawingCoordinate] | builtins.tuple[_DrawingCoordinate, _DrawingCoordinate] | _DrawingPointDict | _ValueExpression | None | Inherit
_DrawingPoints: typing.TypeAlias = typing.Sequence[builtins.list[_DrawingCoordinate] | builtins.tuple[_DrawingCoordinate, _DrawingCoordinate] | _DrawingPointDict | _ValueExpression] | _ValueExpression | None | Inherit
_DrawingString: typing.TypeAlias = builtins.str | _ValueExpression | None | Inherit
_DrawingAngle: typing.TypeAlias = builtins.int | builtins.float | Angle | _ValueExpression | None | Inherit
_DrawingDecoration: typing.TypeAlias = Pattern | _StyleLayers | None | Inherit
_NodeDrawingSelector: typing.TypeAlias = typing.Callable[[Node], NodeDrawing | None] | None | Inherit
_EdgeDrawingSelector: typing.TypeAlias = typing.Callable[[Edge], EdgeDrawing | None] | None | Inherit
_HalfEdgeDrawingSelector: typing.TypeAlias = typing.Callable[[HalfEdge], HalfEdgeDrawing | None] | None | Inherit
_HedgeSelection: typing.TypeAlias = builtins.list[builtins.bool] | builtins.tuple[builtins.bool, ...]
_SubgraphExpression: typing.TypeAlias = _ValueExpression | _FunctionExpression
_SubgraphSelection: typing.TypeAlias = _HedgeSelection | _SubgraphExpression
_OptionalHedgeSelection: typing.TypeAlias = _SubgraphSelection | None | Inherit
_NodeIndexArray: typing.TypeAlias = builtins.list[builtins.int] | builtins.tuple[builtins.int, ...]
_NodeIndices: typing.TypeAlias = _NodeIndexArray | _ValueExpression | Inherit
_NodeGroup: typing.TypeAlias = _NodeIndexArray | _SubgraphExpression
_NodeGroups: typing.TypeAlias = builtins.list[_NodeGroup] | builtins.tuple[_NodeGroup, ...] | _ValueExpression | Inherit
_LabelLayoutValue: typing.TypeAlias = LabelLayout | Inherit
_LayoutAlgorithmValue: typing.TypeAlias = LayoutAlgorithm | Inherit
_LayoutNodesValue: typing.TypeAlias = LayoutNodes | Inherit
_LayoutDirectionValue: typing.TypeAlias = LayoutDirection | Inherit
_RankAlignmentValue: typing.TypeAlias = RankAlignment | Inherit
_DrawSubgraphRecord = typing.TypedDict(
    "_DrawSubgraphRecord",
    {"subgraph": _SubgraphSelection},
)
_StyledDrawSubgraphRecord = typing.TypedDict(
    "_StyledDrawSubgraphRecord",
    {"subgraph": _SubgraphSelection, "edge-style": _StyleValue | None},
)
_DrawSubgraphEntry: typing.TypeAlias = _SubgraphSelection | _DrawSubgraphRecord | _StyledDrawSubgraphRecord
_DrawSubgraphs: typing.TypeAlias = _SubgraphSelection | builtins.list[_DrawSubgraphEntry] | builtins.tuple[_DrawSubgraphEntry, ...] | None | Inherit
_AutoLengthValue: typing.TypeAlias = _LengthValue | Auto
_AutoNumber: typing.TypeAlias = _Number | Auto
_DebugValue: typing.TypeAlias = DebugLevel | Inherit
_AutoRadius: typing.TypeAlias = _Radius | Auto
_AutoFunction: typing.TypeAlias = _FunctionExpression | Auto
_OptionalNumber: typing.TypeAlias = _Number | None
_EdgeLengthResolver: typing.TypeAlias = EdgeLengthResolution | _ValueExpression | _FunctionExpression | Inherit
_OptionalPadding: typing.TypeAlias = _Padding | None
_RenderStyle: typing.TypeAlias = GraphStyleOptions | None | Inherit
_RenderLayouts: typing.TypeAlias = LayoutSettings | None | Inherit
_RenderDrawing: typing.TypeAlias = DrawOptions | None | Inherit
_RenderSelectors: typing.TypeAlias = DrawingSelectors | None | Inherit


AUTO: Auto
INHERIT: Inherit
@typing.final
class Angle:
    r"""
    A Typst angle in degrees or radians.
    """
    def __new__(cls, value: builtins.float, unit: typing.Literal['deg', 'rad']) -> Angle: ...
    @staticmethod
    def degrees(value: builtins.float) -> Angle: ...
    @staticmethod
    def radians(value: builtins.float) -> Angle: ...
    def __repr__(self) -> builtins.str: ...

@typing.final
class Auto:
    r"""
    Type of the `AUTO` sentinel, which requests automatic selection.
    """
    def __repr__(self) -> builtins.str: ...
    def __copy__(self) -> Auto: ...
    def __deepcopy__(self, _memo: typing.Any) -> Auto: ...

@typing.final
class Color:
    r"""
    A safe Typst color value.
    """
    def __new__(cls, value: builtins.str) -> Color: ...
    @staticmethod
    def rgb(red: builtins.int, green: builtins.int, blue: builtins.int, alpha: typing.Optional[builtins.int] = None) -> Color: ...
    def __repr__(self) -> builtins.str: ...

@typing.final
class CutPartition:
    r"""
    One source-side, oriented-boundary, target-side cut partition.
    """
    @property
    def source_side(self) -> Subgraph: ...
    @property
    def boundary(self) -> OrientedCut: ...
    @property
    def target_side(self) -> Subgraph: ...
    @property
    def edges(self) -> builtins.list[Edge]: ...
    def __repr__(self) -> builtins.str: ...

@typing.final
class Cycle:
    r"""
    A cycle in a particular graph revision.
    """
    @property
    def filter(self) -> Subgraph: ...
    @property
    def loop_count(self) -> typing.Optional[builtins.int]: ...
    def __repr__(self) -> builtins.str: ...

@typing.final
class Dash:
    r"""
    A named or explicit Typst dash pattern.
    """
    def __new__(cls, pattern: DashPattern) -> Dash: ...
    @staticmethod
    def pattern(values: _LengthArray, *, phase: _LengthValue | None = None) -> Dash: ...
    def __repr__(self) -> builtins.str: ...

@typing.final
class DiagramRender:
    r"""
    An immutable native SVG rendering with file exports and notebook display.
    Geometry and typeset labels are captured when the result is created.
    """
    @property
    def diagrams(self) -> builtins.list[DiagramRender]:
        r"""
        Configured child snapshots for a rendered collection, in display order.
        """
    def to_svg(self) -> builtins.str:
        r"""
        Return the one-page SVG. Use to_svg_pages for multipage documents.
        """
    def to_svg_pages(self) -> builtins.list[builtins.str]: ...
    def to_html(self) -> builtins.str: ...
    def to_linnest(self) -> builtins.str: ...
    def save(self, output: builtins.str | os.PathLike | pathlib.Path) -> pathlib.Path:
        r"""
        Export SVG, HTML, Typst, PDF, or PNG, selected by the filename suffix.
        """
    def save_pages(self, directory: builtins.str | os.PathLike | pathlib.Path, *, format: builtins.str = 'svg') -> builtins.list[pathlib.Path]:
        r"""
        Export every SVG or PNG page to a directory and return the written paths.
        """
    def _repr_html_(self) -> builtins.str: ...
    def _repr_svg_(self) -> typing.Optional[builtins.str]: ...
    def _mime_(self) -> tuple[builtins.str, builtins.str]: ...
    def __repr__(self) -> builtins.str: ...

@typing.final
class DiagramView:
    r"""
    A resolved drawing with static exports and optional browser measurements.

    Clones retain the same scenes, receipt identity, and completion cells. A
    widget and its caller therefore observe the same completed snapshot. Each
    freshly constructed view has a new identity; receipts belong to that view,
    and a completed view rejects different measurements. SVG/HTML exports are
    immutable snapshots and never trigger implicit remeasurement.

    With the generic graph bindings installed:

    >>> from symbolica.community.graph import DotCodec, Graph
    >>> graph = Graph.from_dot("graph { a -- b }", DotCodec.topology())
    >>> view = graph.render()
    >>> static = view.snapshot()  # Complete static output with default settings.
    >>> svg = static.to_svg()
    >>> measured = view.measured(browser="chromium")  # Explicit Playwright capture.
    >>> outlined = view.outlined()  # Optional typst-py vector labels.
    >>> static.to_svg() == svg  # Earlier snapshots remain immutable.
    True
    """
    @property
    def diagrams(self) -> builtins.list[DiagramView]:
        r"""
        Configured child views for a collection, retaining their original scenes.
        See [`Self`] for an example. Returned clones share child completion state.
        """
    def measurement_request(self) -> dict:
        r"""
        The exact ordered MathML probes, fixed font, and receipt identity.

        See [`Self`] for the measurement lifecycle. A receipt must echo this
        request's `id` and contain one finite, nonnegative rectangle per label in
        request order. All dimensions and the baseline are SVG user units (points).

        # Errors
        Returns a Python error if bundled font loading, hashing, or request
        serialization fails. No browser or notebook dependency is imported here.
        """
    def measured(self, measurements: typing.Optional[dict] = None, *, browser: typing.Optional[builtins.str] = None) -> DiagramRender:
        r"""
        Obtain a completed immutable snapshot, or explicitly measure using Chromium.

        See [`Self`] for an example. Calling without arguments reuses completion;
        pending labels need either an external receipt or explicit browser mode.
        The same receipt is idempotent, including through a retained clone.
        Notebook widgets allow 15 seconds for font-resource transfer, followed by
        a separate five-second browser layout deadline. Explicit Chromium capture
        has the font inline and a five-second measurement deadline; expiry raises
        Python `TimeoutError`. Widgets retain static output on either timeout.

        # Errors
        Returns `ValueError` for conflicting arguments, an unsupported browser,
        stale/malformed receipts, changed measurements, or invalid label sources.
        Returns `RuntimeError` while measurement is pending or native rendering
        fails. Optional browser setup and execution errors propagate as Python
        errors. Failed capture does not publish this view's completed snapshot;
        child views already completed remain independently usable.
        """
    def outlined(self) -> DiagramRender:
        r"""
        Outline labels with the optional Python Typst compiler; no browser is used.

        See [`Self`] for an example. The vector snapshot has its own completion
        cell, shared by clones, and never changes an existing measured export.

        # Errors
        Returns `ValueError` if labels lack Typst sources or captured MathML has
        no retained scene, `ImportError` if the optional `typst` package is absent,
        or a Python error on compilation/rendering failure. Compiler exceptions
        retain their Python cause via [`typst_export::compile_sources`].
        """
    def snapshot(self, *, browser: typing.Optional[builtins.str] = None) -> DiagramRender:
        r"""
        Static export owner: completed measurement, optional Typst, then estimates.

        Estimates use [`LabelSource::estimated_metrics`] at the request's fixed
        9px STIX style. They never complete measurement; a later receipt replaces
        them. See [`Self::to_svg`] for an export example.

        # Errors
        Propagates label validation, optional compiler, and rendering errors.
        """
    def to_svg(self) -> builtins.str:
        r"""
        Return a static single-page SVG; see [`Self`] for an example.

        # Errors
        Propagates [`Self::snapshot`] errors and rejects multipage snapshots.
        """
    def to_svg_pages(self) -> builtins.list[builtins.str]:
        r"""
        Return independent strings for all static pages; see [`Self`].

        # Errors
        Propagates [`Self::snapshot`] errors.
        """
    def to_html(self) -> builtins.str:
        r"""
        Return static HTML with its shared font resource; see [`Self`].

        # Errors
        Propagates [`Self::snapshot`] errors.
        """
    def save(self, output: builtins.str | os.PathLike | pathlib.Path) -> pathlib.Path:
        r"""
        Save a static snapshot, selecting the format by suffix.

        >>> from symbolica.community.graph import DotCodec, Graph
        >>> view = Graph.from_dot("graph { a -- b }", DotCodec.topology()).render()
        >>> path = view.save("diagram.svg")

        # Errors
        Propagates [`Self::snapshot`] errors, filesystem/export errors, and
        invalid format/page-count errors. PDF/PNG need an outlined snapshot.
        """
    def widget(self) -> typing.Any:
        r"""
        Optional notebook dependencies are imported only when displaying a view.
        The widget retains a clone of the backend owner until it is closed.

        >>> from symbolica.community.graph import DotCodec, Graph
        >>> view = Graph.from_dot("graph { a -- b }", DotCodec.topology()).render()
        >>> widget = view.widget()  # Requires anywidget in this environment.

        # Errors
        Propagates font/request errors and Python import or widget setup errors.
        """
    def _repr_mimebundle_(self, include: typing.Optional[typing.Sequence[builtins.str]] = None, exclude: typing.Optional[typing.Sequence[builtins.str]] = None) -> typing.Any:
        r"""
        Static Jupyter bundle with an optional widget, respecting MIME filters.
        See [`Self::widget`] for explicit notebook construction.

        # Errors
        Propagates widget setup and Python MIME protocol errors.
        """
    def _display_(self) -> typing.Any:
        r"""
        Marimo adapter: retained widget when available, otherwise isolated HTML.
        See [`Self::widget`] for explicit widget construction.

        # Errors
        Propagates widget errors and missing/failed Marimo imports or adapters.
        """
    def _mime_(self) -> typing.Any:
        r"""
        Marimo MIME hook for [`Self::_display_`]; see [`Self::widget`].

        # Errors
        Propagates display adapter and Python MIME protocol errors.
        """
    def __repr__(self) -> builtins.str: ...

@typing.final
class DotCodec:
    r"""
    An explicit mapping between graph values and DOT-representable records.
    """
    def __new__(cls, *, encode_node: typing.Callable[[NodeValue], DotVertexData], decode_node: typing.Callable[[DotVertexData], NodeValue], encode_edge: typing.Callable[[EdgeValue], DotEdgeData], decode_edge: typing.Callable[[DotEdgeData], EdgeValue], encode_half_edge: typing.Callable[[HalfEdgeValue], DotHalfEdgeData], decode_half_edge: typing.Callable[[DotHalfEdgeData], HalfEdgeValue]) -> DotCodec: ...
    @classmethod
    def linnest(cls) -> DotCodec: ...
    @classmethod
    def topology(cls) -> DotCodec: ...

@typing.final
class DotEdgeData:
    r"""
    The DOT-representable record exchanged for one edge by a `DotCodec`.
    """
    @property
    def edge_id(self) -> typing.Optional[builtins.int]: ...
    @property
    def payload(self) -> typing.Optional[builtins.list[builtins.int]]: ...
    @property
    def statements(self) -> builtins.dict[builtins.str, builtins.str]: ...
    @property
    def local_statements(self) -> builtins.dict[builtins.str, builtins.str]: ...
    def __new__(cls, *, edge_id: typing.Optional[builtins.int] = None, payload: typing.Optional[typing.Sequence[builtins.int]] = None, statements: typing.Optional[typing.Mapping[builtins.str, builtins.str]] = None, local_statements: typing.Optional[typing.Mapping[builtins.str, builtins.str]] = None) -> DotEdgeData: ...

@typing.final
class DotHalfEdgeData:
    r"""
    The DOT-representable record exchanged for one half-edge by a `DotCodec`.
    """
    @property
    def statement(self) -> typing.Optional[builtins.str]: ...
    @property
    def index(self) -> typing.Optional[builtins.int]: ...
    @property
    def payload(self) -> typing.Optional[builtins.list[builtins.int]]: ...
    @property
    def port_label(self) -> typing.Optional[builtins.str]: ...
    @property
    def compass(self) -> typing.Optional[builtins.str]: ...
    def __new__(cls, *, statement: typing.Optional[builtins.str] = None, index: typing.Optional[builtins.int] = None, payload: typing.Optional[typing.Sequence[builtins.int]] = None, port_label: typing.Optional[builtins.str] = None, compass: typing.Optional[builtins.str] = None) -> DotHalfEdgeData: ...

@typing.final
class DotVertexData:
    r"""
    The DOT-representable record exchanged for one node by a `DotCodec`.
    """
    @property
    def name(self) -> typing.Optional[builtins.str]: ...
    @property
    def index(self) -> typing.Optional[builtins.int]: ...
    @property
    def payload(self) -> typing.Optional[builtins.list[builtins.int]]: ...
    @property
    def statements(self) -> builtins.dict[builtins.str, builtins.str]: ...
    def __new__(cls, *, name: typing.Optional[builtins.str] = None, index: typing.Optional[builtins.int] = None, payload: typing.Optional[typing.Sequence[builtins.int]] = None, statements: typing.Optional[typing.Mapping[builtins.str, builtins.str]] = None) -> DotVertexData: ...

@typing.final
class DrawOptions:
    r"""
    Full typed option surface for `linnest.draw`.
    """
    def __repr__(self) -> builtins.str: ...
    def __new__(cls, *, scope: _Dictionary = ..., unit: _AutoLengthValue = ..., title: _AutoOptionalStaticContent = ..., subgraph: _DrawSubgraphs = ..., debug: _DebugValue = ..., debug_label_collisions: _Boolean = ..., label_collision_padding: _Number = ..., show_half_edge_ids: _Boolean = ..., node_radius: _AutoRadius = ..., node_min_radius: _Number = ..., node_label_padding: _Number = ..., node_fill: _Paint = ..., node_stroke: _StrokeValue = ..., node_outset: _AutoNumber = ..., node_label_style: _Style = ..., node_style: _OptionalStyle = ..., node_label: _AutoOptionalContent = ..., draw_node: _AutoFunction = ..., edge_stroke: _StrokeValue = ..., edge_offset: _Number = ..., edge_length: _OptionalNumber = ..., edge_ratio: _OptionalNumber = ..., edge_resolve_length: _EdgeLengthResolver = ..., edge_accuracy: _Number = ..., edge_optimize: _Boolean = ..., edge_split_gap: _Number = ..., edge_dangling_tangent: _DanglingTangentValue = ..., source_style: _OptionalStyleLayers = ..., sink_style: _OptionalStyleLayers = ..., edge_label: _OptionalContent = ..., edge_label_style: _OptionalStyle = ..., external_label_gap: _Number = ..., edge_omega: _Number = ..., edge_trim_accuracy: _Number = ..., padding: _OptionalPadding = ..., debug_edge_radius: _Number = ..., debug_edge_fill: _Paint = ..., debug_edge_stroke: _StrokeValue = ..., debug_edge_label_fill: _Paint = ..., subgraph_edge_style: _Style = ..., subgraph_edge_underlay: _Boolean = ...) -> DrawOptions: ...

@typing.final
class DrawingSelectors:
    r"""
    Per-render Python callbacks returning typed drawing patches.
    """
    def __repr__(self) -> builtins.str: ...
    def __new__(cls, *, node: _NodeDrawingSelector = ..., edge: _EdgeDrawingSelector = ..., source: _HalfEdgeDrawingSelector = ..., sink: _HalfEdgeDrawingSelector = ...) -> DrawingSelectors: ...

@typing.final
class EdgeSignature:
    r"""
    A labeled port used in graph generation signatures.
    Direction is outgoing (True), incoming (False), or undirected (None).
    """
    @property
    def data(self) -> Expression: ...
    @property
    def direction(self) -> typing.Optional[builtins.bool]: ...
    def __new__(cls, data: Expression | int | Float | builtins.int | builtins.float | builtins.str | decimal.Decimal | ComplexFloat | Float | builtins.int | builtins.float | builtins.str | decimal.Decimal | builtins.complex | tuple[Float | builtins.int | builtins.float | builtins.str | decimal.Decimal, Float | builtins.int | builtins.float | builtins.str | decimal.Decimal], direction: typing.Optional[builtins.bool] = None) -> EdgeSignature:
        r"""
        A labeled outgoing (True), incoming (False), or undirected (None) port.
        """
    def flip(self) -> EdgeSignature: ...

@typing.final
class EdgeSpec:
    r"""
    A reusable declarative edge description accepted by `build()` and `Graph.add_edge()`.
    """
    @property
    def name(self) -> typing.Optional[builtins.str]: ...
    @property
    def data(self) -> typing.Any: ...
    @data.setter
    def data(self, value: typing.Any) -> None: ...
    @property
    def drawing(self) -> EdgeDrawing: ...
    @property
    def orientation(self) -> Orientation: ...

@typing.final
class Fraction:
    r"""
    A Typst fractional track size such as `1fr`.
    """
    @property
    def value(self) -> builtins.float: ...
    def __new__(cls, value: builtins.float) -> Fraction: ...
    def __repr__(self) -> builtins.str: ...

@typing.final
class GlobalData:
    r"""
    DOT graph metadata kept separate from arbitrary Python element data.
    """
    @property
    def name(self) -> builtins.str: ...
    @name.setter
    def name(self, value: builtins.str) -> None: ...
    @property
    def payload(self) -> typing.Optional[builtins.list[builtins.int]]: ...
    @payload.setter
    def payload(self, value: typing.Optional[builtins.list[builtins.int]]) -> None: ...
    @property
    def statements(self) -> builtins.dict[builtins.str, builtins.str]: ...
    @statements.setter
    def statements(self, value: builtins.dict[builtins.str, builtins.str]) -> None: ...
    @property
    def edge_statements(self) -> builtins.dict[builtins.str, builtins.str]: ...
    @edge_statements.setter
    def edge_statements(self, value: builtins.dict[builtins.str, builtins.str]) -> None: ...
    @property
    def node_statements(self) -> builtins.dict[builtins.str, builtins.str]: ...
    @node_statements.setter
    def node_statements(self, value: builtins.dict[builtins.str, builtins.str]) -> None: ...
    def __new__(cls, name: builtins.str = '', *, payload: typing.Optional[typing.Sequence[builtins.int]] = None, statements: typing.Optional[typing.Mapping[builtins.str, builtins.str]] = None, edge_statements: typing.Optional[typing.Mapping[builtins.str, builtins.str]] = None, node_statements: typing.Optional[typing.Mapping[builtins.str, builtins.str]] = None) -> GlobalData: ...
    def __repr__(self) -> builtins.str: ...

@typing.final
class Graph:
    r"""
    An owned topology with arbitrary element data and typed rendering configuration.

    Examples
    --------
    ```python
    from symbolica.community import graph as linnet
    graph = linnet.build(linnet.node("source"), linnet.node("sink"))
    ```
    """
    @property
    def name(self) -> typing.Optional[builtins.str]: ...
    @property
    def global_data(self) -> GlobalData: ...
    @global_data.setter
    def global_data(self, value: GlobalData) -> None: ...
    @property
    def render_config(self) -> RenderSettings: ...
    @render_config.setter
    def render_config(self, value: RenderSettings) -> None: ...
    @property
    def n_nodes(self) -> builtins.int: ...
    @property
    def n_edges(self) -> builtins.int: ...
    @property
    def n_half_edges(self) -> builtins.int: ...
    @property
    def node_store(self) -> NodeStore:
        r"""
        Return the node-storage strategy used by this graph.
        """
    def __new__(cls, *, name: typing.Optional[builtins.str] = None, global_data: typing.Optional[GlobalData] = None, codec: typing.Optional[DotCodec] = None, render_config: RenderSettings | None = None, node_store: NodeStore = NodeStore.Vec) -> Graph: ...
    def __len__(self) -> builtins.int: ...
    def to_node_store(self, node_store: NodeStore) -> Graph:
        r"""
        Copy this graph into another node-storage strategy.
        """
    def node(self, key: builtins.int | builtins.str) -> Node: ...
    def edge(self, key: builtins.int | builtins.str) -> Edge: ...
    def half_edge(self, index: builtins.int) -> HalfEdge: ...
    def nodes(self) -> builtins.list[Node]: ...
    def edges(self) -> builtins.list[Edge]: ...
    def half_edges(self) -> builtins.list[HalfEdge]: ...
    def reorder_nodes(self, order: typing.Sequence[builtins.int]) -> None: ...
    def reorder_edges(self, order: typing.Sequence[builtins.int]) -> None: ...
    def set_orientation(self, key: builtins.int | builtins.str, orientation: Orientation) -> None:
        r"""
        Change an edge's direction and invalidate existing graph-element views.
        """
    def reverse_edge(self, key: builtins.int | builtins.str) -> None: ...
    def map(self, *, node: typing.Callable[[Node], typing.Any] | None = None, edge: typing.Callable[[Edge], typing.Any] | None = None, source: typing.Callable[[HalfEdge], typing.Any] | None = None, sink: typing.Callable[[HalfEdge], typing.Any] | None = None) -> Graph: ...
    @classmethod
    def from_dot(cls, source: builtins.str, codec: DotCodec, *, node_store: NodeStore = NodeStore.Vec) -> Graph: ...
    @classmethod
    def from_dot_set(cls, source: builtins.str, codec: DotCodec, *, node_store: NodeStore = NodeStore.Vec) -> builtins.list[Graph]: ...
    @classmethod
    def from_dot_file(cls, path: builtins.str | os.PathLike[builtins.str], codec: DotCodec, *, node_store: NodeStore = NodeStore.Vec) -> Graph: ...
    def to_dot(self, codec: typing.Optional[DotCodec] = None) -> builtins.str: ...
    def render(self, *, config: RenderSettings | None = None) -> DiagramView:
        r"""
        Snapshot a drawing, using native SVG geometry for ordinary graph settings.
        """
    def to_svg(self, *, config: RenderSettings | None = None, browser: typing.Optional[builtins.str] = None) -> builtins.str: ...
    def _mime_(self) -> typing.Any: ...
    def _repr_mimebundle_(self, include: typing.Optional[typing.Sequence[builtins.str]] = None, exclude: typing.Optional[typing.Sequence[builtins.str]] = None) -> typing.Any: ...
    def full_subgraph(self) -> Subgraph: ...
    def empty_subgraph(self) -> Subgraph: ...
    def subgraph(self, *, nodes: typing.Sequence[builtins.int | builtins.str] = ..., edges: typing.Sequence[builtins.int | builtins.str] = ..., half_edges: typing.Sequence[builtins.int] = ...) -> Subgraph: ...
    def filter(self, *, node: typing.Callable[[Node], builtins.bool] | None = None, edge: typing.Callable[[Edge], builtins.bool] | None = None, half_edge: typing.Callable[[HalfEdge], builtins.bool] | None = None) -> Subgraph: ...
    def nodes_of(self, subgraph: Subgraph) -> builtins.list[Node]: ...
    def edges_of(self, subgraph: Subgraph) -> builtins.list[Edge]: ...
    def half_edges_of(self, subgraph: Subgraph) -> builtins.list[HalfEdge]: ...
    def internal_boundary(self, subgraph: Subgraph) -> Subgraph:
        r"""
        Return selected half-edges that lie on the selection's internal boundary.
        """
    def boundary(self, subgraph: Subgraph) -> Subgraph:
        r"""
        Return all boundary half-edges incident to nodes touched by the selection.
        """
    def external_half_edges(self) -> Subgraph:
        r"""
        Return dangling/external half-edges as a composable structural selection.
        """
    def connected_components(self, subgraph: typing.Optional[Subgraph] = None) -> builtins.list[Subgraph]: ...
    def count_connected_components(self, subgraph: typing.Optional[Subgraph] = None) -> builtins.int: ...
    def is_connected(self, subgraph: typing.Optional[Subgraph] = None) -> builtins.bool: ...
    def cyclomatic_number(self, subgraph: typing.Optional[Subgraph] = None) -> builtins.int: ...
    def is_reachable(self, source: Node | builtins.int | builtins.str, target: Node | builtins.int | builtins.str, *, subgraph: typing.Optional[Subgraph] = None, direction: DirectionBasis = DirectionBasis.Underlying) -> builtins.bool:
        r"""
        Test directed reachability within an optional structural selection.

        Both endpoints must belong to the selected subgraph; otherwise this raises `ValueError`.
        """
    def topological_order(self, *, subgraph: typing.Optional[Subgraph] = None, direction: DirectionBasis = DirectionBasis.Underlying) -> builtins.list[Node]:
        r"""
        Return a deterministic topological order for the selected directed graph.

        Explicitly selected zero-crown nodes appear first in ascending graph order.
        """
    def transitive_reduction(self, *, direction: DirectionBasis = DirectionBasis.Underlying) -> Graph:
        r"""
        Return a new graph with directionally redundant DAG edges removed.
        """
    def depth_first_traverse(self, root: builtins.int | builtins.str, *, subgraph: typing.Optional[Subgraph] = None, include: typing.Optional[builtins.int] = None) -> TraversalTree: ...
    def breadth_first_traverse(self, root: builtins.int | builtins.str, *, subgraph: typing.Optional[Subgraph] = None, include: typing.Optional[builtins.int] = None) -> TraversalTree: ...
    def bridges(self, subgraph: typing.Optional[Subgraph] = None) -> Subgraph: ...
    def cycle_basis(self, subgraph: typing.Optional[Subgraph] = None) -> tuple[builtins.list[Cycle], Subgraph]: ...
    def all_spanning_forests(self, subgraph: typing.Optional[Subgraph] = None) -> builtins.list[Subgraph]: ...
    def all_bonds(self, *, subgraph: typing.Optional[Subgraph] = None, min_size: typing.Optional[builtins.int] = None, max_size: typing.Optional[builtins.int] = None) -> builtins.list[Subgraph]:
        r"""
        Enumerate inclusion-minimal cutsets with an inclusive boundary-size range.

        Bounds default to `[1, unbounded]`; `min_size=0` is rejected because a bond is non-empty.
        """
    def find_bond(self, *, subgraph: typing.Optional[Subgraph] = None, min_size: typing.Optional[builtins.int] = None, max_size: typing.Optional[builtins.int] = None) -> typing.Optional[Subgraph]:
        r"""
        Find one native inclusion-minimal cutset within an inclusive size range.
        """
    def all_cycles(self, *, max_results: builtins.int, subgraph: typing.Optional[Subgraph] = None) -> builtins.list[Cycle]:
        r"""
        Enumerate circuits only when the complete cycle-space candidate count fits the bound.

        `max_results` bounds all non-empty combinations of a cycle basis, not only
        the combinations that ultimately form circuits.
        """
    def tadpoles(self, externals: typing.Sequence[Node | builtins.int | builtins.str]) -> builtins.list[Subgraph]:
        r"""
        Enumerate tadpole components after identifying a non-empty terminal node set.
        """
    def all_cuts(self, source: typing.Sequence[builtins.int | builtins.str], target: typing.Sequence[builtins.int | builtins.str]) -> builtins.list[CutPartition]:
        r"""
        Enumerate all native separating partitions between two disjoint, non-empty node groups.
        """
    def add_node(self, spec: NodeSpec) -> Node:
        r"""
        Append one declarative node and return its fresh live view.
        """
    def add_edge(self, spec: EdgeSpec) -> Edge:
        r"""
        Append one declarative internal or dangling edge and return its fresh live view.
        """
    def split_edge(self, at: _HalfEdgeTarget, replacement: EdgeValue, *, name: typing.Optional[builtins.str] = None, orientation: Orientation = Orientation.Default) -> tuple[Edge, Edge]:
        r"""
        Split a paired edge at one half-edge, preserving the opposite edge value.
        """
    def connect(self, source: _HalfEdgeTarget, sink: _HalfEdgeTarget, replacement: EdgeValue, *, name: typing.Optional[builtins.str] = None, orientation: Orientation = Orientation.Default) -> Edge:
        r"""
        Connect two dangling half-edges; the first becomes the source endpoint.
        """
    def concretize(self, subgraph: Subgraph) -> Graph:
        r"""
        Copy a structural subgraph into an independent graph.
        """
    def extract(self, subgraph: Subgraph) -> Graph:
        r"""
        Remove a structural subgraph and return it as an independent graph.
        """
    def delete(self, subgraph: Subgraph) -> None:
        r"""
        Delete a structural subgraph.
        """
    def contract(self, subgraph: Subgraph, replacement: NodeValue, *, name: typing.Optional[builtins.str] = None) -> None:
        r"""
        Contract a non-empty subgraph into one replacement node.
        """
    def append(self, other: Graph) -> Graph:
        r"""
        Append another graph without matching dangling half-edges.
        """
    def append_mut(self, other: Graph) -> None:
        r"""
        Append another graph in place without matching dangling half-edges.
        """
    def join(self, other: Graph, *, matching: typing.Callable[[HalfEdge, HalfEdge], builtins.bool], merge: typing.Callable[[HalfEdge, HalfEdge], tuple[Flow, Orientation, builtins.str | None, EdgeValue]]) -> Graph:
        r"""
        Join dangling half-edges selected by Python callbacks.
        """
    def join_mut(self, other: Graph, *, matching: typing.Callable[[HalfEdge, HalfEdge], builtins.bool], merge: typing.Callable[[HalfEdge, HalfEdge], tuple[Flow, Orientation, builtins.str | None, EdgeValue]]) -> None:
        r"""
        Join another graph in place while leaving the other graph unchanged.
        """
    def __repr__(self) -> builtins.str: ...
    def __copy__(self) -> Graph: ...
    def canonize(self, *, node_key: _LabelKey = None, edge_key: _LabelKey = None, half_edge_key: _LabelKey = None) -> tuple[Graph, list[int], int, list[int]]:
        r"""
        Canonical graph, old-to-new vertex map, automorphism-group size, and vertex orbit.
        Keys receive element payloads; names and drawing metadata do not affect equivalence.
        """
    def is_isomorphic(self, other: Graph, *, node_key: _LabelKey = None, edge_key: _LabelKey = None, half_edge_key: _LabelKey = None) -> builtins.bool: ...
    def canonize_edges(self, *, edge_key: _LabelKey = None, half_edge_key: _LabelKey = None) -> None:
        r"""
        Sort edges canonically while fixing every vertex.
        """
    @staticmethod
    def generate(external_edges: typing.Sequence[tuple[Expression | int | Float | builtins.int | builtins.float | builtins.str | decimal.Decimal | ComplexFloat | Float | builtins.int | builtins.float | builtins.str | decimal.Decimal | builtins.complex | tuple[Float | builtins.int | builtins.float | builtins.str | decimal.Decimal, Float | builtins.int | builtins.float | builtins.str | decimal.Decimal], EdgeSignature]], vertex_signatures: typing.Sequence[typing.Sequence[EdgeSignature]], *, max_vertices: typing.Optional[builtins.int] = None, max_loops: typing.Optional[builtins.int] = None, max_bridges: typing.Optional[builtins.int] = None, allow_self_loops: typing.Optional[builtins.bool] = None, allow_zero_flow_edges: typing.Optional[builtins.bool] = None, filter_fn: typing.Callable[[Graph, int], bool] | None = None, progress_fn: typing.Callable[[Graph], bool] | None = None) -> list[tuple[Graph, int]]:
        r"""
        Generate connected labeled graphs and their automorphism-group sizes.
        """
    def to_mermaid(self) -> builtins.str:
        r"""
        Export a Mermaid flowchart, with escaped display labels and dangling terminals.
        """

@typing.final
class GraphStyleOptions:
    r"""
    Options applied by `linnest.graph.style` before layout measurement.
    """
    def __repr__(self) -> builtins.str: ...
    def __new__(cls, *, scope: _Dictionary = ..., unit: _LengthValue = ..., node_label: _AutoOptionalContent = ..., node_label_style: _Style = ..., node_style: _OptionalStyle = ..., edge_label: _OptionalContent = ..., edge_label_style: _Style = ...) -> GraphStyleOptions: ...

@typing.final
class HalfEdgeSpec:
    r"""
    A declarative edge endpoint produced by `source()` or `sink()`.
    """
    @property
    def flow(self) -> Flow: ...
    @property
    def data(self) -> typing.Any: ...
    @data.setter
    def data(self, value: typing.Any) -> None: ...
    @property
    def drawing(self) -> HalfEdgeDrawing: ...

@typing.final
class Inherit:
    r"""
    Type of the `INHERIT` sentinel, which preserves a lower-precedence setting.
    """
    def __repr__(self) -> builtins.str: ...
    def __copy__(self) -> Inherit: ...
    def __deepcopy__(self, _memo: typing.Any) -> Inherit: ...

@typing.final
class Insets:
    r"""
    Typed CeTZ/Typst inset values.
    """
    def __repr__(self) -> builtins.str: ...
    def __new__(cls, *, all: _LengthValue = ..., x: _LengthValue = ..., y: _LengthValue = ..., left: _LengthValue = ..., right: _LengthValue = ..., top: _LengthValue = ..., bottom: _LengthValue = ...) -> Insets: ...

@typing.final
class LayoutFrame:
    r"""
    A position snapshot from one continuous force-layout run.
    """
    @property
    def nodes(self) -> builtins.list[tuple[builtins.float, builtins.float]]: ...
    @property
    def edges(self) -> builtins.list[tuple[builtins.float, builtins.float]]: ...
    @property
    def paths(self) -> builtins.list[builtins.list[tuple[builtins.float, builtins.float]]]: ...
    @property
    def iteration(self) -> builtins.int: ...
    @property
    def done(self) -> builtins.bool: ...
    @property
    def max_movement(self) -> builtins.float: ...

@typing.final
class LayoutSettings:
    r"""
    One or more ordered Linnest layout passes.

    `impred_steps` is the nominal cooling budget (default 500).
    `impred_step_scale` is a positive maximum integration stride (default 2):
    the first 20% uses fine steps, then strides land on the existing checkpoints.
    Use 1 for the reference schedule. Native reports count actual solves, while
    progress callbacks count nominal ticks.
    `impred_level` (default true) rotates mixed incoming/outgoing drawings to
    their external-pull optimum at every refinement checkpoint.
    `impred_labels` (default false) opts into label-aware layout: drawn labels
    are fed back as tethered boxes into short warm ImPrEd passes.

    `external_pull_attachment` is a finite nonnegative multiplier for extra demand
    from distributed owners sharing an external X coordinate (default 1).
    `external_pull_balance` is a finite nonnegative exponent on topology weights:
    0 gives uniform pull, 1 (the default) balances topology, and values above 1
    strengthen balancing. It does not change radial pull.
    """
    @property
    def pass_count(self) -> builtins.int: ...
    @staticmethod
    def sequence(passes: typing.Sequence[LayoutSettings]) -> LayoutSettings: ...
    def __repr__(self) -> builtins.str: ...
    def __new__(cls, *, impred_spacing: _Number = ..., impred_repulsion: _Number = ..., impred_attraction: _Number = ..., impred_parallel_balance: _Number = ..., impred_pull: _Number = ..., impred_pull_balance: _Number = ..., impred_pull_attachment: _Number = ..., impred_external_max_points: _Integer = ..., impred_split_length_ratio: _Number = ..., impred_contract_chord_ratio: _Number = ..., impred_edge_clearance: _Number = ..., impred_node_edge_strength: _Number = ..., impred_steps: _Integer = ..., impred_step_scale: _Integer = ..., impred_level: _Boolean = ..., impred_labels: _Boolean = ..., subgraph: _OptionalHedgeSelection = ..., viewport_width: _Number = ..., viewport_height: _Number = ..., tree_dx: _Number = ..., tree_dy: _Number = ..., steps: _Integer = ..., seed: _Integer = ..., step: _Number = ..., step_shrink: _Number = ..., cool: _Number = ..., accept_floor: _Number = ..., early_tolerance: _Number = ..., temperature: _Number = ..., delta: _Number = ..., beta: _Number = ..., spring_strength: _Number = ..., spring_length_scale: _Number = ..., initial_repulsion: _Number = ..., repulsion_growth: _Number = ..., centering_strength: _Number = ..., epochs: _Integer = ..., crossing_penalty: _Number = ..., dangling_repulsion: _Number = ..., dangling_centroid_repulsion: _Number = ..., external_pull: _Number = ..., external_pull_balance: _Number = ..., external_pull_attachment: _Number = ..., edge_edge_repulsion: _Number = ..., directional_force: _Number = ..., internal_label_length_scale: _Number = ..., external_label_length_scale: _Number = ..., label_spring: _Number = ..., label_charge: _Number = ..., label_steps: _Integer = ..., label_layout: _LabelLayoutValue = ..., label_step: _Number = ..., label_early_tolerance: _Number = ..., label_max_delta_scale: _Number = ..., edge_vertex_repulsion: _Number = ..., epsilon: _Number = ..., incremental_energy: _Boolean = ..., algorithm: _LayoutAlgorithmValue = ..., nodes: _LayoutNodesValue = ..., direction: _LayoutDirectionValue = ..., rank_align: _RankAlignmentValue = ..., roots: _NodeIndices = ..., rank_same: _NodeGroups = ..., route_edge_weight: _Number = ..., route_exit_weight: _Number = ..., route_label_width_scale: _Number = ..., route_label_width_cap: _Number = ..., z_spring: _Number = ..., z_spring_growth: _Number = ..., length_scale: _Number = ...) -> LayoutSettings: ...
    def then(self, *, impred_spacing: _Number = ..., impred_repulsion: _Number = ..., impred_attraction: _Number = ..., impred_parallel_balance: _Number = ..., impred_pull: _Number = ..., impred_pull_balance: _Number = ..., impred_pull_attachment: _Number = ..., impred_external_max_points: _Integer = ..., impred_split_length_ratio: _Number = ..., impred_contract_chord_ratio: _Number = ..., impred_edge_clearance: _Number = ..., impred_node_edge_strength: _Number = ..., impred_steps: _Integer = ..., impred_step_scale: _Integer = ..., impred_level: _Boolean = ..., impred_labels: _Boolean = ..., subgraph: _OptionalHedgeSelection = ..., viewport_width: _Number = ..., viewport_height: _Number = ..., tree_dx: _Number = ..., tree_dy: _Number = ..., steps: _Integer = ..., seed: _Integer = ..., step: _Number = ..., step_shrink: _Number = ..., cool: _Number = ..., accept_floor: _Number = ..., early_tolerance: _Number = ..., temperature: _Number = ..., delta: _Number = ..., beta: _Number = ..., spring_strength: _Number = ..., spring_length_scale: _Number = ..., initial_repulsion: _Number = ..., repulsion_growth: _Number = ..., centering_strength: _Number = ..., epochs: _Integer = ..., crossing_penalty: _Number = ..., dangling_repulsion: _Number = ..., dangling_centroid_repulsion: _Number = ..., external_pull: _Number = ..., external_pull_balance: _Number = ..., external_pull_attachment: _Number = ..., edge_edge_repulsion: _Number = ..., directional_force: _Number = ..., internal_label_length_scale: _Number = ..., external_label_length_scale: _Number = ..., label_spring: _Number = ..., label_charge: _Number = ..., label_steps: _Integer = ..., label_layout: _LabelLayoutValue = ..., label_step: _Number = ..., label_early_tolerance: _Number = ..., label_max_delta_scale: _Number = ..., edge_vertex_repulsion: _Number = ..., epsilon: _Number = ..., incremental_energy: _Boolean = ..., algorithm: _LayoutAlgorithmValue = ..., nodes: _LayoutNodesValue = ..., direction: _LayoutDirectionValue = ..., rank_align: _RankAlignmentValue = ..., roots: _NodeIndices = ..., rank_same: _NodeGroups = ..., route_edge_weight: _Number = ..., route_exit_weight: _Number = ..., route_label_width_scale: _Number = ..., route_label_width_cap: _Number = ..., z_spring: _Number = ..., z_spring_growth: _Number = ..., length_scale: _Number = ...) -> LayoutSettings: ...

@typing.final
class LayoutStream:
    r"""
    A synchronous iterator that advances the native force solver in batches.

    Topology is fixed for the lifetime of the stream. Frames contain only
    coordinates and progress, so notebook viewers can retain their SVG elements.
    """
    @property
    def node_names(self) -> builtins.list[builtins.str]:
        r"""
        Node names in the same stable index order as every frame's coordinates.
        """
    @property
    def endpoints(self) -> builtins.list[tuple[typing.Optional[builtins.int], typing.Optional[builtins.int]]]:
        r"""
        Source and sink node indices; a missing endpoint denotes a dangling edge.
        """
    @staticmethod
    def from_dot(dot: builtins.str, *, every: builtins.int = 4, steps: builtins.int = 200, epochs: builtins.int = 8, seed: builtins.int = 1, step: builtins.float = 0.02, cool: builtins.float = 0.85, spring_strength: builtins.float = 1.0, repulsion: builtins.float = 1.5, length_scale: builtins.float = 1.0, spring_length_scale: builtins.float = 1.0, external_pull: builtins.float = 0.0, external_pull_balance: builtins.float = 1.0, external_pull_attachment: builtins.float = 1.0, initial_repulsion: builtins.float = 1.0, repulsion_growth: builtins.float = 0.7, depth_scale: builtins.float = 1.0, flattening_end: builtins.float = 0.5, delta: builtins.float = 0.1, early_tolerance: builtins.float = 1e-06) -> LayoutStream:
        r"""
        Start a force-layout preview from a single DOT graph.

        This preview uses native graph geometry, without Typst label measurement
        or final edge-label relaxation. A new stream restarts from the same seed.
        `spring_length_scale` changes spring rest lengths without scaling repulsion.
        `external_pull_attachment` multiplies the extra demand from distributed
        owners sharing an external X coordinate; zero disables that correction.
        `external_pull` applies a constant left/right pull for mixed external flows,
        or a radial pull when all flows agree. `external_pull_balance` is a finite
        nonnegative exponent on topology weights: 0 gives uniform pull, 1 (the
        default) balances topology, and values above 1 strengthen balancing.
        It does not change radial pull.
        `initial_repulsion` grows to one
        over the `repulsion_growth` fraction of the iteration budget.
        """
    def __iter__(self) -> LayoutStream: ...
    def __next__(self) -> LayoutFrame: ...

@typing.final
class Length:
    r"""
    A Typst length such as `2pt` or `1.2em`.
    """
    @property
    def value(self) -> builtins.float: ...
    @property
    def unit(self) -> builtins.str: ...
    def __new__(cls, value: builtins.float, unit: typing.Literal['pt', 'mm', 'cm', 'in', 'em']) -> Length: ...
    @staticmethod
    def pt(value: builtins.float) -> Length: ...
    @staticmethod
    def mm(value: builtins.float) -> Length: ...
    @staticmethod
    def cm(value: builtins.float) -> Length: ...
    @staticmethod
    def inches(value: builtins.float) -> Length: ...
    @staticmethod
    def em(value: builtins.float) -> Length: ...
    def __repr__(self) -> builtins.str: ...

@typing.final
class Mark:
    r"""
    Typed CeTZ mark configuration.
    """
    @staticmethod
    def barbed() -> Mark: ...
    @staticmethod
    def straight() -> Mark: ...
    def __repr__(self) -> builtins.str: ...
    def __new__(cls, *, start: _NativeValue = ..., end: _NativeValue = ..., fill: _OptionalPaint = ..., stroke: _OptionalStrokeValue = ..., scale: _Number = ..., anchor: _MarkAnchor = ..., shorten_to: _MarkShorten = ...) -> Mark: ...

@typing.final
class MathSymbol:
    r"""
    Safe mathematical identifier content, optionally with scripts.
    """
    def __new__(cls, symbol: builtins.str, *, subscript: builtins.str | builtins.int | None = None, superscript: builtins.str | builtins.int | None = None) -> MathSymbol: ...
    def __repr__(self) -> builtins.str: ...

@typing.final
class NodeSpec:
    r"""
    A reusable declarative node description accepted by `build()` and `Graph.add_node()`.
    """
    @property
    def name(self) -> typing.Optional[builtins.str]: ...
    @property
    def data(self) -> typing.Any: ...
    @data.setter
    def data(self, value: typing.Any) -> None: ...
    @property
    def drawing(self) -> NodeDrawing: ...
    def __repr__(self) -> builtins.str: ...

@typing.final
class OrientedCut:
    r"""
    An oriented cut in a particular graph revision.
    """
    @property
    def left(self) -> Subgraph: ...
    @property
    def right(self) -> Subgraph: ...
    @property
    def edges(self) -> builtins.list[Edge]:
        r"""
        Return the cut edges in stable graph order.
        """
    def side(self, left: builtins.bool) -> Subgraph: ...
    def orientation(self, edge: Edge | builtins.int | builtins.str) -> Orientation:
        r"""
        Return one edge's orientation relative to this cut.
        """
    def winding_number(self, cycle: Cycle) -> builtins.int:
        r"""
        Return the signed intersection count with a cycle from the same graph revision.
        """
    def __repr__(self) -> builtins.str: ...

@typing.final
class Edge:
    r"""
    A live edge view whose data and drawing metadata update its graph.
    """
    @property
    def index(self) -> builtins.int: ...
    @property
    def name(self) -> typing.Optional[builtins.str]: ...
    @property
    def data(self) -> typing.Any: ...
    @data.setter
    def data(self, value: typing.Any) -> None: ...
    @property
    def drawing(self) -> EdgeDrawing: ...
    @property
    def orientation(self) -> Orientation: ...
    @property
    def source(self) -> typing.Optional[HalfEdge]: ...
    @property
    def sink(self) -> typing.Optional[HalfEdge]: ...
    def __repr__(self) -> builtins.str: ...

@typing.final
class EdgeDrawing:
    r"""
    Mutable typed drawing metadata for an edge.
    """
    @property
    def label(self) -> _OptionalStaticContent: ...
    @label.setter
    def label(self, value: _OptionalStaticContent) -> None: ...
    @property
    def placement(self) -> _PlacementValue: ...
    @placement.setter
    def placement(self, value: _PlacementValue) -> None: ...
    @property
    def label_position(self) -> _DrawingPoint: ...
    @label_position.setter
    def label_position(self, value: _DrawingPoint) -> None: ...
    @property
    def label_offset(self) -> _OptionalNumber: ...
    @label_offset.setter
    def label_offset(self, value: _OptionalNumber) -> None: ...
    @property
    def label_angle(self) -> _DrawingAngle: ...
    @label_angle.setter
    def label_angle(self, value: _DrawingAngle) -> None: ...
    @property
    def bend(self) -> _DrawingAngle: ...
    @bend.setter
    def bend(self, value: _DrawingAngle) -> None: ...
    @property
    def routing(self) -> _RoutingValue: ...
    @routing.setter
    def routing(self, value: _RoutingValue) -> None: ...
    @property
    def minimum_length(self) -> _OptionalInteger: ...
    @minimum_length.setter
    def minimum_length(self, value: _OptionalInteger) -> None: ...
    @property
    def same_rank(self) -> _OptionalBoolean: ...
    @same_rank.setter
    def same_rank(self, value: _OptionalBoolean) -> None: ...
    @property
    def style(self) -> _OptionalStyleLayers: ...
    @style.setter
    def style(self, value: _OptionalStyleLayers) -> None: ...
    @property
    def label_style(self) -> _OptionalStyle: ...
    @label_style.setter
    def label_style(self, value: _OptionalStyle) -> None: ...
    @property
    def decoration(self) -> _DrawingDecoration: ...
    @decoration.setter
    def decoration(self, value: _DrawingDecoration) -> None: ...
    @property
    def extensions(self) -> builtins.dict[builtins.str, _NativeValue]: ...
    @extensions.setter
    def extensions(self, value: builtins.dict[builtins.str, _NativeValue]) -> None: ...
    def __repr__(self) -> builtins.str: ...
    def __new__(cls, *, label: _OptionalStaticContent = ..., placement: _PlacementValue = ..., label_position: _DrawingPoint = ..., label_offset: _OptionalNumber = ..., label_angle: _DrawingAngle = ..., bend: _DrawingAngle = ..., routing: _RoutingValue = ..., minimum_length: _OptionalInteger = ..., same_rank: _OptionalBoolean = ..., style: _OptionalStyleLayers = ..., label_style: _OptionalStyle = ..., decoration: _DrawingDecoration = ..., extensions: _NativeDict = ...) -> EdgeDrawing: ...

@typing.final
class EdgeValue:
    r"""
    Detached edge data and drawing metadata passed across a `DotCodec` boundary.
    """
    @property
    def data(self) -> typing.Any: ...
    @data.setter
    def data(self, value: typing.Any) -> None: ...
    @property
    def drawing(self) -> EdgeDrawing: ...
    def __new__(cls, *, data: typing.Any = None, drawing: typing.Optional[EdgeDrawing] = None) -> EdgeValue: ...

@typing.final
class HalfEdge:
    r"""
    A live half-edge view whose data and drawing metadata update its graph.
    """
    @property
    def index(self) -> builtins.int: ...
    @property
    def flow(self) -> Flow: ...
    @property
    def data(self) -> typing.Any: ...
    @data.setter
    def data(self, value: typing.Any) -> None: ...
    @property
    def drawing(self) -> HalfEdgeDrawing: ...
    @property
    def node(self) -> Node: ...
    @property
    def edge(self) -> Edge: ...
    @property
    def pair(self) -> typing.Optional[HalfEdge]: ...
    def __repr__(self) -> builtins.str: ...

@typing.final
class HalfEdgeDrawing:
    r"""
    Mutable typed drawing metadata for one endpoint of an edge.
    """
    @property
    def label(self) -> _OptionalStaticContent: ...
    @label.setter
    def label(self, value: _OptionalStaticContent) -> None: ...
    @property
    def statement(self) -> _DrawingString: ...
    @statement.setter
    def statement(self, value: _DrawingString) -> None: ...
    @property
    def port_label(self) -> _DrawingString: ...
    @port_label.setter
    def port_label(self, value: _DrawingString) -> None: ...
    @property
    def compass(self) -> _CompassValue: ...
    @compass.setter
    def compass(self, value: _CompassValue) -> None: ...
    @property
    def route_points(self) -> _DrawingPoints: ...
    @route_points.setter
    def route_points(self, value: _DrawingPoints) -> None: ...
    @property
    def anchor(self) -> _AnchorValue: ...
    @anchor.setter
    def anchor(self, value: _AnchorValue) -> None: ...
    @property
    def routing(self) -> _RoutingValue: ...
    @routing.setter
    def routing(self, value: _RoutingValue) -> None: ...
    @property
    def style(self) -> _OptionalStyleLayers: ...
    @style.setter
    def style(self, value: _OptionalStyleLayers) -> None: ...
    @property
    def extensions(self) -> builtins.dict[builtins.str, _NativeValue]: ...
    @extensions.setter
    def extensions(self, value: builtins.dict[builtins.str, _NativeValue]) -> None: ...
    def __repr__(self) -> builtins.str: ...
    def __new__(cls, *, label: _OptionalStaticContent = ..., statement: _DrawingString = ..., port_label: _DrawingString = ..., compass: _CompassValue = ..., route_points: _DrawingPoints = ..., anchor: _AnchorValue = ..., routing: _RoutingValue = ..., style: _OptionalStyleLayers = ..., extensions: _NativeDict = ...) -> HalfEdgeDrawing: ...

@typing.final
class HalfEdgeValue:
    r"""
    Detached half-edge data and drawing metadata passed across a `DotCodec` boundary.
    """
    @property
    def data(self) -> typing.Any: ...
    @data.setter
    def data(self, value: typing.Any) -> None: ...
    @property
    def drawing(self) -> HalfEdgeDrawing: ...
    def __new__(cls, *, data: typing.Any = None, drawing: typing.Optional[HalfEdgeDrawing] = None) -> HalfEdgeValue: ...

@typing.final
class Node:
    r"""
    A live node view whose data and drawing metadata update its graph.
    """
    @property
    def index(self) -> builtins.int: ...
    @property
    def name(self) -> typing.Optional[builtins.str]: ...
    @property
    def data(self) -> typing.Any: ...
    @data.setter
    def data(self, value: typing.Any) -> None: ...
    @property
    def drawing(self) -> NodeDrawing: ...
    @property
    def incidence(self) -> builtins.list[HalfEdge]: ...
    def __repr__(self) -> builtins.str: ...

@typing.final
class NodeDrawing:
    r"""
    Mutable typed drawing metadata for a node.
    """
    @property
    def label(self) -> _OptionalStaticContent: ...
    @label.setter
    def label(self, value: _OptionalStaticContent) -> None: ...
    @property
    def placement(self) -> _PlacementValue: ...
    @placement.setter
    def placement(self, value: _PlacementValue) -> None: ...
    @property
    def shift(self) -> _DrawingPoint: ...
    @shift.setter
    def shift(self, value: _DrawingPoint) -> None: ...
    @property
    def rank(self) -> _OptionalInteger: ...
    @rank.setter
    def rank(self, value: _OptionalInteger) -> None: ...
    @property
    def minimum_size(self) -> _OptionalNumber: ...
    @minimum_size.setter
    def minimum_size(self, value: _OptionalNumber) -> None: ...
    @property
    def maximum_size(self) -> _OptionalNumber: ...
    @maximum_size.setter
    def maximum_size(self, value: _OptionalNumber) -> None: ...
    @property
    def style(self) -> _OptionalStyle: ...
    @style.setter
    def style(self, value: _OptionalStyle) -> None: ...
    @property
    def label_style(self) -> _OptionalStyle: ...
    @label_style.setter
    def label_style(self, value: _OptionalStyle) -> None: ...
    @property
    def extensions(self) -> builtins.dict[builtins.str, _NativeValue]: ...
    @extensions.setter
    def extensions(self, value: builtins.dict[builtins.str, _NativeValue]) -> None: ...
    def __repr__(self) -> builtins.str: ...
    def __new__(cls, *, label: _OptionalStaticContent = ..., placement: _PlacementValue = ..., shift: _DrawingPoint = ..., rank: _OptionalInteger = ..., minimum_size: _OptionalNumber = ..., maximum_size: _OptionalNumber = ..., style: _OptionalStyle = ..., label_style: _OptionalStyle = ..., extensions: _NativeDict = ...) -> NodeDrawing: ...

@typing.final
class NodeValue:
    r"""
    Detached node data and drawing metadata passed across a `DotCodec` boundary.
    """
    @property
    def data(self) -> typing.Any: ...
    @data.setter
    def data(self, value: typing.Any) -> None: ...
    @property
    def drawing(self) -> NodeDrawing: ...
    def __new__(cls, *, data: typing.Any = None, drawing: typing.Optional[NodeDrawing] = None) -> NodeValue: ...

@typing.final
class Ratio:
    r"""
    A Typst ratio expressed in percent.
    """
    @property
    def percent(self) -> builtins.float: ...
    def __new__(cls, percent: builtins.float) -> Ratio: ...
    @staticmethod
    def from_fraction(value: builtins.float) -> Ratio: ...
    def __repr__(self) -> builtins.str: ...

@typing.final
class RelativeLength:
    r"""
    A sum of a Typst ratio and length.
    """
    def __new__(cls, ratio: typing.Optional[Ratio] = None, length: typing.Optional[Length] = None) -> RelativeLength: ...
    def __repr__(self) -> builtins.str: ...

@typing.final
class RenderSettings:
    r"""
    Complete typed rendering configuration.
    """
    @property
    def title(self) -> _AutoOptionalStaticContent: ...
    @title.setter
    def title(self, value: _AutoOptionalStaticContent) -> None: ...
    @property
    def style(self) -> _RenderStyle: ...
    @style.setter
    def style(self, value: _RenderStyle) -> None: ...
    @property
    def layouts(self) -> _RenderLayouts: ...
    @layouts.setter
    def layouts(self, value: _RenderLayouts) -> None: ...
    @property
    def drawing(self) -> _RenderDrawing: ...
    @drawing.setter
    def drawing(self, value: _RenderDrawing) -> None: ...
    @property
    def selectors(self) -> _RenderSelectors: ...
    @selectors.setter
    def selectors(self, value: _RenderSelectors) -> None: ...
    def overlay(self, overlay: RenderSettings) -> RenderSettings: ...
    def __repr__(self) -> builtins.str: ...
    def __new__(cls, *, title: _AutoOptionalStaticContent = ..., style: _RenderStyle = ..., layouts: _RenderLayouts = ..., drawing: _RenderDrawing = ..., selectors: _RenderSelectors = ...) -> RenderSettings: ...

@typing.final
class Stroke:
    r"""
    A typed Typst stroke dictionary.
    """
    def __repr__(self) -> builtins.str: ...
    def __new__(cls, *, paint: _OptionalPaint = ..., thickness: _OptionalLengthValue = ..., cap: _OptionalStrokeCap = ..., join: _OptionalStrokeJoin = ..., dash: _OptionalDashValue = ..., miter_limit: _Number = ...) -> Stroke: ...

@typing.final
class Subgraph:
    r"""
    A graph-bound structural selection.
    """
    @property
    def graph(self) -> Graph: ...
    @property
    def revision(self) -> builtins.int: ...
    @property
    def size(self) -> builtins.int: ...
    @property
    def n_half_edges(self) -> builtins.int: ...
    @property
    def n_isolated_nodes(self) -> builtins.int: ...
    def __len__(self) -> builtins.int: ...
    def __bool__(self) -> builtins.bool: ...
    def includes(self, half_edge: builtins.int) -> builtins.bool: ...
    def half_edge_indices(self) -> builtins.list[builtins.int]:
        r"""
        Return stable indices suitable for constructing another selection on this revision.
        """
    def isolated_node_indices(self) -> builtins.list[builtins.int]:
        r"""
        Return the explicitly selected zero-crown node indices.
        """
    def includes_node(self, node: builtins.int) -> builtins.bool: ...
    def to_half_edges(self) -> builtins.list[HalfEdge]: ...
    def is_subset(self, other: Subgraph) -> builtins.bool: ...
    def is_superset(self, other: Subgraph) -> builtins.bool: ...
    def is_disjoint(self, other: Subgraph) -> builtins.bool: ...
    def union(self, other: Subgraph) -> Subgraph: ...
    def intersection(self, other: Subgraph) -> Subgraph: ...
    def symmetric_difference(self, other: Subgraph) -> Subgraph: ...
    def difference(self, other: Subgraph) -> Subgraph: ...
    def complement(self) -> Subgraph: ...
    def __contains__(self, half_edge: builtins.int) -> builtins.bool: ...
    def __or__(self, other: Subgraph) -> Subgraph: ...
    def __and__(self, other: Subgraph) -> Subgraph: ...
    def __xor__(self, other: Subgraph) -> Subgraph: ...
    def __sub__(self, other: Subgraph) -> Subgraph: ...
    def __invert__(self) -> Subgraph: ...
    def __eq__(self, other: builtins.object) -> builtins.bool: ...
    def __le__(self, other: Subgraph) -> builtins.bool: ...
    def __lt__(self, other: Subgraph) -> builtins.bool: ...
    def __ge__(self, other: Subgraph) -> builtins.bool: ...
    def __gt__(self, other: Subgraph) -> builtins.bool: ...
    def render(self, *, config: RenderSettings | None = None) -> DiagramView:
        r"""
        Prepare the full owner graph with this selection highlighted and its complement dotted.
        The owner's layout, drawing configuration, and topology remain unchanged.
        """
    def to_svg(self, *, config: RenderSettings | None = None, browser: typing.Optional[builtins.str] = None) -> builtins.str:
        r"""
        Render this selection in the context of the full graph, including isolated nodes.
        """
    def _mime_(self) -> typing.Any: ...
    def _repr_mimebundle_(self, include: typing.Optional[typing.Sequence[builtins.str]] = None, exclude: typing.Optional[typing.Sequence[builtins.str]] = None) -> typing.Any:
        r"""
        Show the selected half-edges within their complete graph in notebook output.
        """
    def __repr__(self) -> builtins.str: ...

@typing.final
class TextLabel:
    r"""
    Literal text content with optional typed text styling.
    """
    @property
    def text(self) -> builtins.str: ...
    def __repr__(self) -> builtins.str: ...
    def __new__(cls, text: str, *, fill: _Paint = ..., size: _LengthValue = ..., weight: _NativeValue = ..., style: _TextStyleValue = ...) -> TextLabel: ...

@typing.final
class TraversalTree:
    r"""
    A graph-bound DFS or BFS traversal tree.
    """
    @property
    def subgraph(self) -> Subgraph: ...
    @property
    def nodes(self) -> builtins.list[Node]: ...
    @property
    def half_edges(self) -> builtins.list[HalfEdge]: ...
    def covers(self, subgraph: Subgraph) -> Subgraph: ...
    def parent(self, node: Node | builtins.int | builtins.str) -> typing.Optional[Node]:
        r"""
        Return the immediate parent, or `None` for the traversal root.
        """
    def children(self, node: Node | builtins.int | builtins.str) -> builtins.list[Node]:
        r"""
        Return the immediate children in traversal discovery order.
        """
    def ancestors(self, node: Node | builtins.int | builtins.str) -> builtins.list[Node]:
        r"""
        Return strict ancestors from the immediate parent through the root.
        """
    def fundamental_cycle(self, half_edge: _HalfEdgeTarget) -> typing.Optional[Cycle]:
        r"""
        Return the fundamental cycle closed by an internal edge, or `None` for a tree edge.
        """

@typing.final
class TypstBind:
    r"""
    A Typst function partially applied through its native `.with` method.
    """
    def call(self, *args: _NativeValue, **kwargs: _NativeValue) -> TypstCall: ...
    def __repr__(self) -> builtins.str: ...

@typing.final
class TypstCall:
    r"""
    A call to an explicitly imported Typst function.
    """
    def __repr__(self) -> builtins.str: ...

@typing.final
class TypstModule:
    r"""
    A local or package Typst module whose exports can be referenced safely.
    """
    @staticmethod
    def file(path: builtins.str | os.PathLike[builtins.str]) -> TypstModule: ...
    @staticmethod
    def package(specification: builtins.str) -> TypstModule: ...
    def value(self, export: builtins.str) -> _TypstValueRef: ...
    def content(self, export: builtins.str) -> _TypstContentRef: ...
    def function(self, export: builtins.str) -> _TypstFunctionRef: ...
    def __repr__(self) -> builtins.str: ...

@typing.final
class TypstRef:
    r"""
    A typed export from a Typst module.
    """
    def call(self, *args: _NativeValue, **kwargs: _NativeValue) -> TypstCall: ...
    def bind(self, *args: _NativeValue, **kwargs: _NativeValue) -> TypstBind: ...
    def __repr__(self) -> builtins.str: ...

@typing.final
class DebugLevel(enum.Enum):
    r"""
    Finite debug detail accepted by Linnest's drawing layer.
    """
    Off = ...
    Canvas = ...
    EdgePositions = ...

@typing.final
class DirectionBasis(enum.Enum):
    r"""
    Selects which notion of edge direction a directed algorithm follows.
    """
    Underlying = ...
    r"""
    Follow the source/sink roles stored by the half-edge involution.
    """
    Superficial = ...
    r"""
    Apply each edge's superficial orientation and ignore undirected edges.
    """

@typing.final
class Flow(enum.Enum):
    r"""
    The directed role of a half-edge within its edge.
    """
    Source = ...
    Sink = ...

@typing.final
class NodeStore(enum.Enum):
    r"""
    Storage strategy used for graph nodes.
    """
    Vec = ...
    r"""
    Dense node records with one incidence bitset per node.
    """
    Forest = ...
    r"""
    Identification-preserving forest node records.
    """

@typing.final
class Orientation(enum.Enum):
    r"""
    How an edge's declared endpoints determine its logical direction.
    """
    Default = ...
    Reversed = ...
    Undirected = ...

@typing.final
class Anchor(enum.Enum):
    r"""
    A finite CeTZ box or content anchor.
    """
    Center = ...
    North = ...
    NorthEast = ...
    East = ...
    SouthEast = ...
    South = ...
    SouthWest = ...
    West = ...
    NorthWest = ...

@typing.final
class Compass(enum.Enum):
    r"""
    A finite DOT compass point.
    """
    N = ...
    NE = ...
    E = ...
    SE = ...
    S = ...
    SW = ...
    W = ...
    NW = ...
    Center = ...
    Any = ...

@typing.final
class DanglingTangent(enum.Enum):
    r"""
    Tangent constraint at the free endpoint of a dangling edge.
    """
    Horizontal = ...
    Vertical = ...

@typing.final
class DashPattern(enum.Enum):
    r"""
    Built-in Typst stroke dash pattern.
    """
    Solid = ...
    Dotted = ...
    DenselyDotted = ...
    LooselyDotted = ...
    Dashed = ...
    DenselyDashed = ...
    LooselyDashed = ...
    DashDotted = ...
    DenselyDashDotted = ...
    LooselyDashDotted = ...

@typing.final
class EdgeLengthResolution(enum.Enum):
    r"""
    How fixed and relative edge-length limits are combined.
    """
    Min = ...
    Shorter = ...
    Max = ...
    Longer = ...
    Length = ...
    Fixed = ...
    Ratio = ...
    Relative = ...
    Disabled = ...
    Full = ...

@typing.final
class LabelLayout(enum.Enum):
    r"""
    Strategy used to position edge labels.
    """
    Normal = ...
    DanglingTangent = ...
    FixedLength = ...
    FixedGap = ...

@typing.final
class LayoutAlgorithm(enum.Enum):
    r"""
    Algorithm used by a Linnest layout pass.
    """
    Force = ...
    Impred = ...
    Anneal = ...
    Tree = ...
    Dot = ...
    StableLayered = ...

@typing.final
class LayoutDirection(enum.Enum):
    r"""
    Rank direction used by tree and layered layouts.
    """
    Down = ...
    Right = ...

@typing.final
class LayoutNodes(enum.Enum):
    r"""
    Whether a pass lays out or preserves its selected nodes.
    """
    Layout = ...
    Fixed = ...

@typing.final
class MarkDirection(enum.Enum):
    r"""
    Direction of a mark along an edge path.
    """
    Forward = ...
    Backward = ...

@typing.final
class MarkOrientation(enum.Enum):
    r"""
    Frame used to orient an edge mark.
    """
    Path = ...
    Edge = ...

@typing.final
class MarkPosition(enum.Enum):
    r"""
    Location of a mark on a rendered edge path.
    """
    End = ...
    Center = ...
    CenterIfDangling = ...

@typing.final
class MarkSymbol(enum.Enum):
    r"""
    Built-in arrowhead symbol used by CeTZ edge marks.
    """
    Barbed = ...
    Straight = ...

@typing.final
class Pattern(enum.Enum):
    r"""
    Kurvst path decoration pattern.
    """
    Wave = ...
    Zigzag = ...
    Coil = ...
    Normal = ...
    Curve = ...

@typing.final
class Placement(enum.Enum):
    r"""
    Coordinate-constraint mode for an explicit placement.
    """
    Pin = ...
    Start = ...

@typing.final
class RankAlignment(enum.Enum):
    r"""
    Alignment within a layered-layout rank.
    """
    Center = ...
    Start = ...
    Left = ...
    End = ...
    Right = ...

@typing.final
class RoutePoints(enum.Enum):
    r"""
    Whether layout-provided route points participate in edge routing.
    """
    Ignore = ...
    Through = ...

@typing.final
class Routing(enum.Enum):
    r"""
    Route construction used for an anchored edge.
    """
    EdgePosition = ...
    Direct = ...
    HobbyThrough = ...
    StraightThrough = ...

@typing.final
class StrokeCap(enum.Enum):
    r"""
    Endpoint shape for a Typst stroke.
    """
    Butt = ...
    Round = ...
    Square = ...

@typing.final
class StrokeJoin(enum.Enum):
    r"""
    Join shape for a Typst stroke.
    """
    Miter = ...
    Round = ...
    Bevel = ...

@typing.final
class TextStyle(enum.Enum):
    r"""
    Finite Typst text slant.
    """
    Normal = ...
    Italic = ...
    Oblique = ...

def build(*items: _GraphItem, name: _OptionalString = None, global_data: _OptionalGlobalData = None, codec: _OptionalDotCodec = None, render_config: _OptionalRenderSettings = None, node_store: NodeStore = NodeStore.Vec) -> Graph:
    r"""
    Build a graph from declarative node and edge specs.
    """

def edge(first: HalfEdgeSpec, name: _OptionalString = None, second: _OptionalHalfEdgeSpec = None, *, data: typing.Any = None, orientation: Orientation = Orientation.Default, label: _OptionalStaticContent = ..., placement: _PlacementValue = ..., label_position: _DrawingPoint = ..., label_offset: _OptionalNumber = ..., label_angle: _DrawingAngle = ..., bend: _DrawingAngle = ..., routing: _RoutingValue = ..., minimum_length: _OptionalInteger = ..., same_rank: _OptionalBoolean = ..., style: _OptionalStyleLayers = ..., label_style: _OptionalStyle = ..., decoration: _DrawingDecoration = ..., extensions: _NativeDict = ...) -> EdgeSpec:
    r"""
    Describe an edge from one or two endpoint specs.
    """

def node(name: _OptionalString = None, *, data: typing.Any = None, label: _OptionalStaticContent = ..., placement: _PlacementValue = ..., shift: _DrawingPoint = ..., rank: _OptionalInteger = ..., minimum_size: _OptionalNumber = ..., maximum_size: _OptionalNumber = ..., style: _OptionalStyle = ..., label_style: _OptionalStyle = ..., extensions: _NativeDict = ...) -> NodeSpec:
    r"""
    Describe a node while preserving its arbitrary Python data by identity.
    """

def sink(node: _EndpointTarget, *, data: typing.Any = None, label: _OptionalStaticContent = ..., statement: _DrawingString = ..., port_label: _DrawingString = ..., compass: _CompassValue = ..., anchor: _AnchorValue = ..., routing: _RoutingValue = ..., style: _OptionalStyleLayers = ..., extensions: _NativeDict = ...) -> HalfEdgeSpec:
    r"""
    Attach a sink endpoint. Build resolves specs, names, indices, and live-node keys; incremental insertion resolves current graph references.
    """

def source(node: _EndpointTarget, *, data: typing.Any = None, label: _OptionalStaticContent = ..., statement: _DrawingString = ..., port_label: _DrawingString = ..., compass: _CompassValue = ..., anchor: _AnchorValue = ..., routing: _RoutingValue = ..., style: _OptionalStyleLayers = ..., extensions: _NativeDict = ...) -> HalfEdgeSpec:
    r"""
    Attach a source endpoint. Build resolves specs, names, indices, and live-node keys; incremental insertion resolves current graph references.
    """
