Skip to content

pantoken-root / packages/plugin-kit/src / mergePlugin

Feidhm: mergePlugin() ​

mergePlugin(...plugins): PantokenPlugin

Béite

Comhcheangail roinnt breiseán isteach i gceann amháin, iad a fhilleadh ó chlé go deas le extendPlugin.

Paraiméadair ​

plugins ​

...PantokenPlugin[]

Na breiseáin le comhcheangal (ar a laghad ceann amháin).

Tuairisceáin ​

PantokenPlugin

Breiseán branda amháin.

Sampla ​

Comhcheangail breiseáin chomhionanna isteach i gceann amháin

ts
import { capabilitiesOf, definePlugin, mergePlugin } from "@pantoken/plugin-kit";

const brand = definePlugin({ name: "brand", tokens: (c) => c.tokens });
const glyphs = definePlugin({ name: "glyphs", icons: () => [{ name: "star" }] });

const combined = mergePlugin(brand, glyphs);
capabilitiesOf(combined); // → ["tokens", "icons"]