@void-snippets/core

@void-snippets/core

Shared types, branded IDs, adapter interfaces, and utility functions.

#What is in this package?

@void-snippets/core is the foundation that everything else builds on. It has zero runtime dependencies — just types and pure utility functions.

typescript
import { stringToId, catchError, createDefaultAdapters } from '@void-snippets/core';
import type {
  VSId,
  VSPagination,
  VSQueryParams,
  VSListResult,
  VSAdapters,
} from '@void-snippets/core';

#What you get

ExportKindDescription
VSIdtypePhantom-branded ID — string at runtime, unique type at compile time
stringToId()functionCast a raw string to a branded ID at system boundaries
catchError()functionGo-style [error, data] tuples for async operations
VSPaginationinterfacePagination metadata: page, limit, totalPages, totalDocuments
VSQueryParamsinterfaceList query input — page?, limit?, and any extra filter keys
VSListResultinterfaceNormalised list response: { items: T[], pagination: VSPagination }
VSAdaptersinterfaceContract for translating raw API responses to internal shapes
createDefaultAdapters()functionPre-built adapters for the default response shape