rotion 1.9.0 → 1.11.0

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.
@@ -1,4 +1,4 @@
1
- import type { VideoBlockObjectResponseEx, EmbedBlockObjectResponseEx } from './types.js';
1
+ import type { VideoBlockObjectResponseEx, EmbedBlockObjectResponseEx, HtmlMetadata, ImagePathWithSize } from './types.js';
2
2
  export declare const findLocationUrl: (rawHeaders: string[]) => string;
3
3
  export declare function getHTTP(reqUrl: string): Promise<string>;
4
4
  export declare function getJson<T>(reqUrl: string): Promise<T>;
@@ -12,19 +12,14 @@ export declare function saveFile(fileUrl: string, prefix: string): Promise<{
12
12
  src: string;
13
13
  size: number;
14
14
  }>;
15
- export declare const saveImage: (imageUrl: string, prefix: string) => Promise<string>;
15
+ export declare const saveImage: (imageUrl: string, prefix: string) => Promise<ImagePathWithSize>;
16
16
  export declare const findHtmlByRegexp: (regexps: RegExp[], html: string) => string | null;
17
17
  export declare const titleRegexps: RegExp[];
18
18
  export declare const descRegexps: RegExp[];
19
19
  export declare const imageRegexps: RegExp[];
20
20
  export declare const iconRegexps: RegExp[];
21
21
  export declare const findImage: (html: string) => string | null;
22
- export declare const getHtmlMeta: (reqUrl: string, httpFunc?: (reqUrl: string) => Promise<string>) => Promise<{
23
- title: string;
24
- desc: string;
25
- image: string;
26
- icon: string;
27
- }>;
22
+ export declare const getHtmlMeta: (reqUrl: string, httpFunc?: (reqUrl: string) => Promise<string>) => Promise<HtmlMetadata>;
28
23
  export declare const getVideoHtml: (block: VideoBlockObjectResponseEx) => Promise<string>;
29
24
  export declare function getSlideshareOembedUrl(reqUrl: string, httpFunc?: (reqUrl: string) => Promise<string>): Promise<string>;
30
25
  export declare const getEmbedHtml: (block: EmbedBlockObjectResponseEx) => Promise<string>;
@@ -81,12 +81,7 @@ export type BookmarkBlockObjectResponseEx = BookmarkBlockObjectResponse & {
81
81
  bookmark: {
82
82
  url: string;
83
83
  caption: Array<RichTextItemResponse>;
84
- site: {
85
- title: string;
86
- desc: string;
87
- image: string;
88
- icon: string;
89
- };
84
+ site: HtmlMetadata;
90
85
  };
91
86
  };
92
87
  export type CalloutBlockObjectResponseEx = CalloutBlockObjectResponse & {
@@ -121,6 +116,8 @@ export type ImageBlockObjectResponseEx = ImageBlockObjectResponse & {
121
116
  };
122
117
  caption: Array<RichTextItemResponse>;
123
118
  src: string;
119
+ width?: number;
120
+ height?: number;
124
121
  } | {
125
122
  type: 'file';
126
123
  file: {
@@ -129,6 +126,8 @@ export type ImageBlockObjectResponseEx = ImageBlockObjectResponse & {
129
126
  };
130
127
  caption: Array<RichTextItemResponse>;
131
128
  src: string;
129
+ width?: number;
130
+ height?: number;
132
131
  };
133
132
  };
134
133
  export type VideoExternal = {
@@ -736,3 +735,14 @@ export type LastEditedTimeDatabasePropertyConfigResponse = {
736
735
  last_edited_time: EmptyObject;
737
736
  id: string;
738
737
  };
738
+ export type ImagePathWithSize = {
739
+ path: string;
740
+ width?: number;
741
+ height?: number;
742
+ };
743
+ export type HtmlMetadata = {
744
+ title: string;
745
+ desc: string;
746
+ image: string;
747
+ icon: string;
748
+ };
@@ -71,12 +71,7 @@ type BookmarkBlockObjectResponseEx = BookmarkBlockObjectResponse & {
71
71
  bookmark: {
72
72
  url: string;
73
73
  caption: Array<RichTextItemResponse>;
74
- site: {
75
- title: string;
76
- desc: string;
77
- image: string;
78
- icon: string;
79
- };
74
+ site: HtmlMetadata;
80
75
  };
81
76
  };
82
77
  type CalloutBlockObjectResponseEx = CalloutBlockObjectResponse & {
@@ -111,6 +106,8 @@ type ImageBlockObjectResponseEx = ImageBlockObjectResponse & {
111
106
  };
112
107
  caption: Array<RichTextItemResponse>;
113
108
  src: string;
109
+ width?: number;
110
+ height?: number;
114
111
  } | {
115
112
  type: 'file';
116
113
  file: {
@@ -119,6 +116,8 @@ type ImageBlockObjectResponseEx = ImageBlockObjectResponse & {
119
116
  };
120
117
  caption: Array<RichTextItemResponse>;
121
118
  src: string;
119
+ width?: number;
120
+ height?: number;
122
121
  };
123
122
  };
124
123
  type VideoExternal = {
@@ -384,6 +383,12 @@ type QueryDatabaseResponseEx = QueryDatabaseResponse & {
384
383
  results: Array<PageObjectResponseEx>;
385
384
  meta: GetDatabaseResponseEx;
386
385
  };
386
+ type HtmlMetadata = {
387
+ title: string;
388
+ desc: string;
389
+ image: string;
390
+ icon: string;
391
+ };
387
392
 
388
393
  interface FetchDatabaseRes extends QueryDatabaseResponseEx {
389
394
  }