Skip to content

Commit

Permalink
fix: autocomplete literal type in custom transformer
Browse files Browse the repository at this point in the history
  • Loading branch information
souvikinator committed May 20, 2023
1 parent c524dbd commit 20e2832
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 5 deletions.
5 changes: 1 addition & 4 deletions src/notion-to-md.ts
Original file line number Diff line number Diff line change
Expand Up @@ -22,16 +22,14 @@ import { getBlockChildren } from "./utils/notion";
export class NotionToMarkdown {
private notionClient: Client;
private config: ConfigurationOptions;
private targetPage: string;
private customTransformers: Record<BlockType, CustomTransformer>;
private customTransformers: Record<string, CustomTransformer>;

constructor(options: NotionToMarkdownOptions) {
this.notionClient = options.notionClient;
const defaultConfig: ConfigurationOptions = {
separateChildPage: false,
convertImagesToBase64: false,
};
this.targetPage = "";
this.config = { ...defaultConfig, ...options.config };
this.customTransformers = {};
}
Expand Down Expand Up @@ -169,7 +167,6 @@ export class NotionToMarkdown {
"notion client is not provided, for more details check out https://github.com/souvikinator/notion-to-md"
);
}
this.targetPage = id;
const blocks = await getBlockChildren(this.notionClient, id, totalPage);

const parsedData = await this.blocksToMarkdown(blocks);
Expand Down
2 changes: 1 addition & 1 deletion src/types/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ export type BlockType =
| "link_to_page"
| "audio"
| "unsupported"
| string;
| (string & {});

export type ConfigurationOptions = {
separateChildPage?: boolean;
Expand Down

0 comments on commit 20e2832

Please sign in to comment.