> For AI agents: the complete documentation index is available at /llms.txt, the full documentation bundle is available at /llms-full.txt.

# TypeScript

Write functional TypeScript with declared functions, immutable values, typed Results, and exhaustive matching. Covers module layout, naming, types, state, composition, JSDoc, and behavioral tests.


[ConditionalsExit invalid paths with guards and handle closed variants through exhaustive matching.](/packs/languages/typescript/conditionals)[ErrorsCarry failure as a typed Result, contain third-party exceptions, and classify failures without text matching.](/packs/languages/typescript/errors)[File structureAssign modules to their owning capability and keep package entrypoints deliberate and shallow.](/packs/languages/typescript/file-structure)[Functional TypeScriptUse immutable values, declared functions, factories, typed Results, and exhaustive matching. Apply this pack to TypeScript source and examples.](/packs/languages/typescript/README)[FunctionsMake operations findable with declarations, explicit contracts, named inputs, and a single responsibility.](/packs/languages/typescript/functions)[JSDocExplain call-site behavior in multiline JSDoc, demonstrate public usage, and identify private declarations.](/packs/languages/typescript/comments)[NamingName concrete operations and domain values, with casing that stays predictable across platforms.](/packs/languages/typescript/naming)[ParadigmBuild behavior from immutable functions, inject resources through factories, and isolate effects in adapters.](/packs/languages/typescript/paradigm)[StateProduce new values for state changes and keep mutable resource handles separate from installation data.](/packs/languages/typescript/state)[TestingProve observable contracts with real local files and processes, reserving test doubles for external services.](/packs/languages/typescript/testing)[TypesValidate external values, retain readonly contracts, and represent source variants with discriminated unions.](/packs/languages/typescript/types)[UtilitiesUse the existing utility vocabulary and make pipeline stages and I/O concurrency explicit.](/packs/languages/typescript/utilities)