markitdown-ts 0.0.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,35 @@
1
+ import { LanguageModel } from 'ai';
2
+ import mammoth from 'mammoth';
3
+
4
+ type ConverterResult = {
5
+ title: string | null;
6
+ text_content: string;
7
+ } | null | undefined;
8
+ type ConverterOptions = {
9
+ llmModel?: LanguageModel;
10
+ llmPrompt?: string;
11
+ file_extension?: string;
12
+ url?: string;
13
+ fetch?: typeof fetch;
14
+ enableYoutubeTranscript?: boolean;
15
+ youtubeTranscriptLanguage?: string;
16
+ cleanupExtracted?: boolean;
17
+ _parent_converters?: DocumentConverter[];
18
+ } & MammothOptions;
19
+ type MammothOptions = Parameters<typeof mammoth.convertToHtml>[1];
20
+ interface DocumentConverter {
21
+ convert(local_path: string, options: ConverterOptions): Promise<ConverterResult>;
22
+ }
23
+
24
+ declare class MarkItDown {
25
+ private readonly converters;
26
+ constructor();
27
+ convert(source: string | Response, options?: ConverterOptions): Promise<ConverterResult>;
28
+ private convert_url;
29
+ private convert_response;
30
+ private convert_local;
31
+ private _convert;
32
+ private register_converter;
33
+ }
34
+
35
+ export { MarkItDown };
@@ -0,0 +1,35 @@
1
+ import { LanguageModel } from 'ai';
2
+ import mammoth from 'mammoth';
3
+
4
+ type ConverterResult = {
5
+ title: string | null;
6
+ text_content: string;
7
+ } | null | undefined;
8
+ type ConverterOptions = {
9
+ llmModel?: LanguageModel;
10
+ llmPrompt?: string;
11
+ file_extension?: string;
12
+ url?: string;
13
+ fetch?: typeof fetch;
14
+ enableYoutubeTranscript?: boolean;
15
+ youtubeTranscriptLanguage?: string;
16
+ cleanupExtracted?: boolean;
17
+ _parent_converters?: DocumentConverter[];
18
+ } & MammothOptions;
19
+ type MammothOptions = Parameters<typeof mammoth.convertToHtml>[1];
20
+ interface DocumentConverter {
21
+ convert(local_path: string, options: ConverterOptions): Promise<ConverterResult>;
22
+ }
23
+
24
+ declare class MarkItDown {
25
+ private readonly converters;
26
+ constructor();
27
+ convert(source: string | Response, options?: ConverterOptions): Promise<ConverterResult>;
28
+ private convert_url;
29
+ private convert_response;
30
+ private convert_local;
31
+ private _convert;
32
+ private register_converter;
33
+ }
34
+
35
+ export { MarkItDown };
@@ -0,0 +1,35 @@
1
+ import { LanguageModel } from 'ai';
2
+ import mammoth from 'mammoth';
3
+
4
+ type ConverterResult = {
5
+ title: string | null;
6
+ text_content: string;
7
+ } | null | undefined;
8
+ type ConverterOptions = {
9
+ llmModel?: LanguageModel;
10
+ llmPrompt?: string;
11
+ file_extension?: string;
12
+ url?: string;
13
+ fetch?: typeof fetch;
14
+ enableYoutubeTranscript?: boolean;
15
+ youtubeTranscriptLanguage?: string;
16
+ cleanupExtracted?: boolean;
17
+ _parent_converters?: DocumentConverter[];
18
+ } & MammothOptions;
19
+ type MammothOptions = Parameters<typeof mammoth.convertToHtml>[1];
20
+ interface DocumentConverter {
21
+ convert(local_path: string, options: ConverterOptions): Promise<ConverterResult>;
22
+ }
23
+
24
+ declare class MarkItDown {
25
+ private readonly converters;
26
+ constructor();
27
+ convert(source: string | Response, options?: ConverterOptions): Promise<ConverterResult>;
28
+ private convert_url;
29
+ private convert_response;
30
+ private convert_local;
31
+ private _convert;
32
+ private register_converter;
33
+ }
34
+
35
+ export { MarkItDown };