notion2hast 0.1.1 → 0.1.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.
package/dist/cli.d.ts CHANGED
@@ -1,6 +1,6 @@
1
1
  /// <reference types="node" />
2
2
  import { Writable } from 'stream';
3
- declare type Opts = {
3
+ type Opts = {
4
4
  apiKey: string;
5
5
  blockId: string;
6
6
  defaultClassName?: boolean;
package/dist/cli.js CHANGED
@@ -22,7 +22,12 @@ export const cli = async ({ apiKey, blockId, defaultClassName, toHtml, stdout, s
22
22
  richTexttoHastOpts: { defaultClassName }
23
23
  });
24
24
  if (toHtml) {
25
- stdout.write(`${hastToHtml(tree)}\n`);
25
+ if (tree !== undefined &&
26
+ tree !== null &&
27
+ typeof tree === 'object' &&
28
+ !Array.isArray(tree)) {
29
+ stdout.write(`${hastToHtml(tree)}\n`);
30
+ }
26
31
  }
27
32
  else {
28
33
  stdout.write(`${JSON.stringify(tree, null, ' ')}\n`);
@@ -1,4 +1,4 @@
1
- import { HChild, HProperties } from 'hastscript/lib/core';
1
+ import type { Child, Properties } from 'hastscript';
2
2
  import { Block, BlockToHastBuilderOpts, BlockToHastBuilderPropertiesKey, BlockToHastBuilderPropertiesMap, BlockToHastOpts, ToHastOpts } from './types.js';
3
3
  import { RichTextToHast } from './richtext.js';
4
4
  import { Client } from './client.js';
@@ -15,9 +15,9 @@ export declare class BlockItem {
15
15
  init(): Promise<void>;
16
16
  block(): Promise<Block | null>;
17
17
  }
18
- declare type BlockToHastBuilderBuildOpts = {
18
+ type BlockToHastBuilderBuildOpts = {
19
19
  block: Block;
20
- nest: HChild[];
20
+ nest: Child[];
21
21
  parent?: Block;
22
22
  index: number;
23
23
  richTextToHast: RichTextToHast;
@@ -28,177 +28,177 @@ export declare abstract class BlockToHastBuilder<T> {
28
28
  protected defaultClassname: boolean;
29
29
  protected propertiesMap: BlockToHastBuilderPropertiesMap;
30
30
  constructor(blockType: T, opts: BlockToHastBuilderOpts);
31
- protected props(key: BlockToHastBuilderPropertiesKey): HProperties;
31
+ protected props(key: BlockToHastBuilderPropertiesKey): Properties;
32
32
  abstract outerTag(): {
33
33
  name: string | null;
34
- properties?: HProperties;
34
+ properties?: Properties;
35
35
  };
36
- abstract build(opts: BlockToHastBuilderBuildOpts): Promise<HChild[]>;
36
+ abstract build(opts: BlockToHastBuilderBuildOpts): Promise<Child[]>;
37
37
  abstract isBreak(prevType: PrevType): boolean;
38
38
  }
39
39
  export declare class BlockParagraphToHast extends BlockToHastBuilder<'paragraph'> {
40
40
  constructor(opts?: BlockToHastBuilderOpts);
41
41
  outerTag(): {
42
42
  name: string | null;
43
- properties?: HProperties;
43
+ properties?: Properties;
44
44
  };
45
- build({ block, nest, richTextToHast, colorProps }: BlockToHastBuilderBuildOpts): Promise<HChild[]>;
45
+ build({ block, nest, richTextToHast, colorProps }: BlockToHastBuilderBuildOpts): Promise<Child[]>;
46
46
  isBreak(_prevType: PrevType): boolean;
47
47
  }
48
48
  export declare class BlockHeading1ToHast extends BlockToHastBuilder<'heading_1'> {
49
49
  constructor(opts?: BlockToHastBuilderOpts);
50
50
  outerTag(): {
51
51
  name: string | null;
52
- properties?: HProperties;
52
+ properties?: Properties;
53
53
  };
54
- build({ block, nest, richTextToHast, colorProps }: BlockToHastBuilderBuildOpts): Promise<HChild[]>;
54
+ build({ block, nest, richTextToHast, colorProps }: BlockToHastBuilderBuildOpts): Promise<Child[]>;
55
55
  isBreak(_prevType: PrevType): boolean;
56
56
  }
57
57
  export declare class BlockHeading2ToHast extends BlockToHastBuilder<'heading_2'> {
58
58
  constructor(opts?: BlockToHastBuilderOpts);
59
59
  outerTag(): {
60
60
  name: string | null;
61
- properties?: HProperties;
61
+ properties?: Properties;
62
62
  };
63
- build({ block, nest, richTextToHast, colorProps }: BlockToHastBuilderBuildOpts): Promise<HChild[]>;
63
+ build({ block, nest, richTextToHast, colorProps }: BlockToHastBuilderBuildOpts): Promise<Child[]>;
64
64
  isBreak(_prevType: PrevType): boolean;
65
65
  }
66
66
  export declare class BlockHeading3ToHast extends BlockToHastBuilder<'heading_3'> {
67
67
  constructor(opts?: BlockToHastBuilderOpts);
68
68
  outerTag(): {
69
69
  name: string | null;
70
- properties?: HProperties;
70
+ properties?: Properties;
71
71
  };
72
- build({ block, nest, richTextToHast, colorProps }: BlockToHastBuilderBuildOpts): Promise<HChild[]>;
72
+ build({ block, nest, richTextToHast, colorProps }: BlockToHastBuilderBuildOpts): Promise<Child[]>;
73
73
  isBreak(_prevType: PrevType): boolean;
74
74
  }
75
75
  export declare class BlockCodeToHast extends BlockToHastBuilder<'code'> {
76
76
  constructor(opts?: BlockToHastBuilderOpts);
77
77
  outerTag(): {
78
78
  name: string | null;
79
- properties?: HProperties;
79
+ properties?: Properties;
80
80
  };
81
- build({ block, nest, richTextToHast }: BlockToHastBuilderBuildOpts): Promise<HChild[]>;
81
+ build({ block, nest, richTextToHast }: BlockToHastBuilderBuildOpts): Promise<Child[]>;
82
82
  isBreak(_prevType: PrevType): boolean;
83
83
  }
84
84
  export declare class BlockCalloutToHast extends BlockToHastBuilder<'callout'> {
85
85
  constructor(opts?: BlockToHastBuilderOpts);
86
86
  outerTag(): {
87
87
  name: string | null;
88
- properties?: HProperties;
88
+ properties?: Properties;
89
89
  };
90
- build({ block, nest, richTextToHast, colorProps }: BlockToHastBuilderBuildOpts): Promise<HChild[]>;
90
+ build({ block, nest, richTextToHast, colorProps }: BlockToHastBuilderBuildOpts): Promise<Child[]>;
91
91
  isBreak(_prevType: PrevType): boolean;
92
92
  }
93
93
  export declare class BlockDividerToHast extends BlockToHastBuilder<'divider'> {
94
94
  constructor(opts?: BlockToHastBuilderOpts);
95
95
  outerTag(): {
96
96
  name: string | null;
97
- properties?: HProperties;
97
+ properties?: Properties;
98
98
  };
99
- build({ block, nest }: BlockToHastBuilderBuildOpts): Promise<HChild[]>;
99
+ build({ block, nest }: BlockToHastBuilderBuildOpts): Promise<Child[]>;
100
100
  isBreak(_prevType: PrevType): boolean;
101
101
  }
102
102
  export declare class BlockColumnListToHast extends BlockToHastBuilder<'column_list'> {
103
103
  constructor(opts?: BlockToHastBuilderOpts);
104
104
  outerTag(): {
105
105
  name: string | null;
106
- properties?: HProperties;
106
+ properties?: Properties;
107
107
  };
108
- build({ block, nest, richTextToHast }: BlockToHastBuilderBuildOpts): Promise<HChild[]>;
108
+ build({ block, nest, richTextToHast }: BlockToHastBuilderBuildOpts): Promise<Child[]>;
109
109
  isBreak(_prevType: PrevType): boolean;
110
110
  }
111
111
  export declare class BlockColumnToHast extends BlockToHastBuilder<'column'> {
112
112
  constructor(opts?: BlockToHastBuilderOpts);
113
113
  outerTag(): {
114
114
  name: string | null;
115
- properties?: HProperties;
115
+ properties?: Properties;
116
116
  };
117
- build({ block, nest, richTextToHast }: BlockToHastBuilderBuildOpts): Promise<HChild[]>;
117
+ build({ block, nest, richTextToHast }: BlockToHastBuilderBuildOpts): Promise<Child[]>;
118
118
  isBreak(_prevType: PrevType): boolean;
119
119
  }
120
120
  export declare class BlockBulletedListItemToHast extends BlockToHastBuilder<'bulleted_list_item'> {
121
121
  constructor(opts?: BlockToHastBuilderOpts);
122
122
  outerTag(): {
123
123
  name: string | null;
124
- properties?: HProperties;
124
+ properties?: Properties;
125
125
  };
126
- build({ block, nest, richTextToHast, colorProps }: BlockToHastBuilderBuildOpts): Promise<HChild[]>;
126
+ build({ block, nest, richTextToHast, colorProps }: BlockToHastBuilderBuildOpts): Promise<Child[]>;
127
127
  isBreak(prevType: PrevType): boolean;
128
128
  }
129
129
  export declare class BlockNumberedListItemToHast extends BlockToHastBuilder<'numbered_list_item'> {
130
130
  constructor(opts?: BlockToHastBuilderOpts);
131
131
  outerTag(): {
132
132
  name: string | null;
133
- properties?: HProperties;
133
+ properties?: Properties;
134
134
  };
135
- build({ block, nest, richTextToHast, colorProps }: BlockToHastBuilderBuildOpts): Promise<HChild[]>;
135
+ build({ block, nest, richTextToHast, colorProps }: BlockToHastBuilderBuildOpts): Promise<Child[]>;
136
136
  isBreak(prevType: PrevType): boolean;
137
137
  }
138
138
  export declare class BlockQuoteToHast extends BlockToHastBuilder<'quote'> {
139
139
  constructor(opts?: BlockToHastBuilderOpts);
140
140
  outerTag(): {
141
141
  name: string | null;
142
- properties?: HProperties;
142
+ properties?: Properties;
143
143
  };
144
- build({ block, nest, richTextToHast, colorProps }: BlockToHastBuilderBuildOpts): Promise<HChild[]>;
144
+ build({ block, nest, richTextToHast, colorProps }: BlockToHastBuilderBuildOpts): Promise<Child[]>;
145
145
  isBreak(_prevType: PrevType): boolean;
146
146
  }
147
147
  export declare class BlockTodoToHast extends BlockToHastBuilder<'to_do'> {
148
148
  constructor(opts?: BlockToHastBuilderOpts);
149
149
  outerTag(): {
150
150
  name: string | null;
151
- properties?: HProperties;
151
+ properties?: Properties;
152
152
  };
153
- build({ block, nest, richTextToHast, colorProps }: BlockToHastBuilderBuildOpts): Promise<HChild[]>;
153
+ build({ block, nest, richTextToHast, colorProps }: BlockToHastBuilderBuildOpts): Promise<Child[]>;
154
154
  isBreak(_prevType: PrevType): boolean;
155
155
  }
156
156
  export declare class BlockToggleToHast extends BlockToHastBuilder<'toggle'> {
157
157
  constructor(opts?: BlockToHastBuilderOpts);
158
158
  outerTag(): {
159
159
  name: string | null;
160
- properties?: HProperties;
160
+ properties?: Properties;
161
161
  };
162
- build({ block, nest, richTextToHast, colorProps }: BlockToHastBuilderBuildOpts): Promise<HChild[]>;
162
+ build({ block, nest, richTextToHast, colorProps }: BlockToHastBuilderBuildOpts): Promise<Child[]>;
163
163
  isBreak(_prevType: PrevType): boolean;
164
164
  }
165
165
  export declare class BlockTableToHast extends BlockToHastBuilder<'table'> {
166
166
  constructor(opts?: BlockToHastBuilderOpts);
167
167
  outerTag(): {
168
168
  name: string | null;
169
- properties?: HProperties;
169
+ properties?: Properties;
170
170
  };
171
- build({ block, nest, richTextToHast }: BlockToHastBuilderBuildOpts): Promise<HChild[]>;
171
+ build({ block, nest, richTextToHast }: BlockToHastBuilderBuildOpts): Promise<Child[]>;
172
172
  isBreak(_prevType: PrevType): boolean;
173
173
  }
174
174
  export declare class BlockTableRowToHast extends BlockToHastBuilder<'table_row'> {
175
175
  constructor(opts?: BlockToHastBuilderOpts);
176
176
  outerTag(): {
177
177
  name: string | null;
178
- properties?: HProperties;
178
+ properties?: Properties;
179
179
  };
180
- build({ block, nest, parent, index, richTextToHast }: BlockToHastBuilderBuildOpts): Promise<HChild[]>;
180
+ build({ block, nest, parent, index, richTextToHast }: BlockToHastBuilderBuildOpts): Promise<Child[]>;
181
181
  isBreak(_prevType: PrevType): boolean;
182
182
  }
183
183
  export declare class BlockBookmarkToHast extends BlockToHastBuilder<'bookmark'> {
184
184
  constructor(opts?: BlockToHastBuilderOpts);
185
185
  outerTag(): {
186
186
  name: string | null;
187
- properties?: HProperties;
187
+ properties?: Properties;
188
188
  };
189
- build({ block, nest, richTextToHast }: BlockToHastBuilderBuildOpts): Promise<HChild[]>;
189
+ build({ block, nest, richTextToHast }: BlockToHastBuilderBuildOpts): Promise<Child[]>;
190
190
  isBreak(_prevType: PrevType): boolean;
191
191
  }
192
192
  export declare class BlockImageToHast extends BlockToHastBuilder<'image'> {
193
193
  constructor(opts?: BlockToHastBuilderOpts);
194
194
  outerTag(): {
195
195
  name: string | null;
196
- properties?: HProperties;
196
+ properties?: Properties;
197
197
  };
198
- build({ block, nest, richTextToHast }: BlockToHastBuilderBuildOpts): Promise<HChild[]>;
198
+ build({ block, nest, richTextToHast }: BlockToHastBuilderBuildOpts): Promise<Child[]>;
199
199
  isBreak(_prevType: PrevType): boolean;
200
200
  }
201
- declare type PrevType = Block['type'] | undefined | '';
201
+ type PrevType = Block['type'] | undefined | '';
202
202
  export declare class SurroundElement {
203
203
  private prevType;
204
204
  private children;
@@ -207,9 +207,9 @@ export declare class SurroundElement {
207
207
  constructor(initType: PrevType, opts?: BlockToHastOpts);
208
208
  protected builder(blockType: PrevType): BlockToHastBuilder<Block['type']> | undefined;
209
209
  append({ block, nest, parent, index, richTextToHast, colorProps }: BlockToHastBuilderBuildOpts): Promise<void>;
210
- nest(contet: HChild): void;
210
+ nest(contet: Child): void;
211
211
  outerTag(): ReturnType<BlockToHastBuilder<Block['type']>['outerTag']> | null;
212
- content(): HChild[];
212
+ content(): Child[];
213
213
  isBreak(cur: PrevType): boolean;
214
214
  reset(): void;
215
215
  }
package/dist/lib/block.js CHANGED
@@ -471,17 +471,6 @@ export class BlockImageToHast extends BlockToHastBuilder {
471
471
  }
472
472
  }
473
473
  export class SurroundElement {
474
- constructor(initType, opts = {}) {
475
- this.prevType = '';
476
- this.children = [];
477
- this.blockToHastBuilders = {};
478
- this.prevType = initType;
479
- const buildersOpts = opts.blockToHastBuilderOpts || {};
480
- if (typeof buildersOpts.defaultClassname === 'undefined') {
481
- buildersOpts.defaultClassname = opts.defaultClassName;
482
- }
483
- this.blockToHastBuilders = Object.assign({}, this.defaultBlockToHastBuilders(buildersOpts), opts.blockToHastBuilders || {});
484
- }
485
474
  defaultBlockToHastBuilders(opts) {
486
475
  return {
487
476
  paragraph: new BlockParagraphToHast(opts),
@@ -504,6 +493,17 @@ export class SurroundElement {
504
493
  image: new BlockImageToHast(opts)
505
494
  };
506
495
  }
496
+ constructor(initType, opts = {}) {
497
+ this.prevType = '';
498
+ this.children = [];
499
+ this.blockToHastBuilders = {};
500
+ this.prevType = initType;
501
+ const buildersOpts = opts.blockToHastBuilderOpts || {};
502
+ if (typeof buildersOpts.defaultClassname === 'undefined') {
503
+ buildersOpts.defaultClassname = opts.defaultClassName;
504
+ }
505
+ this.blockToHastBuilders = Object.assign({}, this.defaultBlockToHastBuilders(buildersOpts), opts.blockToHastBuilders || {});
506
+ }
507
507
  builder(blockType) {
508
508
  if (blockType) {
509
509
  return this.blockToHastBuilders[blockType];
@@ -1,8 +1,8 @@
1
- import { HProperties } from 'hastscript/lib/core';
1
+ import type { Properties } from 'hastscript';
2
2
  import { ColorPropsOpts } from './types';
3
3
  export declare class ColorProps {
4
4
  private defaultColorPropertiesMap;
5
5
  private colorPropertiesMap;
6
6
  constructor(opts: ColorPropsOpts);
7
- props(color: string): HProperties;
7
+ props(color: string): Properties;
8
8
  }
package/dist/lib/color.js CHANGED
@@ -20,13 +20,13 @@ const colorPropertiesMap = {
20
20
  red_background: { style: 'background-color:#FBE4E4' }
21
21
  };
22
22
  export class ColorProps {
23
+ defaultColorPropertiesMap() {
24
+ return colorPropertiesMap;
25
+ }
23
26
  constructor(opts) {
24
27
  this.colorPropertiesMap = {};
25
28
  Object.assign(this.colorPropertiesMap, this.defaultColorPropertiesMap(), opts.colorPropertiesMap || {});
26
29
  }
27
- defaultColorPropertiesMap() {
28
- return colorPropertiesMap;
29
- }
30
30
  props(color) {
31
31
  return { ...(this.colorPropertiesMap[color] || {}) };
32
32
  }
@@ -1,4 +1,4 @@
1
- import { Node } from 'hastscript/lib/core';
1
+ import type { Child } from 'hastscript';
2
2
  import { ToHastOpts } from './types.js';
3
3
  import { Client } from './client.js';
4
- export declare function blockToHast(client: Client, opts: ToHastOpts, depth?: number): Promise<Node>;
4
+ export declare function blockToHast(client: Client, opts: ToHastOpts, depth?: number): Promise<Child>;
@@ -20,7 +20,12 @@ export async function blockToHast(client, opts, depth = 0) {
20
20
  if (i.has_children) {
21
21
  const a = await blockToHast(client, Object.assign({}, opts, { block_id: i.id, parent: i }), depth + 1);
22
22
  // surround.nest(a)
23
- nest.push(a);
23
+ if (Array.isArray(a)) {
24
+ nest.push(...a);
25
+ }
26
+ else {
27
+ nest.push(a);
28
+ }
24
29
  }
25
30
  await surround.append({
26
31
  block: i,
@@ -1,2 +1,2 @@
1
- import { HProperties } from 'hastscript/lib/core';
2
- export declare function mergeProps(p: HProperties, { className, style, ...others }: HProperties): HProperties;
1
+ import type { Properties } from 'hastscript';
2
+ export declare function mergeProps(p: Properties, { className, style, ...others }: Properties): Properties;
@@ -1,7 +1,7 @@
1
- import { HChild, HProperties } from 'hastscript/lib/core';
1
+ import type { Child, Properties } from 'hastscript';
2
2
  import { ColorProps } from './color.js';
3
3
  import { RichTextItem, RichTexttoHastOpts } from './types.js';
4
- export declare type RichTextTextItem = Extract<RichTextItem, {
4
+ export type RichTextTextItem = Extract<RichTextItem, {
5
5
  type?: 'text';
6
6
  }>;
7
7
  export declare function colorText(richTextColor: string): [string, string];
@@ -10,7 +10,7 @@ export declare class RichTextToHast {
10
10
  protected defaultClassName: boolean;
11
11
  private propertiesMap;
12
12
  constructor(opts?: RichTexttoHastOpts, colorProps?: ColorProps);
13
- protected props(key: string): HProperties;
14
- textToHast(text: RichTextTextItem): HChild;
15
- build(richTextItems: RichTextItem[]): Promise<HChild[]>;
13
+ protected props(key: string): Properties;
14
+ textToHast(text: RichTextTextItem): Child;
15
+ build(richTextItems: RichTextItem[]): Promise<Child[]>;
16
16
  }
@@ -1,42 +1,42 @@
1
1
  import { Client } from '@notionhq/client';
2
- import { HProperties } from 'hastscript/lib/core';
2
+ import type { Properties } from 'hastscript';
3
3
  import { BlockToHastBuilder } from './block';
4
- export declare type ToHastOpts = {
4
+ export type ToHastOpts = {
5
5
  block_id: string;
6
6
  parent?: Block;
7
7
  blocktoHastOpts?: BlockToHastOpts;
8
8
  richTexttoHastOpts?: RichTexttoHastOpts;
9
9
  colorPropsOpts?: ColorPropsOpts;
10
10
  };
11
- export declare type Block = Extract<Awaited<ReturnType<InstanceType<typeof Client>['blocks']['retrieve']>>, {
11
+ export type Block = Extract<Awaited<ReturnType<InstanceType<typeof Client>['blocks']['retrieve']>>, {
12
12
  type: string;
13
13
  }>;
14
- export declare type BlockToHastBuilderPropertiesKey = `paragraph` | `heading-1` | `heading-2` | `heading-3` | `code` | `code-pre` | `code-code` | `code-caption` | `callout` | `callout-icon-emoji` | `callout-icon-image` | `callout-paragraph` | `divider` | `column-list` | `column` | `bulleted-list` | `bulleted-list-item` | `numbered-list` | `numbered-list-item` | `quote` | `todo` | `todo-checked` | `todo-not-checked` | `todo-text` | `toggle` | `toggle-summary` | `table` | `table-row` | `table-row-cell` | `table-row-header` | `table-row-header-top-left` | `table-row-header-top` | `table-row-header-left` | `bookmark` | `bookmark-link` | `bookmark-caption` | `image` | `image-img` | `image-caption` | `text-link` | `text-bold` | `text-code` | `text-italic` | `text-strikethrough` | `text-underline`;
15
- export declare type BlockToHastBuilderPropertiesMap = {
16
- [key in BlockToHastBuilderPropertiesKey]?: HProperties;
14
+ export type BlockToHastBuilderPropertiesKey = `paragraph` | `heading-1` | `heading-2` | `heading-3` | `code` | `code-pre` | `code-code` | `code-caption` | `callout` | `callout-icon-emoji` | `callout-icon-image` | `callout-paragraph` | `divider` | `column-list` | `column` | `bulleted-list` | `bulleted-list-item` | `numbered-list` | `numbered-list-item` | `quote` | `todo` | `todo-checked` | `todo-not-checked` | `todo-text` | `toggle` | `toggle-summary` | `table` | `table-row` | `table-row-cell` | `table-row-header` | `table-row-header-top-left` | `table-row-header-top` | `table-row-header-left` | `bookmark` | `bookmark-link` | `bookmark-caption` | `image` | `image-img` | `image-caption` | `text-link` | `text-bold` | `text-code` | `text-italic` | `text-strikethrough` | `text-underline`;
15
+ export type BlockToHastBuilderPropertiesMap = {
16
+ [key in BlockToHastBuilderPropertiesKey]?: Properties;
17
17
  };
18
- export declare type BlockToHastBuilderOpts = {
18
+ export type BlockToHastBuilderOpts = {
19
19
  defaultClassname?: boolean;
20
20
  propertiesMap?: BlockToHastBuilderPropertiesMap;
21
21
  };
22
- export declare type BlockToHastBuilders = Record<string, BlockToHastBuilder<Block['type']>>;
23
- export declare type RichTextItem = Extract<Block, {
22
+ export type BlockToHastBuilders = Record<string, BlockToHastBuilder<Block['type']>>;
23
+ export type RichTextItem = Extract<Block, {
24
24
  type: 'paragraph';
25
25
  }>['paragraph']['rich_text'][0];
26
- export declare type BlockToHastOpts = {
26
+ export type BlockToHastOpts = {
27
27
  defaultClassName?: boolean;
28
28
  blockToHastBuilderOpts?: BlockToHastBuilderOpts;
29
29
  blockToHastBuilders?: BlockToHastBuilders;
30
30
  };
31
- export declare type ColorPropertiesMap = Record<string, HProperties>;
32
- export declare type ColorPropsOpts = {
31
+ export type ColorPropertiesMap = Record<string, Properties>;
32
+ export type ColorPropsOpts = {
33
33
  colorPropertiesMap?: ColorPropertiesMap;
34
34
  };
35
- export declare type RichTexttoHastBuildePropertiesMap = Record<string, HProperties>;
36
- export declare type RichTexttoHastBuilderOpts = {
35
+ export type RichTexttoHastBuildePropertiesMap = Record<string, Properties>;
36
+ export type RichTexttoHastBuilderOpts = {
37
37
  richTexttoHastBuildePropertiesMap?: RichTexttoHastBuildePropertiesMap;
38
38
  };
39
- export declare type RichTexttoHastOpts = {
39
+ export type RichTexttoHastOpts = {
40
40
  defaultClassName?: boolean;
41
41
  richTexttoHastBuilderOpts?: RichTexttoHastBuilderOpts;
42
42
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "notion2hast",
3
- "version": "0.1.1",
3
+ "version": "0.1.2",
4
4
  "description": "Notion blocks to hast",
5
5
  "license": "MIT",
6
6
  "author": "hankei6km <hankei6km@gmail.com> (https://github.com/hankei6km)",
@@ -32,16 +32,16 @@
32
32
  "start": "npm run build && node dist/main.js",
33
33
  "build": "npm run clean && tsc && rimraf dist/test && mv dist/src/* dist/ && rimraf dist/src",
34
34
  "test": "node --experimental-vm-modules node_modules/.bin/jest",
35
- "clean": "rimraf \"dist/*\"",
35
+ "clean": "rimraf dist/",
36
36
  "upgrade-interactive": "npm-check --update",
37
37
  "csb:test": "npm test -- --runInBand --watchAll"
38
38
  },
39
39
  "dependencies": {
40
40
  "@notionhq/client": "^2.2.0",
41
41
  "hash.js": "^1.1.7",
42
- "hast-util-classnames": "^2.0.0",
43
- "hast-util-to-html": "^8.0.3",
44
- "hastscript": "^7.0.2",
42
+ "hast-util-classnames": "^3.0.0",
43
+ "hast-util-to-html": "^9.0.0",
44
+ "hastscript": "^9.0.0",
45
45
  "sha.js": "^2.4.11",
46
46
  "yargs": "^17.5.1"
47
47
  },
@@ -51,9 +51,9 @@
51
51
  "@types/sha.js": "^2.4.0",
52
52
  "@types/yargs": "^17.0.12",
53
53
  "jest": "^28.1.3",
54
- "rimraf": "^3.0.2",
54
+ "rimraf": "^5.0.0",
55
55
  "ts-jest": "^28.0.8",
56
56
  "ts-node": "^10.9.1",
57
- "typescript": "^4.8.3"
57
+ "typescript": "^5.0.2"
58
58
  }
59
59
  }