UNPKG

@croct/plug

Version:

A fully-featured devkit for building natively personalized applications.

20 lines (17 loc) 953 B
import { CanonicalVersionId, VersionedId, Versioned, Version } from './versioning.cjs'; import '@croct/json'; interface ComponentMap { } type LatestComponentVersionMap = { [K in keyof ComponentMap]: { latest: ComponentMap[K]; }; }; interface VersionedComponentMap extends LatestComponentVersionMap { } type ComponentId = keyof VersionedComponentMap extends never ? string : keyof VersionedComponentMap; type ComponentVersion<I extends ComponentId> = Version<VersionedComponentMap, I>; type ComponentVersionId<I extends ComponentId = ComponentId> = CanonicalVersionId<I, VersionedComponentMap>; type VersionedComponentId<I extends ComponentId = ComponentId> = VersionedId<I, VersionedComponentMap>; type ComponentContent<I extends VersionedComponentId> = Versioned<I, VersionedComponentMap>; export type { ComponentContent, ComponentId, ComponentMap, ComponentVersion, ComponentVersionId, VersionedComponentId, VersionedComponentMap };