1import { Scale } from "chroma-js"
2import { Syntax, ThemeSyntax, SyntaxHighlightStyle } from "./syntax"
3export { Syntax, ThemeSyntax, SyntaxHighlightStyle }
4
5export interface ColorScheme {
6 name: string
7 isLight: boolean
8
9 lowest: Layer
10 middle: Layer
11 highest: Layer
12
13 ramps: RampSet
14
15 popoverShadow: Shadow
16 modalShadow: Shadow
17
18 players: Players
19 syntax?: Partial<ThemeSyntax>
20}
21
22export interface Meta {
23 name: string
24 author: string
25 url: string
26 license: License
27}
28
29export interface License {
30 SPDX: SPDXExpression
31 /// A url where we can download the license's text
32 license_text: Verification | string
33}
34
35export interface Verification {
36 https_url: string
37 license_checksum: string
38}
39
40// License name -> License text
41export interface Licenses {
42 [key: string]: string
43}
44
45// FIXME: Add support for the SPDX expression syntax
46export type SPDXExpression = "MIT"
47
48export interface Player {
49 cursor: string
50 selection: string
51}
52
53export interface Players {
54 "0": Player
55 "1": Player
56 "2": Player
57 "3": Player
58 "4": Player
59 "5": Player
60 "6": Player
61 "7": Player
62}
63
64export interface Shadow {
65 blur: number
66 color: string
67 offset: number[]
68}
69
70export type StyleSets = keyof Layer
71export interface Layer {
72 base: StyleSet
73 variant: StyleSet
74 on: StyleSet
75 accent: StyleSet
76 positive: StyleSet
77 warning: StyleSet
78 negative: StyleSet
79}
80
81export interface RampSet {
82 neutral: Scale
83 red: Scale
84 orange: Scale
85 yellow: Scale
86 green: Scale
87 cyan: Scale
88 blue: Scale
89 violet: Scale
90 magenta: Scale
91}
92
93export type Styles = keyof StyleSet
94export interface StyleSet {
95 default: Style
96 active: Style
97 disabled: Style
98 hovered: Style
99 pressed: Style
100 inverted: Style
101}
102
103export interface Style {
104 background: string
105 border: string
106 foreground: string
107}