0.0.6 • Published 5 years ago

@elijahjcobb/prototypes v0.0.6

Weekly downloads
-
License
MIT
Repository
github
Last release
5 years ago

Prototypes

A collection of helpful classes to manage various real world things in TypeScript.

Classes

ClassDescription
ECPrototypesAddressA class representing a physical street address.
ECPrototypesByteSizeA class representing a byte size.
ECPrototypesByteSizeUnitA enum representing a byte size unit.
ECPrototypesColorA class representing a color.
ECPrototypesCoordinateA class representing a GPS coordinate.
ECPrototypesDateA class representing a date.
ECPrototypesFileA class representing a file.
ECPrototypesMimeA class representing a file mime.
ECPrototypesRegexA helper class providing regex tests.
ECPrototypesTimeIntervalA class representing a time interval.
ECPrototypesTimeUnitA enum representing units of time.
ECPrototypesWaitA helper class to synchronously wait a time interval.

Full Documentation

Source Code

If you want to poke around the source code for fun it is all located in the ts directory.

TypeScript Declaration Files

I have completely documented everything. In the table at the top each link on class each names directs to the declaration file for the class on GitHub. By installing with NPM you will also get all my type files.

Import

All the structures are packages on @elijahjcobb/prototypes. Just import it like normal and you can use any structure of the package.

All Together

import ECPrototypes = require("@elijahjcobb/prototypes");
let color: ECPrototypes.ECPrototypesColor;

Separate

import { ECPrototypesColor } from "@elijahjcobb/prototypes";
let color: ECPrototypesColor;

Generics

Yes, literally everything is generic. I wrote this for a huge project and made sure everything I made was generic.

Error Handling

Most classes throw errors when you do something that is a "no-no". This package is using a error handling package of mine called error. Check out the package @elijahjcobb/error for all the documentation. Any errors will be thrown as an instance of an ECErrorStack.

Bugs

If you find any bugs please create an issue on GitHub or if you are old fashioned email me at elijah@elijahcobb.com.