Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
microsoft
GitHub Repository: microsoft/vscode
Path: blob/main/src/vs/editor/standalone/common/standaloneTheme.ts
3296 views
1
/*---------------------------------------------------------------------------------------------
2
* Copyright (c) Microsoft Corporation. All rights reserved.
3
* Licensed under the MIT License. See License.txt in the project root for license information.
4
*--------------------------------------------------------------------------------------------*/
5
6
import { Color } from '../../../base/common/color.js';
7
import { ITokenThemeRule, TokenTheme } from '../../common/languages/supports/tokenization.js';
8
import { createDecorator } from '../../../platform/instantiation/common/instantiation.js';
9
import { IColorTheme, IThemeService } from '../../../platform/theme/common/themeService.js';
10
11
export const IStandaloneThemeService = createDecorator<IStandaloneThemeService>('themeService');
12
13
export type BuiltinTheme = 'vs' | 'vs-dark' | 'hc-black' | 'hc-light';
14
export type IColors = { [colorId: string]: string };
15
16
export interface IStandaloneThemeData {
17
base: BuiltinTheme;
18
inherit: boolean;
19
rules: ITokenThemeRule[];
20
encodedTokensColors?: string[];
21
colors: IColors;
22
}
23
24
export interface IStandaloneTheme extends IColorTheme {
25
tokenTheme: TokenTheme;
26
themeName: string;
27
}
28
29
export interface IStandaloneThemeService extends IThemeService {
30
readonly _serviceBrand: undefined;
31
32
setTheme(themeName: string): void;
33
34
setAutoDetectHighContrast(autoDetectHighContrast: boolean): void;
35
36
defineTheme(themeName: string, themeData: IStandaloneThemeData): void;
37
38
getColorTheme(): IStandaloneTheme;
39
40
setColorMapOverride(colorMapOverride: Color[] | null): void;
41
42
}
43
44