
Product
Introducing Tier 1 Reachability: Precision CVE Triage for Enterprise Teams
Socket’s new Tier 1 Reachability filters out up to 80% of irrelevant CVEs, so security teams can focus on the vulnerabilities that matter.
Typir is a library for type systems and type checking for software languages in the web.
Typir is OpenSource, written in TypeScript, and follows pragmatic approaches for simplifying type checking in practical language engineering projects by providing default implementations for recurring problems. As a stand-alone library, Typir provides a TypeScript-API for language engineers without an additional, external DSL for formalizing types.
npm install typir
For an overview about the core features of Typir with a simple application example, see the root README.md of the Typir project.
Important design decision: Typir is a stand-alone library and has no dependencies to any existing language workbench.
Look at the examples in the examples
folder of the repo (here). There we have some demo projects for you to get started.
v0.3.0 (2025-08-15)
Linked issues and PRs for v0.3.0
CustomKind
and use it to create corresponding CustomType
s, which support the desired custom properties in TypeScript-safe waypackages/typir/test/kinds/custom/custom-matrix.test.ts
and packages/typir/test/kinds/custom/custom-restricted.test.ts
skipThisRuleIfThisTypeAlreadyExists
(in InferCurrentTypeRule
) to control, whether these given inference rules for the "second new type" should be added to the existing type or whether they should be skipped.false
, meaning that these type-specific inference (and validation) rules are attached to the existing type. That conforms to the behaviour before introducing this new property.createTypirServicesWithAdditionalServices<..., AdditionalServices>(Module<AdditionalServices>, ...)
, see customization-example.test.ts
for examples and explanationscreateTypirLangiumServicesWithAdditionalServices<..., AdditionalServices>(..., Module<AdditionalServices>, ...)
works in the same waycreateTypirServicesForTestingWithAdditionalServices<AdditionalServices>(Module<AdditionalServices>, ...)
$name
s of kinds/factories are configurable now (#78).TypirLangiumAddedServices
now as services.langium.LangiumServices
in order to make them available for all Typir services (#78).<LanguageType>
generic is replaced by <Specifics extends TypirSpecifics>
(in Typir-Langium: <Specifics extends TypirLangiumSpecifics>
) everywhere in order to support multiple, customizable TypeScript types in the Typir API (#90):
LanguageType
is now part of TypirSpecifics
and is usable with <TypirSpecifics['LanguageType']>
:
export interface TypirSpecifics {
LanguageType: unknown;
}
TypirLangiumSpecifics
extends the Typir specifics for Langium, concretizes the language type and enables to register the available AST types of the current Langium grammar as AstTypes
:
export interface TypirLangiumSpecifics extends TypirSpecifics {
LanguageType: AstNode;
AstTypes: LangiumAstTypes;
}
It is possible to customize the ValidationMessageProperties
now, which is used to provide the Langium-specific validation properties in Typir-Langium, e.g. to support code actions for validation issues reported by Typir (see lox-type-checking-operators.test.ts
for LOX).
LangiumLanguageNodeInferenceCaching
and DefaultLangiumTypeCreator
use the TypirLangiumServices
parameter to retrieve the LangiumSharedCoreServices
now (#78).<LanguageType>
generic is replaced by <Specifics extends TypirSpecifics>
(in Typir-Langium: <Specifics extends TypirLangiumSpecifics>
) everywhere (see details above) (#90).test-utils.ts
to predefined-language-nodes.ts
test-utils.ts
into the folder packages/typir/src/test/
TypeSelector
is renamed to TypeDescriptor
(and BasicTypeDescriptor
, TypeDescriptorForCustomTypes
are renamed accordingly) (#90).readonly
now (#73)predefined-language-nodes.ts
(#78)FAQs
General purpose type checking library
We found that typir demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 3 open source maintainers collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Product
Socket’s new Tier 1 Reachability filters out up to 80% of irrelevant CVEs, so security teams can focus on the vulnerabilities that matter.
Research
/Security News
Ongoing npm supply chain attack spreads to DuckDB: multiple packages compromised with the same wallet-drainer malware.
Security News
The MCP Steering Committee has launched the official MCP Registry in preview, a central hub for discovering and publishing MCP servers.