revit-cli
Version:
A scalable CLI tool for Revit communication and data manipulation
143 lines • 3.65 kB
TypeScript
/**
* Core type definitions for the Revit CLI
*/
export interface ToolOption {
flags: string;
description: string;
defaultValue?: any;
}
export interface ToolOptions {
[key: string]: any;
}
export interface ToolContext {
logger: ILogger;
configManager: any;
revitConnector: any;
pluginManager: any;
}
export interface Tool {
name: string;
description: string;
category?: string;
options?: ToolOption[];
execute(options: ToolOptions, context: ToolContext): Promise<void>;
}
export interface PluginMetadata {
name: string;
version: string;
description: string;
author?: string;
keywords?: string[];
dependencies?: Record<string, string>;
}
export interface Plugin {
metadata: PluginMetadata;
tools: Tool[];
initialize?(context: ToolContext): Promise<void>;
cleanup?(): Promise<void>;
}
export interface Config {
revit?: {
apiUrl?: string;
timeout?: number;
retries?: number;
apiKey?: string;
version?: string;
};
output?: {
defaultFormat?: string;
defaultPath?: string;
createTimestampFolders?: boolean;
compression?: boolean;
};
logging?: {
level?: string;
file?: string;
maxFileSize?: string;
maxFiles?: number;
console?: boolean;
colors?: boolean;
};
plugins?: {
autoLoad?: boolean;
directories?: string[];
disabled?: string[];
};
performance?: {
maxConcurrentRequests?: number;
requestDelay?: number;
cacheEnabled?: boolean;
cacheTTL?: number;
};
tools?: Record<string, any>;
security?: {
allowUnsafeConnections?: boolean;
validateCertificates?: boolean;
maxRequestSize?: string;
};
}
export interface RevitApiResponse<T = any> {
success: boolean;
data?: T;
error?: string;
timestamp?: string;
}
export interface RevitElement {
id: string;
category: string;
name?: string;
type?: string;
parameters?: Record<string, any>;
geometry?: any;
level?: string;
location?: {
x: number;
y: number;
z: number;
};
}
export interface ExtractionOptions {
categories?: string[];
parameters?: string[];
includeGeometry?: boolean;
format?: 'json' | 'csv' | 'xml';
filter?: Record<string, any>;
limit?: number;
}
export interface PluginDiscoveryResult {
path: string;
metadata: PluginMetadata;
isValid: boolean;
errors?: string[];
}
export interface CommandResult {
success: boolean;
message?: string;
data?: any;
error?: Error;
}
export interface ILogger {
debug(message: string, ...args: any[]): void;
info(message: string, ...args: any[]): void;
warn(message: string, ...args: any[]): void;
error(message: string, ...args: any[]): void;
success(message: string, ...args: any[]): void;
header(title: string): void;
getLevel(): string;
getLogFile(): string | undefined;
table(data: Record<string, any>[] | Record<string, any>): void;
separator(char?: string, length?: number): void;
clearLine(): void;
progress(message: string, current: number, total: number): void;
custom(color: string, level: string, message: string, ...args: any[]): void;
child(prefix: string): ILogger;
setLevel(level: string): void;
setLogFile(filePath: string): Promise<void>;
}
export interface PluginEvent {
type: 'load' | 'unload' | 'error';
plugin: string;
timestamp: Date;
data?: any;
}
//# sourceMappingURL=index.d.ts.map