Compare commits
5 Commits
Author | SHA1 | Date | |
---|---|---|---|
dd3fc64dee | |||
45db664a3b | |||
8e79dafb5b | |||
a753df98ec | |||
22aad56954 |
4
.npmignore
Normal file
4
.npmignore
Normal file
@ -0,0 +1,4 @@
|
|||||||
|
coverage/
|
||||||
|
pages/
|
||||||
|
public/
|
||||||
|
node_modules/
|
22
README.md
22
README.md
@ -1,14 +1,30 @@
|
|||||||
# tsclass
|
# tsclass
|
||||||
common classes for TypeScript.
|
common classes for TypeScript.
|
||||||
|
|
||||||
|
## Availabililty
|
||||||
|
[](https://www.npmjs.com/package/tsclass)
|
||||||
|
[](https://gitlab.com/tsclass/tsclass)
|
||||||
|
[](https://github.com/tsclass/tsclass)
|
||||||
|
[](https://tsclass.gitlab.io/tsclass/)
|
||||||
|
|
||||||
|
## Status for master
|
||||||
|
[](https://gitlab.com/tsclass/tsclass/commits/master)
|
||||||
|
[](https://gitlab.com/tsclass/tsclass/commits/master)
|
||||||
|
[](https://david-dm.org/tsclass/tsclass)
|
||||||
|
[](https://www.bithound.io/github/tsclass/tsclass/master/dependencies/npm)
|
||||||
|
[](https://www.bithound.io/github/tsclass/tsclass)
|
||||||
|
[](https://nodejs.org/dist/latest-v6.x/docs/api/)
|
||||||
|
[](https://nodejs.org/dist/latest-v6.x/docs/api/)
|
||||||
|
[](http://standardjs.com/)
|
||||||
|
|
||||||
## Usage
|
## Usage
|
||||||
tsclass exposes many commonly used objects as classes to inherit (-> extends keyword) from for individual implementations.
|
tsclass exposes many commonly used objects as interface to implement (-> extends keyword) by individual implementations.
|
||||||
They come complete with best in class intellisense and are easy to require.
|
They come complete with best in class intellisense and are easy to require.
|
||||||
|
|
||||||
```javascript
|
```javascript
|
||||||
import { TscInvoice } from 'tsclass/dist/invoice'
|
import { IInvoice } from 'tsclass'
|
||||||
|
|
||||||
class myOwnInvoice extends TscInvoice {
|
class myOwnInvoice implements IInvoice {
|
||||||
constructor(){
|
constructor(){
|
||||||
super() // you need to call super() in the constructor
|
super() // you need to call super() in the constructor
|
||||||
}
|
}
|
||||||
|
11
dist/tsclass.article.d.ts → dist/article.d.ts
vendored
11
dist/tsclass.article.d.ts → dist/article.d.ts
vendored
@ -1,5 +1,5 @@
|
|||||||
import { TscAuthor } from './tsclass.author';
|
import { IAuthor } from './author';
|
||||||
export declare class TscArticle {
|
export interface IArticle {
|
||||||
/**
|
/**
|
||||||
* the title of an article
|
* the title of an article
|
||||||
*/
|
*/
|
||||||
@ -7,10 +7,13 @@ export declare class TscArticle {
|
|||||||
/**
|
/**
|
||||||
* the Author of an article
|
* the Author of an article
|
||||||
*/
|
*/
|
||||||
author: TscAuthor;
|
author: IAuthor;
|
||||||
/**
|
/**
|
||||||
* the content of an article
|
* the content of an article
|
||||||
*/
|
*/
|
||||||
content: string;
|
content: string;
|
||||||
tags: any;
|
/**
|
||||||
|
* the tags of an article
|
||||||
|
*/
|
||||||
|
tags: string[];
|
||||||
}
|
}
|
2
dist/article.js
vendored
Normal file
2
dist/article.js
vendored
Normal file
@ -0,0 +1,2 @@
|
|||||||
|
"use strict";
|
||||||
|
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiYXJ0aWNsZS5qcyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbIi4uL3RzL2FydGljbGUudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IiJ9
|
20
dist/author.d.ts
vendored
Normal file
20
dist/author.d.ts
vendored
Normal file
@ -0,0 +1,20 @@
|
|||||||
|
import { IDate } from './date';
|
||||||
|
import { IArticle } from './article';
|
||||||
|
export interface IAuthor {
|
||||||
|
/**
|
||||||
|
* the first name of an author
|
||||||
|
*/
|
||||||
|
firstName: string;
|
||||||
|
/**
|
||||||
|
* the surname of an author
|
||||||
|
*/
|
||||||
|
surName: string;
|
||||||
|
/**
|
||||||
|
* the birthday of an author
|
||||||
|
*/
|
||||||
|
birthday: IDate;
|
||||||
|
/**
|
||||||
|
* articles of an author
|
||||||
|
*/
|
||||||
|
articles: IArticle;
|
||||||
|
}
|
2
dist/author.js
vendored
Normal file
2
dist/author.js
vendored
Normal file
@ -0,0 +1,2 @@
|
|||||||
|
"use strict";
|
||||||
|
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiYXV0aG9yLmpzIiwic291cmNlUm9vdCI6IiIsInNvdXJjZXMiOlsiLi4vdHMvYXV0aG9yLnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiIifQ==
|
3
dist/tsclass.date.d.ts → dist/date.d.ts
vendored
3
dist/tsclass.date.d.ts → dist/date.d.ts
vendored
@ -1,6 +1,5 @@
|
|||||||
export declare class Date {
|
export interface IDate {
|
||||||
day: number;
|
day: number;
|
||||||
month: number;
|
month: number;
|
||||||
year: number;
|
year: number;
|
||||||
constructor();
|
|
||||||
}
|
}
|
2
dist/date.js
vendored
Normal file
2
dist/date.js
vendored
Normal file
@ -0,0 +1,2 @@
|
|||||||
|
"use strict";
|
||||||
|
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiZGF0ZS5qcyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbIi4uL3RzL2RhdGUudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IiJ9
|
7
dist/index.d.ts
vendored
7
dist/index.d.ts
vendored
@ -1,2 +1,5 @@
|
|||||||
export * from "./tsclass.date";
|
export * from './article';
|
||||||
export * from "./tsclass.time";
|
export * from './author';
|
||||||
|
export * from './date';
|
||||||
|
export * from './invoice';
|
||||||
|
export * from './time';
|
||||||
|
5
dist/index.js
vendored
5
dist/index.js
vendored
@ -2,6 +2,5 @@
|
|||||||
function __export(m) {
|
function __export(m) {
|
||||||
for (var p in m) if (!exports.hasOwnProperty(p)) exports[p] = m[p];
|
for (var p in m) if (!exports.hasOwnProperty(p)) exports[p] = m[p];
|
||||||
}
|
}
|
||||||
__export(require("./tsclass.date"));
|
__export(require("./invoice"));
|
||||||
__export(require("./tsclass.time"));
|
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiaW5kZXguanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi90cy9pbmRleC50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiOzs7O0FBR0EsK0JBQXlCIn0=
|
||||||
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiaW5kZXguanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi90cy9pbmRleC50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiOzs7O0FBQUEsb0NBQStCO0FBQy9CLG9DQUErQiJ9
|
|
2
dist/invoice.d.ts
vendored
Normal file
2
dist/invoice.d.ts
vendored
Normal file
@ -0,0 +1,2 @@
|
|||||||
|
export declare class IInvoice {
|
||||||
|
}
|
5
dist/invoice.js
vendored
Normal file
5
dist/invoice.js
vendored
Normal file
@ -0,0 +1,5 @@
|
|||||||
|
"use strict";
|
||||||
|
class IInvoice {
|
||||||
|
}
|
||||||
|
exports.IInvoice = IInvoice;
|
||||||
|
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiaW52b2ljZS5qcyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbIi4uL3RzL2ludm9pY2UudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IjtBQUFBO0NBRUM7QUFGRCw0QkFFQyJ9
|
2
dist/time.d.ts
vendored
Normal file
2
dist/time.d.ts
vendored
Normal file
@ -0,0 +1,2 @@
|
|||||||
|
export interface ITime {
|
||||||
|
}
|
2
dist/time.js
vendored
Normal file
2
dist/time.js
vendored
Normal file
@ -0,0 +1,2 @@
|
|||||||
|
"use strict";
|
||||||
|
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoidGltZS5qcyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbIi4uL3RzL3RpbWUudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IiJ9
|
5
dist/tsclass.article.js
vendored
5
dist/tsclass.article.js
vendored
@ -1,5 +0,0 @@
|
|||||||
"use strict";
|
|
||||||
class TscArticle {
|
|
||||||
}
|
|
||||||
exports.TscArticle = TscArticle;
|
|
||||||
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoidHNjbGFzcy5hcnRpY2xlLmpzIiwic291cmNlUm9vdCI6IiIsInNvdXJjZXMiOlsiLi4vdHMvdHNjbGFzcy5hcnRpY2xlLnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiI7QUFDQTtDQWlCQztBQWpCRCxnQ0FpQkMifQ==
|
|
2
dist/tsclass.author.d.ts
vendored
2
dist/tsclass.author.d.ts
vendored
@ -1,2 +0,0 @@
|
|||||||
export declare class TscAuthor {
|
|
||||||
}
|
|
5
dist/tsclass.author.js
vendored
5
dist/tsclass.author.js
vendored
@ -1,5 +0,0 @@
|
|||||||
"use strict";
|
|
||||||
class TscAuthor {
|
|
||||||
}
|
|
||||||
exports.TscAuthor = TscAuthor;
|
|
||||||
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoidHNjbGFzcy5hdXRob3IuanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi90cy90c2NsYXNzLmF1dGhvci50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiO0FBQUE7Q0FDQztBQURELDhCQUNDIn0=
|
|
7
dist/tsclass.date.js
vendored
7
dist/tsclass.date.js
vendored
@ -1,7 +0,0 @@
|
|||||||
"use strict";
|
|
||||||
class Date {
|
|
||||||
constructor() {
|
|
||||||
}
|
|
||||||
}
|
|
||||||
exports.Date = Date;
|
|
||||||
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoidHNjbGFzcy5kYXRlLmpzIiwic291cmNlUm9vdCI6IiIsInNvdXJjZXMiOlsiLi4vdHMvdHNjbGFzcy5kYXRlLnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiI7QUFBQTtJQUlJO0lBRUEsQ0FBQztDQUNKO0FBUEQsb0JBT0MifQ==
|
|
5
dist/tsclass.time.d.ts
vendored
5
dist/tsclass.time.d.ts
vendored
@ -1,5 +0,0 @@
|
|||||||
export declare class Time {
|
|
||||||
constructor();
|
|
||||||
readonly linuxMilliS: number;
|
|
||||||
readonly linuxS: number;
|
|
||||||
}
|
|
12
dist/tsclass.time.js
vendored
12
dist/tsclass.time.js
vendored
@ -1,12 +0,0 @@
|
|||||||
"use strict";
|
|
||||||
class Time {
|
|
||||||
constructor() { }
|
|
||||||
get linuxMilliS() {
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
get linuxS() {
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
exports.Time = Time;
|
|
||||||
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoidHNjbGFzcy50aW1lLmpzIiwic291cmNlUm9vdCI6IiIsInNvdXJjZXMiOlsiLi4vdHMvdHNjbGFzcy50aW1lLnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiI7QUFBQTtJQUNJLGdCQUFjLENBQUM7SUFDZixJQUFJLFdBQVc7UUFDWCxNQUFNLENBQUMsQ0FBQyxDQUFBO0lBQ1osQ0FBQztJQUVELElBQUksTUFBTTtRQUNOLE1BQU0sQ0FBQyxDQUFDLENBQUE7SUFDWixDQUFDO0NBRUo7QUFWRCxvQkFVQyJ9
|
|
@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "tsclass",
|
"name": "tsclass",
|
||||||
"version": "1.0.1",
|
"version": "1.0.3",
|
||||||
"description": "common classes for TypeScript",
|
"description": "common classes for TypeScript",
|
||||||
"main": "dist/index.js",
|
"main": "dist/index.js",
|
||||||
"typings": "dist/index.d.ts",
|
"typings": "dist/index.d.ts",
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
import { TscAuthor } from './author'
|
import { IAuthor } from './author'
|
||||||
|
|
||||||
export class TscArticle {
|
export interface IArticle {
|
||||||
/**
|
/**
|
||||||
* the title of an article
|
* the title of an article
|
||||||
*/
|
*/
|
||||||
@ -9,7 +9,7 @@ export class TscArticle {
|
|||||||
/**
|
/**
|
||||||
* the Author of an article
|
* the Author of an article
|
||||||
*/
|
*/
|
||||||
author: TscAuthor
|
author: IAuthor
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* the content of an article
|
* the content of an article
|
||||||
|
25
ts/author.ts
25
ts/author.ts
@ -1,2 +1,25 @@
|
|||||||
export class TscAuthor {
|
import { IDate } from './date'
|
||||||
|
import { IArticle } from './article'
|
||||||
|
|
||||||
|
export interface IAuthor {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* the first name of an author
|
||||||
|
*/
|
||||||
|
firstName: string
|
||||||
|
|
||||||
|
/**
|
||||||
|
* the surname of an author
|
||||||
|
*/
|
||||||
|
surName: string
|
||||||
|
|
||||||
|
/**
|
||||||
|
* the birthday of an author
|
||||||
|
*/
|
||||||
|
birthday: IDate
|
||||||
|
|
||||||
|
/**
|
||||||
|
* articles of an author
|
||||||
|
*/
|
||||||
|
articles: IArticle
|
||||||
}
|
}
|
@ -1,8 +1,5 @@
|
|||||||
export class Date {
|
export interface IDate {
|
||||||
day: number
|
day: number
|
||||||
month: number
|
month: number
|
||||||
year: number
|
year: number
|
||||||
constructor(){
|
|
||||||
|
|
||||||
}
|
|
||||||
}
|
}
|
@ -1,2 +1,5 @@
|
|||||||
export * from "./tsclass.date";
|
export * from './article'
|
||||||
export * from "./tsclass.time";
|
export * from './author'
|
||||||
|
export * from './date'
|
||||||
|
export * from './invoice'
|
||||||
|
export * from './time'
|
||||||
|
@ -1,3 +1,3 @@
|
|||||||
export class TscInvoice {
|
export class IInvoice {
|
||||||
|
|
||||||
}
|
}
|
10
ts/time.ts
10
ts/time.ts
@ -1,11 +1,3 @@
|
|||||||
export class Time {
|
export interface ITime {
|
||||||
constructor(){}
|
|
||||||
get linuxMilliS():number {
|
|
||||||
return 0
|
|
||||||
}
|
|
||||||
|
|
||||||
get linuxS():number {
|
|
||||||
return 0
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
}
|
@ -1,8 +0,0 @@
|
|||||||
{
|
|
||||||
"version": false,
|
|
||||||
"dependencies": {},
|
|
||||||
"ambientDependencies": {
|
|
||||||
"colors": "registry:dt/colors#0.6.0-1+20160501135139",
|
|
||||||
"node": "registry:dt/node#4.0.0+20160501135006"
|
|
||||||
}
|
|
||||||
}
|
|
Reference in New Issue
Block a user