···11+import { isNsid, type Nsid } from '@atcute/lexicons/syntax';
22+13import * as v from '@badrap/valita';
2435import * as t from './types.js';
···57const integer = v
68 .number()
79 .assert((input) => input >= 0 && Number.isSafeInteger(input), `expected non-negative integer`);
1010+1111+const nsid: v.Type<Nsid> = v.string().assert(isNsid, `expected valid nsid`);
812913// #region Concrete types
1014export const lexBoolean: v.Type<t.LexBoolean> = v.object({
···264268265269export const lexiconDoc: v.Type<t.LexiconDoc> = v.object({
266270 lexicon: v.literal(1),
267267- id: v.string(),
271271+ id: nsid,
268272 revision: integer.optional(),
269273 description: v.string().optional(),
270274 defs: v.record(lexUserType),
+3-1
packages/lexicons/lexicon-doc/lib/types.ts
···11+import type { Nsid } from '@atcute/lexicons';
22+13// #region Concrete types
24/**
35 * definition for a boolean field
···378380 /** indicates lexicon language version; fixed value of 1 for this version */
379381 lexicon: 1;
380382 /** the NSID of this lexicon */
381381- id: string;
383383+ id: Nsid;
382384 /** optional revision number for versioning */
383385 revision?: number;
384386 /** short overview of the lexicon, usually one or two sentences */