2026-08-04 - false
A single index object is type IndexObject and a collection of index objects is type IndexObjects.
export type IndexObject = {
title: string;
description: string;
date_updated: string | Date;
tags: string[];
draft?: boolean | null | undefined;
hidden?: boolean | null | undefined;
pinned?: boolean | null | undefined;
content: string;
locale: string;
slug: string;
};
export type IndexObjects = Record<string, IndexObject>;
Index object types
{
"1": {
"title": "A better way to dispose objects",
"description": "This article explains to use...",
"date_updated": "2025-11-21T00:00:00.000Z",
"tags": [
"visual-rpg"
],
"draft": false,
"hidden": false,
"pinned": true,
"content": "An often-overlooked feature of ...",
"locale": "en",
"slug": "/en/kb/a-better-way-to-dispose-objects"
},
"2": {
"title": "Testing connections with ASP.NET",
"description": "This article provides a single-file...",
"date_updated": "2025-07-11T00:00:00.000Z",
"tags": [
"datagate",
"asp-net"
],
"draft": false,
"hidden": false,
"pinned": false,
"content": "Before you deploy a ...",
"locale": "en",
"slug": "/en/kb/datagate-connection-tester"
},
A couple of example index objects.
The keys to the index object collection must be strings.
const id = "2";
const item = indexer[id];
Fetching an index object by key value.
Object.entries(indexObjects).forEach(([id, data]) => {
console.log(`ID: ${id}`);
console.log(`Title: ${data.title}`);
console.log(`Slug: ${data.slug}`);
console.log("-------------------");
});
Iterate over the index object collection.
const keys = Object.keys(indexObjects["1"]);
Get an index object's array of keys.