Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 5 additions & 4 deletions src/OfficeConverter.ts
Original file line number Diff line number Diff line change
Expand Up @@ -50,12 +50,13 @@ export class OfficeConverter {
*/
public static async convert<
F extends string | Buffer | ArrayBuffer | Uint8Array,
T extends SupportedFileType = InferFileTypeFromPath<F>
T extends SupportedFileType = InferFileTypeFromPath<F>,
D extends SupportedDestination<T> = SupportedDestination<T>
>(
file: F,
destination: SupportedDestination<T>,
config?: OfficeConverterConfig<SupportedDestination<T>, T>
): Promise<ConversionResult<SupportedDestination<T>>> {
destination: D,
config?: OfficeConverterConfig<D, T>
): Promise<ConversionResult<D>> {
// 1. Prepare Parser Configuration
// We prioritize the top-level onWarning if provided.
const parserConfig: OfficeParserConfig = {
Expand Down
2 changes: 1 addition & 1 deletion src/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1666,6 +1666,6 @@ export interface OfficeParserAST {
this: T,
destination: D,
config?: GeneratorConfig<D>
): Promise<ConversionResult>;
): Promise<ConversionResult<D>>;
}

4 changes: 2 additions & 2 deletions src/utils/astUtils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -35,8 +35,8 @@ export function createAST(
this: T,
destination: D,
genConfig?: GeneratorConfig<D>
): Promise<ConversionResult> {
return OfficeGenerator.generate(this as any, destination, genConfig) as Promise<ConversionResult>;
): Promise<ConversionResult<D>> {
return OfficeGenerator.generate(this as any, destination, genConfig) as Promise<ConversionResult<D>>;
}
};
}