typelogic v2.0.0
TypeLogic
Type definitions for performing powerful and unholy generic type logic in TypeScript
Install
npm install typelogic --save-dev
Usage
Referencing the typings
There are two ways to consume these typings.
(Preferred method) Add path to typings in your
tsconfig.json
filee.g. Assuming your
tsconfig.json
lives in your package root directory, add a path like so:{ "files": [ "./node_modules/typelogic/index.d.ts", ... ] }
Or add a reference to typings in your consuming code.
e.g. Assuming you have an
foo.ts
in your package root folder, add a path like so:/// <reference path="./node_modules/typelogic/index.d.ts" /> ...
DO NOT attempt to import the types using an import/require statement like below or TypeScript will no likely. Everything might seem okay at first, but later logic will not work as expected, just trust me.
Using the typings
Okay, if you've referenced the typings correctly, you'll now have access to the following types:
True
False
Bool
If<TCondition, TThen, TElse>
What you do with them is up to you. Examples to come.
Issues or suggestions?
Please create an issue or pull request here. 😸