Initial Commit

This commit is contained in:
2026-05-27 23:29:53 +01:00
commit fbc70f96e6
10000 changed files with 1102152 additions and 0 deletions

View File

@@ -0,0 +1,27 @@
/**
* ServiceRegistry module augmentation — declares the `searchIndexes`
* slot on `@suaveplan/api-plugin/service-registry`'s `ServiceRegistry`
* interface so downstream plugins typed against the augmented registry
* see `ctx.getService("searchIndexes")` resolve to
* `Map<string, SearchIndex> | undefined` without any cast.
*
* Importing this module for its side effects (which the package root
* barrel does automatically) is sufficient — every consumer of
* `@suaveplan/api-plugin-search` gets typed `searchIndexes` access.
*
* The host-side slot `app` is owned by `@suaveplan/api`'s own
* registry-augmentation module. We re-declare it here as a
* cumulative augmentation so the search plugin's `onInit(ctx)` can
* resolve it with full typing even when the consumer has not
* explicitly imported `@suaveplan/api`. TypeScript merges duplicate
* declarations.
*/
import type { OpenAPIHono } from "@hono/zod-openapi";
import type { SearchIndex } from "../types/types.js";
declare module "@suaveplan/api-plugin/service-registry" {
interface ServiceRegistry {
searchIndexes: Map<string, SearchIndex>;
app: OpenAPIHono;
}
}