refactor(format): replace wildcard imports

This commit is contained in:
Dylan M. Taylor
2026-10-28 16:00:36 +00:00
parent 99afdd99ab
commit c618e402fa
16 changed files with 37 additions and 16 deletions
+4 -1
View File
@@ -1,5 +1,8 @@
use super::common::{layout_grid, node_field, prop_type, resolved_type, scope_name, variant_pairs};
use super::*;
use super::{
AUX, Action, Affine, Bound, Color, Exporter, Fields, Kv, LAYERS, MAX_NODES, Node, NodeId, NodeKind, Overlay, OverlayPosition, Paint, StyleKind,
TextData, VariableValue, arr, b, color, e, fl, guid, matrix, o, position, root_fields, s, u, xy,
};
impl<'d> Exporter<'d> {
/// GUIDs for every layer (pages first, then depth-first), component property definitions,
+5 -1
View File
@@ -1,4 +1,8 @@
use super::*;
use super::{
Bound, ExportSize, Fields, GAMEPAD_BUTTONS, GridAlign, GridKind, KeyMods, Kv, LetterSpacing, LineHeight, MAX_NETWORK, Node, NodeKind, Paint,
PropDef, SCHEMA, TextCase, TextDecoration, TextStyle, VariableType, VectorNetwork, WindingRule, arr, b, color, e, face_style, fl, guid, int, o,
s, xy,
};
/// Longest kept description of such a layer (bytes of JSON).
const MAX_STASH: usize = 1 << 20;
+1 -1
View File
@@ -1,7 +1,7 @@
use super::common::{
bool_data, changed, prop_type, resolved_alike, scaled, sort_position, symbol_data, text_data, text_value, var_data, variant_pairs,
};
use super::*;
use super::{AUX, BTreeMap, Exporter, Fields, Kv, MAX_NODES, Node, NodeId, NodeKind, PropDef, Value, arr, b, e, fl, guid, o, s};
impl<'d> Exporter<'d> {
/// A component property definition of `owner` (a component, or a set), `index`-th in its list.
+5 -1
View File
@@ -1,5 +1,9 @@
use super::common::{export_setting, layout_grid, outlined, prop_type, variant_pairs};
use super::*;
use super::{
AUX, AutoLayout, BoolOp, Bound, ContentAlign, CrossAlign, Exporter, Fields, HConstraint, Kv, LAYERS, LayoutMode, MAX_DEPTH, MainAlign, MaskType,
Node, NodeId, NodeKind, PropDef, STASH, Sizing, TextData, TextStyle, VConstraint, WindingRule, arr, b, blend_name, color, e, fl, grid_sizing,
guid, int, matrix, o, position, root_fields, s, u, xy,
};
impl<'d> Exporter<'d> {
/// Write layer `id` (child `index` of the layer with GUID `parent_guid`) and its subtree.
+4 -1
View File
@@ -1,5 +1,8 @@
use super::common::one_sided;
use super::*;
use super::{
Affine, Bound, EffectKind, Exporter, Fields, GradientKind, ImageScaleMode, Kv, MAX_IMAGE, Node, NodeKind, NoiseMode, Paint, PaintKind,
StrokeAlign, StrokeCap, arr, b, blend_name, cap_name, color, e, fl, join_name, matrix, o, s, sha1_hex, xy,
};
impl<'d> Exporter<'d> {
/// A paint list: a layer's fills (`fills`) or strokes with the variables `bound` to them.
+4 -1
View File
@@ -1,5 +1,8 @@
use super::common::key_codes;
use super::*;
use super::{
Action, Direction, Easing, Exporter, Fields, Interaction, Kv, Node, NodeId, Overflow, OverlayPosition, ScrollPosition, Transition, Trigger, arr,
b, color, e, fl, int, o, position, s,
};
impl<'d> Exporter<'d> {
/// Interactions, scrolling, flow starts and the overlay settings this layer is opened with.
+5 -1
View File
@@ -1,5 +1,9 @@
use super::common::{style_fields, unsupported_decoration_look};
use super::*;
use super::{
Affine, BezPath, Bound, Exporter, Fields, Kv, ListStyle, MAX_CANVAS, MAX_CHARS, MAX_NETWORK, Node, NodeKind, Paint, StrokeAlign, StrokeCap,
StrokeJoin, TextAlignH, TextAlignV, TextAutoResize, TextData, TextStyle, VectorNetwork, WindingRule, arr, b, cap_name, e, finite, fl, int,
join_name, network, o, path_blob, s, u, xy,
};
impl<'d> Exporter<'d> {
/// Text: its style, box settings, and characters with their styled runs. `fills`: the layer's
+1 -1
View File
@@ -400,7 +400,7 @@ impl<'s> Decoder<'s, '_> {
/// An encoder for the same format: the `.fig` export writes its schema and message with it (and
/// test fixtures are built with it). Values are checked against the schema; it never panics.
pub mod encode {
use super::*;
use super::{BUILTINS, Field, Kind, KiwiError, Kv, MAX_DEPTH, Schema, Type, err};
#[derive(Default)]
pub struct Writer(pub Vec<u8>);
+1 -1
View File
@@ -1,6 +1,6 @@
use super::layer::own_text;
use super::text::char_styles;
use super::*;
use super::{BTreeMap, BTreeSet, Kv, MAX_DEPTH, Mapper, Obj, Rc, Value, View, guid, json};
/// An override row names a layer of the main by its current GUID or by the `overrideKey` the
/// layer had when the row was written: the key becomes the current GUID, unless the layer is
+1 -1
View File
@@ -1,5 +1,5 @@
use super::layer::{cap_name, own_text, svg_path, valid_size};
use super::*;
use super::{Affine, Kv, Mapper, NO_STYLE, Obj, Point, Value, View, guid, json, matrix, network, num, rows};
impl<'a> Mapper<'a> {
/// A connector's end caps, and when it has no saved outline or network a straight line
+1 -1
View File
@@ -1,7 +1,7 @@
use super::component::{assigned, prop_guid};
use super::paint::color;
use super::variables::variable_value;
use super::*;
use super::{Affine, BTreeMap, BTreeSet, Kv, MAX_DEPTH, Mapper, Obj, Value, View, copy_str, guid, json, rows};
impl<'a> Mapper<'a> {
/// The DOCUMENT with its pages.
+1 -1
View File
@@ -1,5 +1,5 @@
use super::paint::{bound, color};
use super::*;
use super::{BTreeMap, BTreeSet, Kv, MAX_GRID_TRACK_VALUE, MAX_GRID_TRACKS, Mapper, Obj, Value, View, copy_num, guid, json, num};
impl<'a> Mapper<'a> {
pub(super) fn auto_layout(&mut self, o: &mut Obj, v: &View<'a>) {
+1 -1
View File
@@ -1,6 +1,6 @@
use super::layer::cap_name;
use super::variables::alias;
use super::*;
use super::{Affine, Kv, Mapper, NO_STYLE, Obj, Point, Value, View, copy_num, copy_str, guid, json, matrix, num, rows, vec2};
fn filter_number(value: &Kv) -> Option<f64> {
let number = match value {
+1 -1
View File
@@ -1,6 +1,6 @@
use super::paint::color;
use super::variables::variable_data;
use super::*;
use super::{Kv, MAX_ACTION_DEPTH, Mapper, Obj, Value, View, copy_str, guid, json, num, ref_guid};
impl<'a> Mapper<'a> {
pub(super) fn prototype(&mut self, o: &mut Obj, v: &View<'a>) {
+1 -1
View File
@@ -1,5 +1,5 @@
use super::paint::{paint, style_link};
use super::*;
use super::{Kv, Mapper, Obj, Value, View, copy_num, copy_str, json, network, num};
/// The value from the last override layer holding a valid one for an optional text setting; invalid instance rows fall through.
fn text_num(v: &View, key: &str) -> Option<f64> {
+1 -1
View File
@@ -1,5 +1,5 @@
use super::paint::color;
use super::*;
use super::{Kv, MAX_EXPR_DEPTH, Mapper, Obj, Value, View, guid, json, num, ref_guid};
impl<'a> Mapper<'a> {
pub(super) fn variable_bindings(&mut self, o: &mut Obj, v: &View<'a>) {