|
|
@@ -6,12 +6,18 @@ export type ProcessEvent = { |
|
|
|
contentType?: string, |
|
|
|
}; |
|
|
|
|
|
|
|
type ProcessEventCallback = (event: ProcessEvent) => void; |
|
|
|
export type ProcessEventCallback = (event: ProcessEvent) => void; |
|
|
|
|
|
|
|
type ErrorEventCallback = (event: Error) => void; |
|
|
|
export type ErrorEventCallback = (event: Error) => void; |
|
|
|
|
|
|
|
export interface SummarizerProcessParams { |
|
|
|
url: string; |
|
|
|
language?: string; |
|
|
|
country?: string; |
|
|
|
} |
|
|
|
|
|
|
|
export interface SummarizerEventEmitter extends NodeJS.EventEmitter { |
|
|
|
process(): void; |
|
|
|
process<T extends SummarizerProcessParams>(params: T): void; |
|
|
|
on(eventType: 'process', callback: ProcessEventCallback): this; |
|
|
|
on(eventType: 'error', callback: ErrorEventCallback): this; |
|
|
|
on(eventType: 'end', callback: () => void): this; |
|
|
@@ -25,8 +31,5 @@ export interface OpenAiParams { |
|
|
|
} |
|
|
|
|
|
|
|
export interface CreateBaseSummarizerParams { |
|
|
|
url: string; |
|
|
|
language?: string; |
|
|
|
country?: string; |
|
|
|
openAiParams: OpenAiParams; |
|
|
|
} |