circuit-bricks
Version:
A modular, Lego-style SVG circuit component system for React (ALPHA - Not for production use)
60 lines • 1.81 kB
TypeScript
/**
* Server-side registry module for component schemas
*
* This module provides server-side compatible registry functions
* without any client-side dependencies or "use client" directives.
* It's specifically designed for use in server-side environments
* like API routes and LLM integrations.
*/
interface ServerComponentSchema {
id: string;
name: string;
category: string;
description: string;
defaultWidth: number;
defaultHeight: number;
ports: Array<{
id: string;
x: number;
y: number;
type: string;
label?: string;
}>;
properties: Array<{
key: string;
label: string;
type: string;
unit?: string;
default: any;
min?: number;
max?: number;
options?: Array<{
value: any;
label: string;
}>;
}>;
svgPath: string;
}
declare const serverComponentRegistry: Record<string, ServerComponentSchema>;
/**
* Register a component schema in the server-side registry
*/
export declare function registerServerComponent(schema: ServerComponentSchema): void;
/**
* Get a component schema from the server-side registry by ID
*/
export declare function getServerComponentSchema(id: string): ServerComponentSchema | undefined;
/**
* Get all component schemas in the server-side registry
*/
export declare function getAllServerComponents(): ServerComponentSchema[];
/**
* Get component schemas by category from the server-side registry
*/
export declare function getServerComponentsByCategory(category: string): ServerComponentSchema[];
/**
* Get all unique categories from the server-side registry
*/
export declare function getServerCategories(): string[];
export default serverComponentRegistry;
//# sourceMappingURL=server.d.ts.map