@typecad/typecad
Version:
🤖programmatically 💥create 🛰️hardware
166 lines (165 loc) • 4.26 kB
TypeScript
import { Pin } from "./pin";
import { IVia, ITextPositioning } from "./pcb/pcb_interfaces";
export interface IComponent {
symbol?: string;
reference?: string | ITextPositioning | [string | undefined | null, ITextPositioning] | undefined;
value?: string | ITextPositioning | [string, ITextPositioning] | undefined;
fab?: ITextPositioning | [string | undefined | null, ITextPositioning] | undefined;
footprint?: string;
prefix?: string;
datasheet?: string;
description?: string;
voltage?: string;
wattage?: string;
uuid?: string;
mpn?: string;
dnp?: boolean;
pcb?: {
x: number;
y: number;
rotation?: number;
side?: 'front' | 'back';
};
pins?: Pin[];
via?: boolean;
simulation?: {
include: boolean;
model?: string;
};
sch?: {
x: number;
y: number;
rotation: number;
};
viaData?: IVia;
sourceInfo?: SourceInfo;
text?: Array<{
property: string;
text: string;
x: number;
y: number;
rotation?: number;
layer?: string;
width?: number;
height?: number;
fontSize?: number;
thickness?: number;
bold?: boolean;
italic?: boolean;
justify?: {
horizontal?: 'left' | 'right' | 'center';
vertical?: 'top' | 'bottom' | 'middle';
mirror?: boolean;
};
show?: boolean;
}>;
}
export interface SourceInfo {
file: string;
line: number;
variable?: string;
params?: Record<string, any>;
}
export declare class Component {
#private;
reference: string;
value: string;
footprint: string;
datasheet: string;
description: string;
voltage: string;
wattage: string;
mpn: string;
pcb: {
x: number;
y: number;
rotation?: number;
side?: 'front' | 'back';
};
dnp: boolean;
pins: Pin[];
via: boolean;
viaData?: IVia;
simulation: {
include: boolean;
model: string;
};
symbol?: string;
sch: {
x: number;
y: number;
rotation?: number;
};
groups: string[];
sourceInfo?: SourceInfo;
text: Array<{
property: string;
text: string;
x: number;
y: number;
rotation?: number;
layer?: string;
width?: number;
height?: number;
fontSize?: number;
thickness?: number;
bold?: boolean;
italic?: boolean;
justify?: {
horizontal?: 'left' | 'right' | 'center';
vertical?: 'top' | 'bottom' | 'middle';
mirror?: boolean;
};
show?: boolean;
}>;
fab?: {
text: string;
x: number;
y: number;
rotation?: number;
layer?: string;
width?: number;
height?: number;
fontSize?: number;
thickness?: number;
bold?: boolean;
italic?: boolean;
justify?: {
horizontal?: 'left' | 'right' | 'center';
vertical?: 'top' | 'bottom' | 'middle';
mirror?: boolean;
};
show?: boolean;
};
valueFootprint?: {
x: number;
y: number;
rotation?: number;
layer?: string;
width?: number;
height?: number;
fontSize?: number;
thickness?: number;
bold?: boolean;
italic?: boolean;
justify?: {
horizontal?: 'left' | 'right' | 'center';
vertical?: 'top' | 'bottom' | 'middle';
mirror?: boolean;
};
show?: boolean;
};
private _uuid;
private _gettingUuid;
constructor({ reference, value, footprint, prefix, datasheet, description, voltage, wattage, mpn, via, uuid, simulation, symbol, sch, pcb, viaData, text, fab }?: IComponent);
private getCallSite;
private getCallSiteForInstantiation;
get uuid(): string;
set uuid(value: string);
pin(number: number | string): Pin;
isInGroup(groupName: string): boolean;
getGroups(): string[];
footprint_lib(footprint: string): string;
symbol_lib(symbol: string): string;
private prettyPrintSExpr;
}