Skip to content

Commit

Permalink
Theme colors API proposal
Browse files Browse the repository at this point in the history
  • Loading branch information
nikitinas committed Sep 13, 2024
1 parent 2f2018b commit d9968a2
Showing 1 changed file with 20 additions and 3 deletions.
23 changes: 20 additions & 3 deletions demo-edit-es-module/module/editor.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,7 @@ export interface EditArgs {
// default value for workerUrl is "worker.js"
workerUrl?: string | URL

// themes: "dark", "light"
theme?: string
theme?: Theme

readonly?: boolean

Expand Down Expand Up @@ -164,12 +163,30 @@ type LanguageSelector = string | ILanguageFilter | Array<string | ILanguageFilte
// return true;
// }

export enum ThemeColor {
TreeViewBackground = 0,
DefaultForeground = 1,
SelectedItemBackground = 2,
SelectedItemForeground = 3,
HoveredItemBackground = 4,
InactiveSelectionBackground = 5,
ChangedItemBackground = 6
}

type BaseTheme = 'dark' | 'light'

type Theme = {
[color in ThemeColor]?: string;
} & {
baseTheme: BaseTheme;
} | BaseTheme;

interface HasTheme {
setFontFamily(fontFamily: string): void,

setFontSize(fontSize: number): void,

setTheme(theme: string): void
setTheme(theme: Theme): void
}

interface Focusable {
Expand Down

0 comments on commit d9968a2

Please sign in to comment.