@racla-dev/node-iris
Version:
TypeScript port of Python irispy-client module for KakaoTalk bot development
61 lines • 2.05 kB
TypeScript
/**
* Common type definitions for the iris application
*/
export interface IrisConfig {
logLevel: 'debug' | 'info' | 'warn' | 'error';
timeout: number;
retryAttempts: number;
}
export interface ProcessingOptions {
async?: boolean;
timeout?: number;
retries?: number;
}
export interface ProcessingResult<T = any> {
success: boolean;
data?: T;
error?: string;
timestamp: Date;
}
export interface DataPoint {
id: string | number;
value: any;
metadata?: Record<string, any>;
}
export interface ProcessingContext {
requestId: string;
startTime: Date;
options: ProcessingOptions;
}
export declare class IrisError extends Error {
code?: string | undefined;
details?: any | undefined;
constructor(message: string, code?: string | undefined, details?: any | undefined);
}
export declare class ValidationError extends IrisError {
constructor(message: string, details?: any);
}
export declare class ProcessingError extends IrisError {
constructor(message: string, details?: any);
}
export type AsyncFunction<T = any, R = any> = (input: T) => Promise<R>;
export type SyncFunction<T = any, R = any> = (input: T) => R;
export type ProcessingFunction<T = any, R = any> = AsyncFunction<T, R> | SyncFunction<T, R>;
export interface EventData {
type: string;
payload: any;
timestamp: Date;
}
export type EventHandler<T = any> = (data: T) => void | Promise<void>;
export interface IIrisAPI {
reply(roomId: string | number, message: string): Promise<any>;
replyMedia(roomId: string | number, files: Buffer[]): Promise<any>;
replyImageUrls(roomId: string | number, imageUrls: string[]): Promise<any>;
replyImageUrl(roomId: string | number, imageUrl: string): Promise<any>;
decrypt(enc: number, b64Ciphertext: string, userId: string | number): Promise<string | null>;
query(query: string, bind?: any[]): Promise<any[]>;
getInfo(): Promise<any>;
getAot(): Promise<any>;
}
export * from './models/index';
//# sourceMappingURL=index.d.ts.map