Documentation / @finchart/core / Plugin
Type Alias: Plugin<Host, Api>
Plugin<
Host,Api> = (host) =>Api
Defined in: packages/core/src/plot/plugin.ts:37
호스트를 받아 API를 돌려주는 함수.
Host를 타입 매개변수로 둔 것이 핵심이다. 구조적 타이핑 덕에 플러그인의 시그니처가 곧 요구 선언이 된다 — 능력이 작은 인터페이스로 쪼개져 있으므로(capabilities.ts) Plugin<RenderRequester>가 그대로 plot.use에 들어간다. 함수 매개변수는 반공변이라 덜 요구하는 플러그인이 더 주는 호스트를 받는다.
Type Parameters
Host
Host
Api
Api extends PluginApi = PluginApi
Parameters
host
Host
Returns
Api