From 13509a41452c657fce4c96b2e14530ac0e55b0fa Mon Sep 17 00:00:00 2001 From: Ilia Mashkov Date: Fri, 9 Jan 2026 16:13:47 +0300 Subject: [PATCH] chore: add comments for types and constants --- src/features/SetupFont/model/const/const.ts | 9 +++++++ .../createTypographyControl.svelte.ts | 24 +++++++++++++++++++ 2 files changed, 33 insertions(+) diff --git a/src/features/SetupFont/model/const/const.ts b/src/features/SetupFont/model/const/const.ts index e9b9085..21bf5b7 100644 --- a/src/features/SetupFont/model/const/const.ts +++ b/src/features/SetupFont/model/const/const.ts @@ -1,13 +1,22 @@ +/** + * Font size constants + */ export const DEFAULT_FONT_SIZE = 16; export const MIN_FONT_SIZE = 8; export const MAX_FONT_SIZE = 100; export const FONT_SIZE_STEP = 1; +/** + * Font weight constants + */ export const DEFAULT_FONT_WEIGHT = 400; export const MIN_FONT_WEIGHT = 100; export const MAX_FONT_WEIGHT = 900; export const FONT_WEIGHT_STEP = 100; +/** + * Line height constants + */ export const DEFAULT_LINE_HEIGHT = 1.5; export const MIN_LINE_HEIGHT = 1; export const MAX_LINE_HEIGHT = 2; diff --git a/src/shared/lib/helpers/createTypographyControl/createTypographyControl.svelte.ts b/src/shared/lib/helpers/createTypographyControl/createTypographyControl.svelte.ts index f779a03..1ba9476 100644 --- a/src/shared/lib/helpers/createTypographyControl/createTypographyControl.svelte.ts +++ b/src/shared/lib/helpers/createTypographyControl/createTypographyControl.svelte.ts @@ -4,16 +4,40 @@ import { } from '$shared/lib/utils'; export interface ControlDataModel { + /** + * Control value + */ value: number; + /** + * Minimal possible value + */ min: number; + /** + * Maximal possible value + */ max: number; + /** + * Step size for increase/decrease + */ step: number; } export interface ControlModel extends ControlDataModel { + /** + * Control identifier + */ id: string; + /** + * Area label for increase button + */ increaseLabel: string; + /** + * Area label for decrease button + */ decreaseLabel: string; + /** + * Control area label + */ controlLabel: string; }