mirror of
https://github.com/GraphiteEditor/Graphite.git
synced 2026-09-25 11:38:12 +08:00
Groundwork for integrating Specta (#949)
* add derive(specta::Type) * use specta from git * introduce Uuid type * remove unnecessary specta::Type * document export_types test * upgrade Specta The previous Specta branch had some hacks that were just for this project. They have all been converted into proper features so they can be merged into main. * remove some unnecessary specta::Type uses * add MessageDiscriminantDef explanation * manually export types with specta * rename 'specta.rs' to 'export_types.rs' * rename 'export_types' to 'generate_ts_types' --------- Co-authored-by: Oscar Beaumont <oscar@otbeaumont.me>
This commit is contained in:
committed by
Keavon Chambers
co-authored by
Oscar Beaumont
parent
abe3470627
commit
0d8be71426
@@ -17,7 +17,7 @@ use glam::{DAffine2, DMat2, DVec2};
|
||||
use serde::{Deserialize, Serialize};
|
||||
use std::fmt::Write;
|
||||
|
||||
#[derive(Debug, Clone, PartialEq, Deserialize, Serialize)]
|
||||
#[derive(Debug, Clone, PartialEq, Deserialize, Serialize, specta::Type)]
|
||||
/// Represents different types of layers.
|
||||
pub enum LayerDataType {
|
||||
/// A layer that wraps a [FolderLayer] struct.
|
||||
@@ -54,7 +54,7 @@ impl LayerDataType {
|
||||
}
|
||||
}
|
||||
|
||||
#[derive(Debug, Clone, Copy, Serialize, Deserialize, PartialEq, Eq, Hash)]
|
||||
#[derive(Debug, Clone, Copy, Serialize, Deserialize, PartialEq, Eq, Hash, specta::Type)]
|
||||
pub enum LayerDataTypeDiscriminant {
|
||||
Folder,
|
||||
Shape,
|
||||
@@ -216,7 +216,7 @@ fn return_true() -> bool {
|
||||
true
|
||||
}
|
||||
|
||||
#[derive(Debug, PartialEq, Deserialize, Serialize)]
|
||||
#[derive(Debug, PartialEq, Deserialize, Serialize, specta::Type)]
|
||||
pub struct Layer {
|
||||
/// Whether the layer is currently visible or hidden.
|
||||
pub visible: bool,
|
||||
|
||||
Reference in New Issue
Block a user