├── .gitignore ├── LICENSE ├── README.md ├── package.json ├── src ├── Demo.ts ├── Equality.ts ├── Fact.ts ├── Lang.ts ├── Parser.ts └── Semantics.ts ├── tsconfig.json └── yarn.lock /.gitignore: -------------------------------------------------------------------------------- 1 | /node_modules -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | Copyright (c) 2022, Desislav Ivanov 2 | 3 | Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: 4 | 5 | The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. 6 | 7 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 8 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # ts-lambda-calc 2 | Lambda calculus at type-level with TypeScript. 3 | 4 | The project includes: 5 | - a parser which transforms raw strings representing lambda expressions into an ASTs 6 | - an evaluator which reduces ASTs 7 | - a stringifyier which transforms an AST back into a string 8 | 9 | Try it out in the [TypeScript Playground](https://www.typescriptlang.org/play?#code/KYDwDg9gTgLgBDAnmYcBqBDKAeAGnUGYAOwBMBnOcmKAS2IHMA+OAXjgG8FlgAuOAEQA3LAIA0cEVH74AvgChQkWNxRwAYgFdiAY2wBZCfkIkKVGvWZtOqvoIBm2neLgAjCKUT9DkrD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bZHVwERSKq01gnncxtqGlgX0qbGpVY7OWWJ1VM01SHV2DtJXSwFWoRFAAVZN5auUwyTRAGtH0qb3T0dO2kta9YmolU7ZtGrqbapxjImdei511vJAu1VTaW0yy1cbUO+6bwRw3ZuzUtbiSXqvUyItPKhEuqHZC7ANLsDOqgGO9GtbO36yVo+nppaw2crfR+6tv6J3-vdiHIDNQB0prA5WmGH7R1MCg3rM98tj3ds+hO9mcAADUcA9zWAAKxFrpbPN1u1dT6r1VmgEOaqbMczaxx57G83CrjbrbN7H+MKtzRwfNzMfgJuLRgBFJ5SCvpQ9gajx9x11vraawOFrVOLoPSu3Dxs4B2tdne+9W7oOaew8u1tq6T1TuM1ev9ZnG2B0PW2tdRnbPyns7uhtQcLNHvbaexza713uZC55vdjmNbOas3ptzIW7hhe80uqLumO1afPSe+DvLKVyetqhnpCncUYbgH+rTsGcNttXUF4kQA)! 10 | 11 | ## Examples 12 | ### Intro 13 | When parsing the string `(λx.x) y`, 14 | - the parser produces `App, "x">, Var<"y">>` 15 | - the evaluator derives `Var<"y">` 16 | - the stringifier produces `y`: 17 | ```ts 18 | import { Parse } from "./Parser" 19 | import { Eval, Stringify } from "./Semantics" 20 | type raw = `(λx.x) y` 21 | type parsed = Parse // App, "x">, Var<"y">> 22 | type evaluated = Eval // Var<"y"> 23 | type stringified = Stringify // y 24 | ``` 25 | ### Arithmetics 26 | The following example shows simple arithmetic operations with [Church Encoding](https://en.wikipedia.org/wiki/Church_encoding): 27 | 28 | ```ts 29 | type ZERO = "(λf.(λx.x))" 30 | type SUCC = "(λa.(λf.(λx.(a f) (f x))))" 31 | type ADD = `(λa.(λb.(b ${SUCC} a)))` 32 | 33 | type zero = Parse // Func, "x">, "f"> 34 | type succ = Parse // Func, Var<"f">>, App, Var<"x">>>, "x">, "f">, "a"> 35 | type one = Parse<`${SUCC} ${ZERO}`> // App, Var<"f">>, App, Var<"x">>>, "x">, "f">, "a">, Func, "x">, "f">> 36 | type two = Parse<`${SUCC} (${SUCC} ${ZERO})`> // App, Var<"f">>, App, Var<"x">>>, "x">, "f">, "a">, App, Var<"f">>, App, Var<"x">>>, "x">, "f">, "a">, Func, "x">, "f">>> 37 | 38 | type rawOne = Stringify // ((λa.(λf.(λx.((a f) (f x))))) (λf.(λx.x))) 39 | 40 | type rawTwo = Stringify // ( 41 | // (λa.(λf.(λx.((a f) (f x))))) 42 | // ((λa.(λf.(λx.((a f) (f x))))) (λf.(λx.x))) 43 | // ) 44 | 45 | type evalZero = Stringify> // (λf.(λx.x)) 46 | type evalOne = Stringify> // (λf.(λx.(f x))) 47 | type evalTwo = Stringify> // (λf.(λx.(f (f x)))) 48 | 49 | // 3 + 2 = 5 50 | type parsed = Parse<`${ADD} (${SUCC} (${SUCC} (${SUCC} ${ZERO}))) (${SUCC} (${SUCC} ${ZERO}))`> 51 | type rawParsed = Stringify // (((λa.(λb.((b (λa.(λf.(λx.((a f) (f x)))))) a))) 52 | // ((λa.(λf.(λx.((a f) (f x))))) 53 | // ((λa.(λf.(λx.((a f) (f x))))) 54 | // ((λa.(λf.(λx.((a f) (f x))))) 55 | // (λf.(λx.x)))))) 56 | // ((λa.(λf.(λx.((a f) (f x))))) 57 | // ((λa.(λf.(λx.((a f) (f x))))) 58 | // (λf.(λx.x))))) 59 | 60 | type evaluated = Stringify> // (λf.(λxx.(f (f (f (f (f xx))))))) 61 | ``` 62 | 63 | ## Factorial and limitations 64 | There is an implementation of factorial in [Fact.ts](./src/Fact.ts), but unfortunately the compiler has hardcoded type-instantiation depth limits and fails with *Type instantiation is excessively deep and possibly infinite*. 65 | 66 | # License 67 | 68 | MIT 69 | -------------------------------------------------------------------------------- /package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "ts-lambda-calc", 3 | "version": "1.0.0", 4 | "author": "Desislav Ivanov", 5 | "license": "MIT", 6 | "scripts": { 7 | "tsc:check": "tsc --noEmit" 8 | }, 9 | "dependencies": { 10 | "typescript": "^4.5.3" 11 | } 12 | } 13 | -------------------------------------------------------------------------------- /src/Demo.ts: -------------------------------------------------------------------------------- 1 | import { Parse, } from "./Parser" 2 | import { Eval, Stringify, } from "./Semantics" 3 | 4 | type ZERO = "(λf.(λx.x))" 5 | type SUCC = "(λa.(λf.(λx.(a f) (f x))))" 6 | type ADD = `(λa.(λb.(b ${SUCC} a)))` 7 | 8 | type zero = Parse 9 | type succ = Parse 10 | type one = Parse<`${SUCC} ${ZERO}`> 11 | type two = Parse<`${SUCC} (${SUCC} ${ZERO})`> 12 | 13 | type rawOne = Stringify // ((λa.(λf.(λx.((a f) (f x))))) (λf.(λx.x))) 14 | 15 | type rawTwo = Stringify // ( 16 | // (λa.(λf.(λx.((a f) (f x))))) 17 | // ((λa.(λf.(λx.((a f) (f x))))) (λf.(λx.x))) 18 | // ) 19 | 20 | type evalZero = Stringify> // (λf.(λx.x)) 21 | type evalOne = Stringify> // (λf.(λx.(f x))) 22 | type evalTwo = Stringify> // (λf.(λx.(f (f x)))) 23 | 24 | // 3 + 2 = 5 25 | type parsed = Parse<`${ADD} (${SUCC} (${SUCC} (${SUCC} ${ZERO}))) (${SUCC} (${SUCC} ${ZERO}))`> 26 | type rawParsed = Stringify // (((λa.(λb.((b (λa.(λf.(λx.((a f) (f x)))))) a))) 27 | // ((λa.(λf.(λx.((a f) (f x))))) 28 | // ((λa.(λf.(λx.((a f) (f x))))) 29 | // ((λa.(λf.(λx.((a f) (f x))))) (λf.(λx.x)))))) 30 | // ((λa.(λf.(λx.((a f) (f x))))) 31 | // ((λa.(λf.(λx.((a f) (f x))))) (λf.(λx.x))))) 32 | type evaluated = Stringify> // (λf.(λxx.(f (f (f (f (f xx))))))) -------------------------------------------------------------------------------- /src/Equality.ts: -------------------------------------------------------------------------------- 1 | export type Equal = A extends B ? B extends A ? true : false :false 2 | -------------------------------------------------------------------------------- /src/Fact.ts: -------------------------------------------------------------------------------- 1 | import { App, Func, Var } from "./Lang" 2 | import { Parse } from "./Parser" 3 | 4 | type TRUE = "(λx.(λy.x))" 5 | type FALSE = "(λx.(λy.y))" 6 | type IF = "(λz.z)" 7 | 8 | type ZERO = "(λf.(λx.x))" 9 | type SUCC = "(λa.(λf.(λx.(a f) (f x))))" 10 | type ONE = "(λf.(λx.f x))" 11 | 12 | type PAIR = `(λx.λy.λz.z x y)` 13 | type FST = `(λp.p ${TRUE})` 14 | type SND = `(λp.p ${FALSE})` 15 | type NEXT = `(λp.${PAIR} (${SND} p) (${SUCC} (${SND} p)))` 16 | type PRED = `(λa.${FST} (a ${NEXT} (${PAIR} ${ZERO} ${ZERO})))` 17 | 18 | type ISZERO = `(λa.a (λx.${FALSE}) ${TRUE})` 19 | 20 | type ADD = `(λa.(λb.(b (${SUCC} a))))` 21 | type MUL = `(λm.λn.m (${ADD} n) ${ZERO})` 22 | 23 | 24 | type FIX = "(λf.(λx.(f (x x))) (λx.(f (x x))))" 25 | type FACT = `${FIX} (λf.λa.${IF} (${ISZERO} a) ${ONE} (${MUL} a (f (${PRED} a))))` // too hard to parse 26 | 27 | type fix = Parse 28 | type if_ = Parse 29 | type one = Parse 30 | type mul = Parse 31 | type fst = Parse 32 | type next = Parse 33 | type pred2 = Parse<`${PAIR} ${ZERO} ${ZERO}`> 34 | type pred1 = App, next>, pred2>> 35 | type pred = Func 36 | type r1 = App, App>> 37 | type r2 = App>, r1> 38 | // (λf.λa.IF (ISZERO a) ONE (MUL a (f (PRED a)))) 39 | type aux = Func< 40 | Func< 41 | App< 42 | App>,one> 43 | , r2 44 | > 45 | , "a"> 46 | , "f"> 47 | 48 | 49 | type fact = App< 50 | fix, 51 | aux 52 | > 53 | // Type instantiation is excessively deep and possibly infinite... 54 | // type z = Eval> 55 | -------------------------------------------------------------------------------- /src/Lang.ts: -------------------------------------------------------------------------------- 1 | export type Var = { type: "var", var: X } 2 | export type Func = { type: "func", body: M, var: X } 3 | export type App = { type: "app", func: M, arg: N } 4 | 5 | 6 | -------------------------------------------------------------------------------- /src/Parser.ts: -------------------------------------------------------------------------------- 1 | import { App, Func, Var } from "./Lang"; 2 | import { Stringify } from "./Semantics"; 3 | 4 | export type ParseBodyVar = 5 | S extends "" 6 | ? ["", ""] 7 | : S extends `${infer c}${infer Rest}` 8 | ? c extends "(" | " " | ")" | "λ" | "" 9 | ? ["", S] 10 | : ParseBodyVar extends [infer cs, infer Remain] 11 | ? cs extends string 12 | ? [`${c}${cs}`, Remain] 13 | : never 14 | : never 15 | : never 16 | 17 | 18 | type ParseList = 19 | S extends `)${infer _}` 20 | ? [[], S] 21 | : S extends "" 22 | ? [[], S] 23 | : S extends ` ${infer Rest}` 24 | ? ParseList 25 | : S extends `(${infer Rest}` 26 | ? ParseBody extends [infer Body, infer Remain] 27 | ? Remain extends `)${infer Rest2}` 28 | ? ParseList extends [[...infer List], infer Remain2] 29 | ? [[Body, ...List], Remain2] 30 | : never 31 | : never 32 | : never 33 | : ParseBodyVar extends [infer X, infer Remain] 34 | ? X extends string 35 | ? ParseList extends [[...infer List], infer Remain2] 36 | ? [[Var, ...List], Remain2] 37 | : never 38 | : never 39 | : never 40 | 41 | type FoldRApps = 42 | Ms extends [infer M] ? M 43 | : Ms extends [...infer Init, infer M] ? App, M> : never 44 | 45 | type ParseApps = 46 | ParseList extends [infer Ms, infer Remain] 47 | ? [FoldRApps, Remain] 48 | : never 49 | 50 | export type ParseBody = 51 | S extends `λ${infer X}.${infer Remain}` 52 | ? ParseBody extends [infer Body, infer Remain2] 53 | ? [Func, Remain2] 54 | : never 55 | : ParseApps 56 | 57 | export type Parse = 58 | ParseBody extends [infer M, infer Rest] 59 | ? Rest extends "" 60 | ? M 61 | : never 62 | : never 63 | 64 | //tests 65 | const t1: Stringify > = "((f f) f)" 66 | const t2: Stringify> = "(f (f f))" 67 | const t3: Stringify> = "(λf.((λx.(f (x x))) (λx.(f (x x)))))" 68 | const t4: Stringify> = "((λf.((λx.(f (x x))) (λx.(f (x x))))) z)" -------------------------------------------------------------------------------- /src/Semantics.ts: -------------------------------------------------------------------------------- 1 | import { Equal } from "./Equality"; 2 | import { App, Func, Var } from "./Lang"; 3 | 4 | export type FV = 5 | M extends Var ? X 6 | : M extends Func ? Exclude, X> 7 | : M extends App ? FV | FV 8 | : never 9 | 10 | export type GenerateUnused = X extends Y ? GenerateUnused<`x${X}`, Y> : X 11 | 12 | export type Subst = 13 | M extends Var ? X extends Y ? N : M 14 | : M extends App ? App, Subst> 15 | : M extends Func ? 16 | X extends Y ? M 17 | : X extends FV ? 18 | GenerateUnused<"x", FV | FV> extends infer Z ? 19 | Z extends string ? 20 | Func, X>, N, Y>, Z> : never 21 | : never 22 | : Func, X> 23 | : never; 24 | 25 | export type Reduce = 26 | M extends Var ? M 27 | : M extends Func 28 | ? Func, X> 29 | : M extends App 30 | ? Reduce extends infer Red 31 | ? Red extends Func 32 | ? Reduce> 33 | : App 34 | : M 35 | : never 36 | 37 | export type Eval = Reduce extends infer R ? Equal extends true ? R : Eval : never 38 | 39 | export type Stringify = 40 | M extends Var ? X 41 | : M extends Func 42 | ? `(λ${X}.${Stringify})` 43 | : M extends App 44 | ? `(${Stringify} ${Stringify})` 45 | : never 46 | 47 | -------------------------------------------------------------------------------- /tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "compilerOptions": { 3 | /* Visit https://aka.ms/tsconfig.json to read more about this file */ 4 | 5 | /* Projects */ 6 | // "incremental": true, /* Enable incremental compilation */ 7 | // "composite": true, /* Enable constraints that allow a TypeScript project to be used with project references. */ 8 | // "tsBuildInfoFile": "./", /* Specify the folder for .tsbuildinfo incremental compilation files. */ 9 | // "disableSourceOfProjectReferenceRedirect": true, /* Disable preferring source files instead of declaration files when referencing composite projects */ 10 | // "disableSolutionSearching": true, /* Opt a project out of multi-project reference checking when editing. */ 11 | // "disableReferencedProjectLoad": true, /* Reduce the number of projects loaded automatically by TypeScript. */ 12 | 13 | /* Language and Environment */ 14 | "target": "es2016", /* Set the JavaScript language version for emitted JavaScript and include compatible library declarations. */ 15 | // "lib": [], /* Specify a set of bundled library declaration files that describe the target runtime environment. */ 16 | // "jsx": "preserve", /* Specify what JSX code is generated. */ 17 | // "experimentalDecorators": true, /* Enable experimental support for TC39 stage 2 draft decorators. */ 18 | // "emitDecoratorMetadata": true, /* Emit design-type metadata for decorated declarations in source files. */ 19 | // "jsxFactory": "", /* Specify the JSX factory function used when targeting React JSX emit, e.g. 'React.createElement' or 'h' */ 20 | // "jsxFragmentFactory": "", /* Specify the JSX Fragment reference used for fragments when targeting React JSX emit e.g. 'React.Fragment' or 'Fragment'. */ 21 | // "jsxImportSource": "", /* Specify module specifier used to import the JSX factory functions when using `jsx: react-jsx*`.` */ 22 | // "reactNamespace": "", /* Specify the object invoked for `createElement`. This only applies when targeting `react` JSX emit. */ 23 | // "noLib": true, /* Disable including any library files, including the default lib.d.ts. */ 24 | // "useDefineForClassFields": true, /* Emit ECMAScript-standard-compliant class fields. */ 25 | 26 | /* Modules */ 27 | "module": "commonjs", /* Specify what module code is generated. */ 28 | // "rootDir": "./", /* Specify the root folder within your source files. */ 29 | // "moduleResolution": "node", /* Specify how TypeScript looks up a file from a given module specifier. */ 30 | // "baseUrl": "./", /* Specify the base directory to resolve non-relative module names. */ 31 | // "paths": {}, /* Specify a set of entries that re-map imports to additional lookup locations. */ 32 | // "rootDirs": [], /* Allow multiple folders to be treated as one when resolving modules. */ 33 | // "typeRoots": [], /* Specify multiple folders that act like `./node_modules/@types`. */ 34 | // "types": [], /* Specify type package names to be included without being referenced in a source file. */ 35 | // "allowUmdGlobalAccess": true, /* Allow accessing UMD globals from modules. */ 36 | // "resolveJsonModule": true, /* Enable importing .json files */ 37 | // "noResolve": true, /* Disallow `import`s, `require`s or ``s from expanding the number of files TypeScript should add to a project. */ 38 | 39 | /* JavaScript Support */ 40 | // "allowJs": true, /* Allow JavaScript files to be a part of your program. Use the `checkJS` option to get errors from these files. */ 41 | // "checkJs": true, /* Enable error reporting in type-checked JavaScript files. */ 42 | // "maxNodeModuleJsDepth": 1, /* Specify the maximum folder depth used for checking JavaScript files from `node_modules`. Only applicable with `allowJs`. */ 43 | 44 | /* Emit */ 45 | // "declaration": true, /* Generate .d.ts files from TypeScript and JavaScript files in your project. */ 46 | // "declarationMap": true, /* Create sourcemaps for d.ts files. */ 47 | // "emitDeclarationOnly": true, /* Only output d.ts files and not JavaScript files. */ 48 | // "sourceMap": true, /* Create source map files for emitted JavaScript files. */ 49 | // "outFile": "./", /* Specify a file that bundles all outputs into one JavaScript file. If `declaration` is true, also designates a file that bundles all .d.ts output. */ 50 | // "outDir": "./", /* Specify an output folder for all emitted files. */ 51 | // "removeComments": true, /* Disable emitting comments. */ 52 | // "noEmit": true, /* Disable emitting files from a compilation. */ 53 | // "importHelpers": true, /* Allow importing helper functions from tslib once per project, instead of including them per-file. */ 54 | // "importsNotUsedAsValues": "remove", /* Specify emit/checking behavior for imports that are only used for types */ 55 | // "downlevelIteration": true, /* Emit more compliant, but verbose and less performant JavaScript for iteration. */ 56 | // "sourceRoot": "", /* Specify the root path for debuggers to find the reference source code. */ 57 | // "mapRoot": "", /* Specify the location where debugger should locate map files instead of generated locations. */ 58 | // "inlineSourceMap": true, /* Include sourcemap files inside the emitted JavaScript. */ 59 | // "inlineSources": true, /* Include source code in the sourcemaps inside the emitted JavaScript. */ 60 | // "emitBOM": true, /* Emit a UTF-8 Byte Order Mark (BOM) in the beginning of output files. */ 61 | // "newLine": "crlf", /* Set the newline character for emitting files. */ 62 | // "stripInternal": true, /* Disable emitting declarations that have `@internal` in their JSDoc comments. */ 63 | // "noEmitHelpers": true, /* Disable generating custom helper functions like `__extends` in compiled output. */ 64 | // "noEmitOnError": true, /* Disable emitting files if any type checking errors are reported. */ 65 | // "preserveConstEnums": true, /* Disable erasing `const enum` declarations in generated code. */ 66 | // "declarationDir": "./", /* Specify the output directory for generated declaration files. */ 67 | // "preserveValueImports": true, /* Preserve unused imported values in the JavaScript output that would otherwise be removed. */ 68 | 69 | /* Interop Constraints */ 70 | // "isolatedModules": true, /* Ensure that each file can be safely transpiled without relying on other imports. */ 71 | // "allowSyntheticDefaultImports": true, /* Allow 'import x from y' when a module doesn't have a default export. */ 72 | "esModuleInterop": true, /* Emit additional JavaScript to ease support for importing CommonJS modules. This enables `allowSyntheticDefaultImports` for type compatibility. */ 73 | // "preserveSymlinks": true, /* Disable resolving symlinks to their realpath. This correlates to the same flag in node. */ 74 | "forceConsistentCasingInFileNames": true, /* Ensure that casing is correct in imports. */ 75 | 76 | /* Type Checking */ 77 | "strict": true, /* Enable all strict type-checking options. */ 78 | // "noImplicitAny": true, /* Enable error reporting for expressions and declarations with an implied `any` type.. */ 79 | // "strictNullChecks": true, /* When type checking, take into account `null` and `undefined`. */ 80 | // "strictFunctionTypes": true, /* When assigning functions, check to ensure parameters and the return values are subtype-compatible. */ 81 | // "strictBindCallApply": true, /* Check that the arguments for `bind`, `call`, and `apply` methods match the original function. */ 82 | // "strictPropertyInitialization": true, /* Check for class properties that are declared but not set in the constructor. */ 83 | // "noImplicitThis": true, /* Enable error reporting when `this` is given the type `any`. */ 84 | // "useUnknownInCatchVariables": true, /* Type catch clause variables as 'unknown' instead of 'any'. */ 85 | // "alwaysStrict": true, /* Ensure 'use strict' is always emitted. */ 86 | // "noUnusedLocals": true, /* Enable error reporting when a local variables aren't read. */ 87 | // "noUnusedParameters": true, /* Raise an error when a function parameter isn't read */ 88 | // "exactOptionalPropertyTypes": true, /* Interpret optional property types as written, rather than adding 'undefined'. */ 89 | // "noImplicitReturns": true, /* Enable error reporting for codepaths that do not explicitly return in a function. */ 90 | // "noFallthroughCasesInSwitch": true, /* Enable error reporting for fallthrough cases in switch statements. */ 91 | // "noUncheckedIndexedAccess": true, /* Include 'undefined' in index signature results */ 92 | // "noImplicitOverride": true, /* Ensure overriding members in derived classes are marked with an override modifier. */ 93 | // "noPropertyAccessFromIndexSignature": true, /* Enforces using indexed accessors for keys declared using an indexed type */ 94 | // "allowUnusedLabels": true, /* Disable error reporting for unused labels. */ 95 | // "allowUnreachableCode": true, /* Disable error reporting for unreachable code. */ 96 | 97 | /* Completeness */ 98 | // "skipDefaultLibCheck": true, /* Skip type checking .d.ts files that are included with TypeScript. */ 99 | "skipLibCheck": true /* Skip type checking all .d.ts files. */ 100 | } 101 | } 102 | -------------------------------------------------------------------------------- /yarn.lock: -------------------------------------------------------------------------------- 1 | # THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY. 2 | # yarn lockfile v1 3 | 4 | 5 | typescript@^4.5.3: 6 | version "4.5.3" 7 | resolved "https://registry.yarnpkg.com/typescript/-/typescript-4.5.3.tgz#afaa858e68c7103317d89eb90c5d8906268d353c" 8 | integrity sha512-eVYaEHALSt+s9LbvgEv4Ef+Tdq7hBiIZgii12xXJnukryt3pMgJf6aKhoCZ3FWQsu6sydEnkg11fYXLzhLBjeQ== 9 | --------------------------------------------------------------------------------