viteVariables
Variable: INK\_DEV\_API\_TEXT\_REPLACES
> const INK_DEV_API_TEXT_REPLACES: "/__pixi-vn-ink/text-replaces" = "/__pixi-vn-ink/text-replaces"
Defined in: src/vite/costants.ts:39
Dev-server endpoint that exposes and accepts the list of registered TextReplaces handlers as InkTextReplaceInfo objects.
GET /__pixi-vn-ink/text-replaces– returns the storedInkTextReplaceInfo[]as JSON.POST /__pixi-vn-ink/text-replaces– replaces the stored list with the JSON body (InkTextReplaceInfo[]). Called automatically by setupInkHmrListener on startup and after each HMR update.InkTextReplaceInfo.validationserializes the original validation rule:{ type: "regexp", source, flags }{ type: "zod", schema }(JSON Schema generated from Zod){ type: "literal", value }for string modes like"all"/"characterId"
Example
// VS Code extension reading the registered text-replace handlers
const res = await fetch("http://localhost:5173/__pixi-vn-ink/text-replaces");
const replaces: InkTextReplaceInfo[] = await res.json();