ConcordiaLang Types

raw JSON →
2.1.6 verified Fri May 01 auth: no javascript

Provides basic TypeScript types for the Concordia Compiler and its plug-ins, including AST, test script, and plugin interfaces. Current stable version is 2.1.6, released with browser support via microbundle. Key differentiators: lightweight, typed, and designed for the Concordia ecosystem. Breaking changes in v2 removed most types, keeping only Location and AbstractDatabase. Release cadence is sporadic, with recent updates focusing on compatibility.

error Cannot find module 'concordialang-types' or its corresponding type declarations.
cause Package not installed or missing @types/concordialang-types (unnecessary as types are bundled).
fix
Run 'npm install concordialang-types' and ensure tsconfig 'node_modules' resolution works.
error TypeError: concordialang_types_1.AbstractDatabase is not a constructor
cause Trying to instantiate AbstractDatabase directly (it's an interface, not a class).
fix
Create a class that implements AbstractDatabase instead of instantiating it directly.
error Module '"concordialang-types"' has no exported member 'X'. Did you mean to use 'import X from "concordialang-types"'?
cause Importing a member that was removed in v2.0.0 (e.g., TestCase, UIProperty).
fix
Check package version. If using v2+, only Location, AbstractDatabase, and TestScriptExecutionResult are available. Use v1.x for removed types.
breaking v2.0.0 removed most types, only Location and AbstractDatabase remain.
fix Use v1.x for other types, or update code to rely only on Location and AbstractDatabase.
breaking v1.0.0 renamed property 'shoudFail' to 'shouldFail' in TestCase.
fix Update all references from 'shoudFail' to 'shouldFail'.
deprecated v0.x types are incompatible with v1+ and v2+; no longer supported.
fix Migrate to v1.x or v2.x; check CHANGELOG for specifics.
gotcha Package uses microbundle; builds are ESM-only. No CommonJS support.
fix Use ESM imports; if using CommonJS, consider dynamic import() or transpilation.
gotcha No browser CJS bundle; browser consumers must use bundler with ESM.
fix Ensure bundler (webpack/rollup) is configured for ESM or switch to Node.js.
npm install concordialang-types
yarn add concordialang-types
pnpm add concordialang-types

Shows usage of Location and AbstractDatabase types with a custom database implementation.

import { Location, AbstractDatabase } from 'concordialang-types';

const loc: Location = { path: '/test', line: 10, column: 5 };
console.log(loc);

class MyDatabase implements AbstractDatabase {
  connect(): Promise<void> { return Promise.resolve(); }
  disconnect(): Promise<void> { return Promise.resolve(); }
  query(sql: string): Promise<any[]> { return Promise.resolve([]); }
}

const db = new MyDatabase();
db.connect().then(() => console.log('Connected'));