import { Event } from "../../../base/common/event.js"; import { IJSONSchema } from "../../../base/common/jsonSchema.js"; import { IColorTheme } from "./themeService.js"; export type SizeIdentifier = string; /** * Size value unit types supported by the registry */ export type SizeUnit = "px" | "rem" | "em" | "%"; /** * A size value with a numeric amount and unit */ export interface SizeValue { readonly value: number; readonly unit: SizeUnit; } export interface SizeContribution { readonly id: SizeIdentifier; readonly description: string; readonly defaults: SizeDefaults | SizeValue | null; readonly deprecationMessage: string | undefined; } /** * Returns the css variable name for the given size identifier. Dots (`.`) are replaced with hyphens (`-`) and * everything is prefixed with `--vscode-`. * * @sample `editor.fontSize` is `--vscode-editor-fontSize`. */ export declare function asCssVariableName(sizeIdent: SizeIdentifier): string; export declare function asCssVariable(size: SizeIdentifier): string; export declare function asCssVariableWithDefault(size: SizeIdentifier, defaultCssValue: string): string; export interface SizeDefaults { light: SizeValue | null; dark: SizeValue | null; hcDark: SizeValue | null; hcLight: SizeValue | null; } export declare function isSizeDefaults(value: unknown): value is SizeDefaults; /** * Helper function to create a size value */ export declare function size(value: number, unit?: SizeUnit): SizeValue; /** * Helper function to create size defaults that use the same value for all themes */ export declare function sizeForAllThemes(value: number, unit?: SizeUnit): SizeDefaults; /** * Convert a size value to a CSS string */ export declare function sizeValueToCss(sizeValue: SizeValue): string; export declare const Extensions: { SizeContribution: string; }; export declare const DEFAULT_SIZE_CONFIG_VALUE = "default"; export interface ISizeRegistry { readonly onDidChangeSchema: Event; /** * Register a size to the registry. * @param id The size id as used in theme description files * @param defaults The default values * @param description the description */ registerSize(id: string, defaults: SizeDefaults | SizeValue | null, description: string): SizeIdentifier; /** * Deregister a size from the registry. */ deregisterSize(id: string): void; /** * Get all size contributions */ getSizes(): SizeContribution[]; /** * Gets the default size of the given id */ resolveDefaultSize(id: SizeIdentifier, theme: IColorTheme): SizeValue | undefined; /** * JSON schema for an object to assign size values to one of the size contributions. */ getSizeSchema(): IJSONSchema; /** * JSON schema for a reference to a size contribution. */ getSizeReferenceSchema(): IJSONSchema; /** * Notify when the color theme or settings change. */ notifyThemeUpdate(theme: IColorTheme): void; } export declare function registerSize(id: string, defaults: SizeDefaults | SizeValue | null, description: string, deprecationMessage?: string): SizeIdentifier; export declare function getSizeRegistry(): ISizeRegistry; export declare const workbenchSizesSchemaId = "vscode://schemas/workbench-sizes";