Skip to content

pantoken-root / formats/scope/src / PantokenScope

介面: PantokenScope ​

Beta(測試)

綁定至單一元素的即時範圍。

屬性 ​

element ​

readonly element: HTMLElement

Beta(測試)

承載該範圍屬性的元素。


instanceId ​

readonly instanceId: string

Beta(測試)

該標誌所屬的產品。

方法 ​

get() ​

get(): ScopeConfig

Beta(測試)

該範圍自己的設定 — 它所宣告的內容,而非繼承來的內容。

回傳 ​

ScopeConfig


set() ​

set(patch): void

Beta(測試)

合併部分設定。對於要清除並重新繼承的欄位,傳入 null。

參數 ​

patch ​

Partial<Record<keyof ScopeConfig, string | null | undefined>>

回傳 ​

void


resolve() ​

resolve(el?): ResolvedScope

Beta(測試)

解析某個後代元素的實際生效範圍(預設為此範圍自身的元素)。

參數 ​

el? ​

Element

回傳 ​

ResolvedScope


attachFrame() ​

attachFrame(frame): () => void

Beta(測試)

將此範圍的狀態送至 frame 並保持同步。回傳一個解除附加(detach)函式。

參數 ​

frame ​

HTMLIFrameElement

回傳 ​

() => void


subscribe() ​

subscribe(listener): () => void

Beta(測試)

觀察變更。回傳一個取消訂閱的函式。

參數 ​

listener ​

(config) => void

回傳 ​

() => void


destroy() ​

destroy(): void

Beta(測試)

移除屬性、解除框架附加,並取消註冊。

回傳 ​

void