mirror of
https://github.com/zed-industries/zed.git
synced 2025-01-30 22:34:13 +00:00
feat: add ts export
This commit is contained in:
parent
b494b43496
commit
cfc1856210
3 changed files with 13 additions and 0 deletions
|
@ -11,9 +11,12 @@ use serde::{
|
||||||
Deserialize, Deserializer,
|
Deserialize, Deserializer,
|
||||||
};
|
};
|
||||||
use serde_json::json;
|
use serde_json::json;
|
||||||
|
use ts_rs::TS;
|
||||||
|
|
||||||
#[derive(Clone, Copy, Default, PartialEq, Eq, Hash, PartialOrd, Ord)]
|
#[derive(Clone, Copy, Default, PartialEq, Eq, Hash, PartialOrd, Ord)]
|
||||||
#[repr(transparent)]
|
#[repr(transparent)]
|
||||||
|
#[derive(TS)]
|
||||||
|
#[ts(export, export_to = "theme/types/")]
|
||||||
pub struct Color(ColorU);
|
pub struct Color(ColorU);
|
||||||
|
|
||||||
impl Color {
|
impl Color {
|
||||||
|
|
|
@ -12,8 +12,11 @@ use std::{
|
||||||
ops::{Deref, DerefMut},
|
ops::{Deref, DerefMut},
|
||||||
sync::Arc,
|
sync::Arc,
|
||||||
};
|
};
|
||||||
|
use ts_rs::TS;
|
||||||
|
|
||||||
#[derive(Copy, Clone, Debug, Eq, PartialEq, Hash)]
|
#[derive(Copy, Clone, Debug, Eq, PartialEq, Hash)]
|
||||||
|
#[derive(TS)]
|
||||||
|
#[ts(export, export_to = "theme/types/")]
|
||||||
pub struct FamilyId(usize);
|
pub struct FamilyId(usize);
|
||||||
|
|
||||||
struct Family {
|
struct Family {
|
||||||
|
|
|
@ -15,8 +15,11 @@ use schemars::JsonSchema;
|
||||||
use serde::{de, Deserialize, Serialize};
|
use serde::{de, Deserialize, Serialize};
|
||||||
use serde_json::Value;
|
use serde_json::Value;
|
||||||
use std::{cell::RefCell, sync::Arc};
|
use std::{cell::RefCell, sync::Arc};
|
||||||
|
use ts_rs::TS;
|
||||||
|
|
||||||
#[derive(Copy, Clone, Debug, Eq, PartialEq, Hash)]
|
#[derive(Copy, Clone, Debug, Eq, PartialEq, Hash)]
|
||||||
|
#[derive(TS)]
|
||||||
|
#[ts(export, export_to = "theme/types/")]
|
||||||
pub struct FontId(pub usize);
|
pub struct FontId(pub usize);
|
||||||
|
|
||||||
pub type GlyphId = u32;
|
pub type GlyphId = u32;
|
||||||
|
@ -60,6 +63,8 @@ pub struct Features {
|
||||||
}
|
}
|
||||||
|
|
||||||
#[derive(Clone, Debug)]
|
#[derive(Clone, Debug)]
|
||||||
|
#[derive(TS)]
|
||||||
|
#[ts(export, export_to = "theme/types/")]
|
||||||
pub struct TextStyle {
|
pub struct TextStyle {
|
||||||
pub color: Color,
|
pub color: Color,
|
||||||
pub font_family_name: Arc<str>,
|
pub font_family_name: Arc<str>,
|
||||||
|
@ -82,6 +87,8 @@ pub struct HighlightStyle {
|
||||||
impl Eq for HighlightStyle {}
|
impl Eq for HighlightStyle {}
|
||||||
|
|
||||||
#[derive(Copy, Clone, Debug, Default, PartialEq, Eq)]
|
#[derive(Copy, Clone, Debug, Default, PartialEq, Eq)]
|
||||||
|
#[derive(TS)]
|
||||||
|
#[ts(export, export_to = "theme/types/")]
|
||||||
pub struct Underline {
|
pub struct Underline {
|
||||||
pub color: Option<Color>,
|
pub color: Option<Color>,
|
||||||
pub thickness: OrderedFloat<f32>,
|
pub thickness: OrderedFloat<f32>,
|
||||||
|
|
Loading…
Reference in a new issue