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"