mirror of
https://github.com/tauri-apps/tauri-search.git
synced 2026-02-04 02:41:20 +01:00
chore: shorten descriptive name on API docs
This commit is contained in:
File diff suppressed because one or more lines are too long
@@ -1,8 +1,31 @@
|
||||
import { capitalize } from "native-dash";
|
||||
import { capitalize, createLookup } from "native-dash";
|
||||
import { TypescriptKind } from "~/enums";
|
||||
import { IConsolidatedModel, IApiModel } from "~/models";
|
||||
import { ModelMapper } from "~/types";
|
||||
import { IndexRank } from "../ConsolidatedMapper";
|
||||
|
||||
export type Symbol = "Namespace" | "Function" | "Enumeration";
|
||||
const shorten = createLookup<TypescriptKind, String>(
|
||||
{
|
||||
Namespace: "Module",
|
||||
Function: "Fn",
|
||||
Enumeration: "Enum",
|
||||
"Call Signature": "Fn",
|
||||
Class: "Class",
|
||||
Reference: "Ref",
|
||||
"Type alias": "Type",
|
||||
"Type literal": "Type",
|
||||
"Type parameter": "Type",
|
||||
"Enumeration member": "Enum Member",
|
||||
Interface: "Interface",
|
||||
Parameter: "Parameter",
|
||||
Project: "Project",
|
||||
Property: "Prop",
|
||||
Variable: "Var",
|
||||
},
|
||||
(v) => v as String
|
||||
);
|
||||
|
||||
export const ApiToConsolidated: ModelMapper<IApiModel, IConsolidatedModel> = (i) => ({
|
||||
objectID: i.id,
|
||||
from: "api",
|
||||
@@ -25,13 +48,10 @@ export const ApiToConsolidated: ModelMapper<IApiModel, IConsolidatedModel> = (i)
|
||||
hierarchy_lvl1: i.name,
|
||||
hierarchy_lvl2:
|
||||
i.module !== i.name
|
||||
? `${capitalize(i.language)} > ${i.module} Module > ${i.kind?.replace(
|
||||
"Namespace",
|
||||
"Module"
|
||||
)} > ${i.name}`
|
||||
: `${capitalize(i.language)} > ${i.kind?.replace("Namespace", "Module")} > ${
|
||||
i.name
|
||||
}`,
|
||||
? `${capitalize(i.language.slice(0, 1))}S ⇢ Module[ ${i.module} ] ⇢ ${shorten(
|
||||
i.kind
|
||||
)}[ ${i.name} ]`
|
||||
: `${capitalize(i.language.slice(0, 1))}S ⇢ ${shorten(i.kind)}[ ${i.name} ]`,
|
||||
hierarchy_lvl3: null,
|
||||
hierarchy_lvl4: null,
|
||||
hierarchy_lvl5: null,
|
||||
|
||||
@@ -59,6 +59,10 @@ export const ConsolidatedModel = createModel<IConsolidatedModel>("consolidated",
|
||||
js: ["typescript", "javascript", "js"],
|
||||
typescript: ["ts", "javascript", "js"],
|
||||
javascript: ["ts", "typescript", "js"],
|
||||
function: ["fn"],
|
||||
fn: ["function"],
|
||||
enum: ["enumeration"],
|
||||
enumeration: ["enum"],
|
||||
})
|
||||
.filterable("from", "language", "symbol")
|
||||
.searchable(
|
||||
|
||||
Reference in New Issue
Block a user