Skip to content

pantoken-root / packages/core/src / resolveReferences

دالة: resolveReferences() ​

resolveReferences(tokens, mode?): Map<string, string>

Beta

قم بتحويل كل توكن إلى قيمة ملموسة في وضع واحد: وسّع سلاسل var(...) واطوِ light-dark() إلى mode المُختار.

Parameters ​

tokens ​

للقراءة فقط Token[]

الـ IR.

mode? ​

Mode = "light"

أي جانب من light-dark() يجب الاحتفاظ به (الافتراضي "light").

Returns ​

Map<string, string>

خريطة اسم التوكن إلى القيمة الملموسة.

Example ​

حل الـ IR المبني إلى قيم الوضع الداكن الملموسة

ts
import { buildTokens } from "@pantoken/core/build";
import { resolveReferences } from "@pantoken/core";

const resolved = resolveReferences(buildTokens(), "dark");
resolved.get("--instui-color-background-base"); // → a concrete "#…" value