Skip to content

pantoken-root / formats/scope/src / resolveScope

פונקציה: resolveScope() ​

resolveScope(start): ResolvedScope

בטא

Resolve the scope in effect for start על־ידי עליה במורשיו.

פרמטרים ​

start ​

Element | null

האלמנט שעליו לפתור. התכונות שלו משתתפות גם הן.

מחזיר ​

ResolvedScope

The ResolvedScope; שדות שאף אב לא הכריז עליהם נשארים undefined.

דוגמה ​

ts
import { resolveScope } from "@pantoken/scope";

// <div data-pantoken-theme="canvas"><span id="x"></span></div>
resolveScope(document.querySelector("#x")!).theme; // "canvas"