All files / packages/fds-uif/schema/src index.ts

100% Statements 1/1
100% Branches 0/0
100% Functions 0/0
100% Lines 1/1

Press n or j to go to the next uncovered block, b, p or k for the previous block.

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52                                                                                                    9x  
/**
 * @fds-uif/schema
 *
 * JSON Schema and TypeScript types for Universal Interface Format (UIF).
 *
 * UIF uses two distinct schemas:
 * - **Foundation Schema**: Defines structure, states, accessibility, and behavior (design-system agnostic)
 * - **System Schema**: Defines design-system specific attributes, modifiers, variants, and state mappings
 *
 * This package provides:
 * - JSON Schema definitions for validation
 * - TypeScript types for all UIF structures
 * - Runtime validation via ajv for source UIFs
 *
 * For utilities that work with resolved UIFs (extraction, validation), see `@fds-uif/core`.
 *
 * @example
 * ```ts
 * import {
 *   validateFoundation,
 *   validateSystem,
 *   type UifFoundation,
 *   type UifSystem,
 *   type ResolvedUIF,
 * } from '@fds-uif/schema';
 *
 * // Validate source UIFs
 * const foundationResult = validateFoundation(data);
 * const systemResult = validateSystem(data);
 * ```
 *
 * @packageDocumentation
 */
 
// Re-export all types (including resolved UIF types)
export * from './types/index.js';
 
// Source UIF validation (foundation and system schemas)
export {
  isFoundationFile,
  isSystemFile,
  validateUif,
  validateFoundation,
  validateSystem,
  SCHEMA_URLS,
  type ValidationError,
  type ValidationResult,
} from './validate.js';
 
// Schema version constant
export const UIF_VERSION = '1.0.0';