Skip to content

pantoken-root / formats/scope/src / resolveScope

फंक्शन: resolveScope() ​

resolveScope(start): ResolvedScope

बीटा

Resolve the scope in effect for start उसके ancestors तक ऊपर जाकर।

पैरामीटर ​

start ​

Element | null

जिस तत्व के लिए resolve करना है। इसके अपने attributes भी भाग लेते हैं।

वापसी ​

ResolvedScope

The ResolvedScope; जिन फील्ड्स को किसी ancestor ने घोषित नहीं किया है उन्हें undefined छोड़ा जाता है।

उदाहरण ​

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

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