UNPKG

@skillpet/circuit

Version:

Circuit diagram library — render electrical schematics from JSON, with interactive SVG, themes, and Vue/React components

34 lines (33 loc) 1.97 kB
/** * Global two-terminal style aliases — aligned with Python `elements.style()` / `STYLE_IEEE` / `STYLE_IEC`. */ import type { Element } from "./element.js"; import { ResistorIEEE } from "./elements/resistor.js"; import { FuseIEC, FuseIEEE, PhotoresistorIEC, PhotoresistorIEEE, PotentiometerIEC, PotentiometerIEEE, ResistorIEC, ResistorVarIEC, ResistorVarIEEE } from "./elements/resistor-more.js"; export type StyledElementCtor = new (params?: Record<string, unknown>) => Element; export declare const STYLE_IEEE: { readonly Resistor: typeof ResistorIEEE; readonly ResistorVar: typeof ResistorVarIEEE; readonly Potentiometer: typeof PotentiometerIEEE; readonly Photoresistor: typeof PhotoresistorIEEE; readonly Fuse: typeof FuseIEEE; }; export declare const STYLE_IEC: { readonly Resistor: typeof ResistorIEC; readonly ResistorVar: typeof ResistorVarIEC; readonly Potentiometer: typeof PotentiometerIEC; readonly Photoresistor: typeof PhotoresistorIEC; readonly Fuse: typeof FuseIEC; }; /** Default generic names (Python `Resistor` etc.); use {@link setElementStyle} with {@link STYLE_IEC} for European symbols. */ export declare let Resistor: (typeof STYLE_IEEE)["Resistor"] | (typeof STYLE_IEC)["Resistor"]; export declare let ResistorVar: (typeof STYLE_IEEE)["ResistorVar"] | (typeof STYLE_IEC)["ResistorVar"]; export declare let Potentiometer: (typeof STYLE_IEEE)["Potentiometer"] | (typeof STYLE_IEC)["Potentiometer"]; export declare let Photoresistor: (typeof STYLE_IEEE)["Photoresistor"] | (typeof STYLE_IEC)["Photoresistor"]; export declare let Fuse: (typeof STYLE_IEEE)["Fuse"] | (typeof STYLE_IEC)["Fuse"]; /** * Merge style mappings (Python `elements.style(STYLE_IEEE)` / `style(STYLE_IEC)`). */ export declare function setElementStyle(style: Partial<Record<keyof typeof STYLE_IEEE, StyledElementCtor>>): void; /** Restore IEEE defaults (for tests). */ export declare function resetElementStyleForTests(): void;