mirror of
https://github.com/discordjs/discord.js.git
synced 2026-03-10 16:43:31 +01:00
feat: add util package for generating search indices (#8571)
This commit is contained in:
@@ -0,0 +1,20 @@
|
||||
import type { ApiItem, ApiModel } from '@microsoft/api-extractor-model';
|
||||
import type { DocNodeContainer } from '@microsoft/tsdoc';
|
||||
import { createCommentNode } from '.';
|
||||
import { type AnyDocNodeJSON, type DocNodeJSON, node } from './CommentNode';
|
||||
|
||||
export interface DocNodeContainerJSON extends DocNodeJSON {
|
||||
nodes: AnyDocNodeJSON[];
|
||||
}
|
||||
|
||||
export function nodeContainer(
|
||||
container: DocNodeContainer,
|
||||
model: ApiModel,
|
||||
version: string,
|
||||
parentItem?: ApiItem,
|
||||
): DocNodeContainerJSON {
|
||||
return {
|
||||
...node(container),
|
||||
nodes: container.nodes.map((node) => createCommentNode(node, model, version, parentItem)),
|
||||
};
|
||||
}
|
||||
Reference in New Issue
Block a user