UNPKG

1.84 kBTypeScriptView Raw
1import { URI } from 'vscode-uri';
2export interface IconDefinition {
3 font?: IconFontContribution;
4 fontCharacter: string;
5}
6export interface IconContribution {
7 readonly id: string;
8 description: string | undefined;
9 deprecationMessage?: string;
10 readonly defaults: ThemeIcon | IconDefinition;
11}
12export interface IconFontContribution {
13 readonly id: string;
14 readonly definition: IconFontDefinition;
15}
16export interface IconFontDefinition {
17 readonly weight?: string;
18 readonly style?: string;
19 readonly src: IconFontSource[];
20}
21export interface IconFontSource {
22 readonly location: URI;
23 readonly format: string;
24}
25export interface ThemeIcon {
26 readonly id: string;
27 readonly color?: ThemeColor;
28}
29export interface ThemeColor {
30 id: string;
31}
32export declare const IconRegistry: unique symbol;
33export interface IconRegistry {
34 /**
35 * Register a icon to the registry.
36 * @param id The icon id
37 * @param defaults The default values
38 * @param description The description
39 */
40 registerIcon(id: string, defaults: ThemeIcon | IconDefinition, description?: string): ThemeIcon;
41 /**
42 * Deregister a icon from the registry.
43 * @param id The icon id
44 */
45 deregisterIcon(id: string): void;
46 /**
47 * Register a icon font to the registry.
48 * @param id The icon font id
49 * @param definition The icon font definition
50 */
51 registerIconFont(id: string, definition: IconFontDefinition): IconFontDefinition;
52 /**
53 * Deregister an icon font from the registry.
54 * @param id The icon font id
55 */
56 deregisterIconFont(id: string): void;
57 /**
58 * Get the icon font for the given id
59 * @param id The icon font id
60 */
61 getIconFont(id: string): IconFontDefinition | undefined;
62}
63//# sourceMappingURL=icon-registry.d.ts.map
\No newline at end of file