Skip to content

Commit 387fb00

Browse files
fix: type def
Co-Authored-By: Caner Akdas <[email protected]>
1 parent 2227e3f commit 387fb00

File tree

2 files changed

+26
-3
lines changed

2 files changed

+26
-3
lines changed

src/generators/orama-db/index.mjs

+2-3
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22

33
import { create } from '@orama/orama';
44
import { persistToFile } from '@orama/plugin-data-persistence/server';
5+
56
import { groupNodesByModule } from '../../utils/generators.mjs';
67
import { createSectionBuilder } from '../legacy-json/utils/buildSection.mjs';
78

@@ -56,7 +57,7 @@ export default {
5657

5758
/**
5859
* @param {ApiDocMetadataEntry} head
59-
* @returns {import('./types.d.ts').OramaDbEntry}
60+
* @returns {void}
6061
*/
6162
const processModuleNodes = head => {
6263
const nodes = groupedModules.get(head.api);
@@ -89,7 +90,5 @@ export default {
8990
'json',
9091
`${output}/${version.raw.replaceAll('.', '-')}-orama-db.json`
9192
);
92-
93-
return db;
9493
},
9594
};

src/generators/orama-db/types.d.ts

+24
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
import { Orama } from '@orama/orama';
2+
3+
/**
4+
* Schema for the Orama database entry
5+
*/
6+
export interface OramaDbEntry {
7+
name: string;
8+
type: string;
9+
desc: string;
10+
stability: number;
11+
stabilityText: string;
12+
meta: {
13+
changes: string[];
14+
added: string[];
15+
napiVersion: string[];
16+
deprecated: string[];
17+
removed: string[];
18+
};
19+
}
20+
21+
/**
22+
* Represents the Orama database for API docs
23+
*/
24+
export type OramaDb = Orama<OramaDbEntry>;

0 commit comments

Comments
 (0)