Skip to content

utily/typedly

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

54 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Typedly

Usage / Configuration

The types in this library can accessed in one of the following methods:

  • Namespace import:

    // index.ts
    import { typedly } from "typedly"
    
    type MyUnion = { a: string, common: boolean } | { b: string, common: boolean }
    export type Usage = typedly.DistributiveOmit<MyUnion, "common">
  • Direct import:

    // index.ts
    import { DistributiveOmit } from "typedly/dist/typedly"
    
    type MyUnion = { a: string, common: boolean } | { b: string, common: boolean }
    export type Usage = DistributiveOmit<MyUnion, "common">
  • Injecting the types globally using tsconfig.json:

    • Injecting the types globally using tsconfig.json:
    // tsconfig.json
    {
    	"types": ["typedly/dist/types/global.d.ts"]
    }
    // index.ts
    type MyUnion = { a: string, common: boolean } | { b: string, common: boolean }
    export type Usage = DistributiveOmit<MyUnion, "common">

About

Utility types.

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Contributors 3

  •  
  •  
  •