@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
| Export | Kind | Description |
|---|---|---|
VSId | type | Phantom-branded ID — string at runtime, unique type at compile time |
stringToId | function | Cast a raw string to a branded ID at system boundaries |
catchError() | function | Go-style [error, data] tuples for async operations |
VSPagination | interface | Pagination metadata: page, limit, totalPages, totalDocuments |
VSQueryParams | interface | List query input — page?, limit?, and any extra filter keys |
VSListResult | interface | Normalised list response: { items: T[], pagination: VSPagination } |
VSAdapters | interface | Contract for translating raw API responses to internal shapes |
createDefaultAdapters | function | Pre-built adapters for the default response shape |