From d37d01e6d823ba41a42ad846d4e40aeacb8f1467 Mon Sep 17 00:00:00 2001 From: Ilia Mashkov Date: Wed, 24 Jun 2026 13:21:29 +0300 Subject: [PATCH] feat(Pairing): add Pairing and Role types --- src/entities/Pairing/domain/types/index.ts | 4 +++ src/entities/Pairing/domain/types/pairing.ts | 26 ++++++++++++++++++++ src/entities/Pairing/model/types/index.ts | 4 +++ src/entities/Pairing/model/types/pairing.ts | 9 +++++++ 4 files changed, 43 insertions(+) create mode 100644 src/entities/Pairing/domain/types/index.ts create mode 100644 src/entities/Pairing/domain/types/pairing.ts create mode 100644 src/entities/Pairing/model/types/index.ts create mode 100644 src/entities/Pairing/model/types/pairing.ts diff --git a/src/entities/Pairing/domain/types/index.ts b/src/entities/Pairing/domain/types/index.ts new file mode 100644 index 0000000..4db65eb --- /dev/null +++ b/src/entities/Pairing/domain/types/index.ts @@ -0,0 +1,4 @@ +export type { + Pairing, + Role, +} from './pairing'; diff --git a/src/entities/Pairing/domain/types/pairing.ts b/src/entities/Pairing/domain/types/pairing.ts new file mode 100644 index 0000000..f54b0da --- /dev/null +++ b/src/entities/Pairing/domain/types/pairing.ts @@ -0,0 +1,26 @@ +/** + * A slot within a Pairing that a font fills. + */ +export type Role = 'header' | 'body'; + +/** + * The atomic unit of comparison: a header font + a body font. + * Carries a surrogate `id` (stable for the card's life, never tracks content) + * and the two font ids it pairs. Text and typography are global to the Board, + * not stored here. + */ +export interface Pairing { + /** + * Surrogate key generated at creation, stable for the card's life. + * Distinguishes duplicates with identical fonts. Focal/cycling key on this. + */ + id: string; + /** + * Font entity id filling the header role. + */ + headerFontId: string; + /** + * Font entity id filling the body role. + */ + bodyFontId: string; +} diff --git a/src/entities/Pairing/model/types/index.ts b/src/entities/Pairing/model/types/index.ts new file mode 100644 index 0000000..4db65eb --- /dev/null +++ b/src/entities/Pairing/model/types/index.ts @@ -0,0 +1,4 @@ +export type { + Pairing, + Role, +} from './pairing'; diff --git a/src/entities/Pairing/model/types/pairing.ts b/src/entities/Pairing/model/types/pairing.ts new file mode 100644 index 0000000..d8a49e1 --- /dev/null +++ b/src/entities/Pairing/model/types/pairing.ts @@ -0,0 +1,9 @@ +/** + * Re-export of the Pairing identity types. The source of truth lives in + * `domain/types` so the pure domain segment can reference them without importing + * `model` (FSD+ domain isolation: ui -> model -> domain, never back). + */ +export type { + Pairing, + Role, +} from '../../domain/types';