Skip to content

pantoken-root / packages/model/src / PantokenPlugin

Interfaccia: PantokenPlugin ​

Beta

Un plugin di pantoken. Ogni hook è opzionale; un plugin partecipa solo alle fasi per le quali definisce un hook. Lo stesso plugin può quindi iniettare in più di un livello.

Proprietà ​

name ​

name: string

Beta

Un nome di plugin univoco e leggibile dall'umano.

Metodi ​

tokens()? ​

optional tokens(ctx): void | Token[]

Beta

Fase token: restituisci l'elenco completo dei token di sostituzione.

Parametri ​

ctx ​

TokenHookContext

Restituisce ​

void | Token[]


icons()? ​

optional icons(ctx): void | IconEntry[]

Beta

Icon stage: return new IconEntry records to register as <image> tokens. Returning undefined or an empty array leaves the current set unchanged.

Parametri ​

ctx ​

IconHookContext

Restituisce ​

void | IconEntry[]


css()? ​

optional css(ctx): void | CssContribution

Beta

Fase CSS: contribuire o post-elaborare il CSS.

Parametri ​

ctx ​

CssHookContext

Restituisce ​

void | CssContribution


rehype()? ​

optional rehype(ctx): void | { resolve?: IconResolver; }

Beta

Fase Rehype: fornire un resolver che venga unito al plugin rehype.

Parametri ​

ctx ​

RehypeHookContext

Restituisce ​

void | { resolve?: IconResolver; }


native()? ​

optional native(ctx): void

Beta

Fase Native (Style Dictionary): registrare trasformazioni e formati.

Parametri ​

ctx ​

unknown

Restituisce ​

void