Compare commits

..

25 Commits

Author SHA1 Message Date
f55ac65e20 1.0.12 2017-06-11 20:57:32 +02:00
474ce92b88 update structure 2017-06-11 20:57:30 +02:00
de95e03699 1.0.11 2017-06-11 20:54:17 +02:00
1e4adeede6 structure + dns record type 2017-06-11 20:54:06 +02:00
ca67505870 1.0.10 2017-06-10 12:48:16 +02:00
18eabb11af update compilation 2017-06-10 12:48:11 +02:00
3572dc6574 1.0.9 2017-06-10 12:46:14 +02:00
0d815f0414 update structure 2017-06-10 12:29:54 +02:00
d6c361750d 1.0.8 2017-03-24 23:23:46 +01:00
d877aed78b add yarn 2017-03-24 23:23:44 +01:00
ac7848a462 1.0.7 2017-03-24 23:20:31 +01:00
76037fba47 clean dependencies 2017-03-16 19:38:32 +01:00
36a7347a3d 1.0.6 2017-03-16 19:37:51 +01:00
d748505b8a add npmextra.json 2017-03-16 19:37:47 +01:00
def1a8add3 1.0.5 2017-03-16 19:34:33 +01:00
1f75449985 update to latest standards 2017-03-16 19:34:27 +01:00
d2380c2192 Merge branch 'master' into 'master'
add ICompany

See merge request !1
2017-03-16 18:31:29 +00:00
1e3fd5830d add ICompany 2017-03-16 14:47:43 +01:00
3d9c7bbec7 1.0.4 2016-11-17 12:06:40 +01:00
884186e429 fix author interface 2016-11-17 12:06:33 +01:00
dd3fc64dee 1.0.3 2016-11-16 22:50:42 +01:00
45db664a3b change to interfaces 2016-11-16 22:50:36 +01:00
8e79dafb5b 1.0.2 2016-11-16 19:52:51 +01:00
a753df98ec improve 2016-11-16 19:52:46 +01:00
22aad56954 improve 2016-11-16 19:52:33 +01:00
43 changed files with 230 additions and 120 deletions

View File

@ -1,4 +1,10 @@
image: hosttoday/ht-docker-node:npmts
# gitzone standard
image: hosttoday/ht-docker-node:npmci
cache:
paths:
- .yarn/
key: "$CI_BUILD_STAGE"
stages:
- test
@ -10,6 +16,7 @@ testLEGACY:
stage: test
script:
- npmci test legacy
coverage: /\d+.?\d+?\%\s*coverage/
tags:
- docker
allow_failure: true
@ -18,6 +25,7 @@ testLTS:
stage: test
script:
- npmci test lts
coverage: /\d+.?\d+?\%\s*coverage/
tags:
- docker
@ -25,6 +33,7 @@ testSTABLE:
stage: test
script:
- npmci test stable
coverage: /\d+.?\d+?\%\s*coverage/
tags:
- docker
@ -47,10 +56,13 @@ trigger:
- docker
pages:
image: hosttoday/ht-docker-node:npmpage
image: hosttoday/ht-docker-node:npmci
stage: pages
script:
- npmci command npmpage --host gitlab
- npmci command yarn global add npmpage
- npmci command npmpage
tags:
- docker
only:
- tags
artifacts:

4
.npmignore Normal file
View File

@ -0,0 +1,4 @@
coverage/
pages/
public/
node_modules/

View File

@ -1,14 +1,33 @@
# tsclass
common classes for TypeScript.
common classes for TypeScript
## Availabililty
[![npm](https://tsclass.gitlab.io/assets/repo-button-npm.svg)](https://www.npmjs.com/package/tsclass)
[![git](https://tsclass.gitlab.io/assets/repo-button-git.svg)](https://GitLab.com/tsclass/tsclass)
[![git](https://tsclass.gitlab.io/assets/repo-button-mirror.svg)](https://github.com/tsclass/tsclass)
[![docs](https://tsclass.gitlab.io/assets/repo-button-docs.svg)](https://tsclass.gitlab.io/tsclass/)
## Status for master
[![build status](https://GitLab.com/tsclass/tsclass/badges/master/build.svg)](https://GitLab.com/tsclass/tsclass/commits/master)
[![coverage report](https://GitLab.com/tsclass/tsclass/badges/master/coverage.svg)](https://GitLab.com/tsclass/tsclass/commits/master)
[![npm downloads per month](https://img.shields.io/npm/dm/tsclass.svg)](https://www.npmjs.com/package/tsclass)
[![Dependency Status](https://david-dm.org/tsclass/tsclass.svg)](https://david-dm.org/tsclass/tsclass)
[![bitHound Dependencies](https://www.bithound.io/github/tsclass/tsclass/badges/dependencies.svg)](https://www.bithound.io/github/tsclass/tsclass/master/dependencies/npm)
[![bitHound Code](https://www.bithound.io/github/tsclass/tsclass/badges/code.svg)](https://www.bithound.io/github/tsclass/tsclass)
[![TypeScript](https://img.shields.io/badge/TypeScript-2.x-blue.svg)](https://nodejs.org/dist/latest-v6.x/docs/api/)
[![node](https://img.shields.io/badge/node->=%206.x.x-blue.svg)](https://nodejs.org/dist/latest-v6.x/docs/api/)
[![JavaScript Style Guide](https://img.shields.io/badge/code%20style-standard-brightgreen.svg)](http://standardjs.com/)
## Usage
tsclass exposes many commonly used objects as classes to inherit (-> extends keyword) from for individual implementations.
Use TypeScript for best in class instellisense.
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.
```javascript
import { TscInvoice } from 'tsclass/dist/invoice'
import { IInvoice } from 'tsclass'
class myOwnInvoice extends TscInvoice {
class myOwnInvoice implements IInvoice {
constructor(){
super() // you need to call super() in the constructor
}
@ -29,3 +48,10 @@ class myOwnInvoice extends TscInvoice {
> The modules in bold letters exist as own modules and can be used seperately
For further information read the linked docs at the top of this README.
> MIT licensed | **©** [Lossless GmbH](https://lossless.gmbh)
| By using this npm module you agree to our [privacy policy](https://lossless.gmbH/privacy.html)
[![repo-footer](https://tsclass.gitlab.io/assets/repo-footer.svg)](https://push.rocks)

14
dist/business/company.d.ts vendored Normal file
View File

@ -0,0 +1,14 @@
import { IDate } from '../index';
/**
* describes a company's lifecycle state
*/
export declare type TCompanyStatus = 'planed' | 'founding' | 'active' | 'liquidation' | 'closed';
/**
* describes a company
*/
export interface ICompany {
name: string;
foundedDate: IDate;
closedDate: IDate;
status: TCompanyStatus;
}

3
dist/business/company.js vendored Normal file
View File

@ -0,0 +1,3 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiY29tcGFueS5qcyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbIi4uLy4uL3RzL2J1c2luZXNzL2NvbXBhbnkudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IiJ9

2
dist/business/invoice.d.ts vendored Normal file
View File

@ -0,0 +1,2 @@
export interface IInvoice {
}

3
dist/business/invoice.js vendored Normal file
View File

@ -0,0 +1,3 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiaW52b2ljZS5qcyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbIi4uLy4uL3RzL2J1c2luZXNzL2ludm9pY2UudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IiJ9

1
dist/cloud/dns.d.ts vendored Normal file
View File

@ -0,0 +1 @@
export declare type TDnsRecord = 'A' | 'AAAA' | 'CNAME' | 'TXT' | 'SRV' | 'LOC' | 'MX' | 'NS' | 'SPF';

3
dist/cloud/dns.js vendored Normal file
View File

@ -0,0 +1,3 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiZG5zLmpzIiwic291cmNlUm9vdCI6IiIsInNvdXJjZXMiOlsiLi4vLi4vdHMvY2xvdWQvZG5zLnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiIifQ==

View File

@ -1,23 +1,19 @@
import { TscAuthor } from './author'
export class TscArticle {
import { IAuthor } from '../index';
export interface IArticle {
/**
* the title of an article
*/
title: string
title: string;
/**
* the Author of an article
*/
author: TscAuthor
author: IAuthor;
/**
* the content of an article
*/
content: string
content: string;
/**
* the tags of an article
*/
tags: string[]
tags: string[];
}

3
dist/content/article.js vendored Normal file
View File

@ -0,0 +1,3 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiYXJ0aWNsZS5qcyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbIi4uLy4uL3RzL2NvbnRlbnQvYXJ0aWNsZS50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiIn0=

20
dist/content/author.d.ts vendored Normal file
View File

@ -0,0 +1,20 @@
import { IDate } from '../index';
import { IArticle } from '../index';
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[];
}

3
dist/content/author.js vendored Normal file
View File

@ -0,0 +1,3 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiYXV0aG9yLmpzIiwic291cmNlUm9vdCI6IiIsInNvdXJjZXMiOlsiLi4vLi4vdHMvY29udGVudC9hdXRob3IudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IiJ9

View File

@ -1,6 +1,5 @@
export declare class Date {
export interface IDate {
day: number;
month: number;
year: number;
constructor();
}

3
dist/general/date.js vendored Normal file
View File

@ -0,0 +1,3 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiZGF0ZS5qcyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbIi4uLy4uL3RzL2dlbmVyYWwvZGF0ZS50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiIn0=

2
dist/general/time.d.ts vendored Normal file
View File

@ -0,0 +1,2 @@
export interface ITime {
}

3
dist/general/time.js vendored Normal file
View File

@ -0,0 +1,3 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoidGltZS5qcyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbIi4uLy4uL3RzL2dlbmVyYWwvdGltZS50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiIn0=

9
dist/index.d.ts vendored
View File

@ -1,2 +1,7 @@
export * from "./tsclass.date";
export * from "./tsclass.time";
export * from './business/company';
export * from './business/invoice';
export * from './cloud/dns';
export * from './content/article';
export * from './content/author';
export * from './general/date';
export * from './general/time';

8
dist/index.js vendored
View File

@ -1,7 +1,3 @@
"use strict";
function __export(m) {
for (var p in m) if (!exports.hasOwnProperty(p)) exports[p] = m[p];
}
__export(require("./tsclass.date"));
__export(require("./tsclass.time"));
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiaW5kZXguanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi90cy9pbmRleC50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiOzs7O0FBQUEsb0NBQStCO0FBQy9CLG9DQUErQiJ9
Object.defineProperty(exports, "__esModule", { value: true });
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiaW5kZXguanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi90cy9pbmRleC50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiIn0=

View File

@ -1,16 +0,0 @@
import { TscAuthor } from './tsclass.author';
export declare class TscArticle {
/**
* the title of an article
*/
title: string;
/**
* the Author of an article
*/
author: TscAuthor;
/**
* the content of an article
*/
content: string;
tags: any;
}

View File

@ -1,5 +0,0 @@
"use strict";
class TscArticle {
}
exports.TscArticle = TscArticle;
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoidHNjbGFzcy5hcnRpY2xlLmpzIiwic291cmNlUm9vdCI6IiIsInNvdXJjZXMiOlsiLi4vdHMvdHNjbGFzcy5hcnRpY2xlLnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiI7QUFDQTtDQWlCQztBQWpCRCxnQ0FpQkMifQ==

View File

@ -1,2 +0,0 @@
export declare class TscAuthor {
}

View File

@ -1,5 +0,0 @@
"use strict";
class TscAuthor {
}
exports.TscAuthor = TscAuthor;
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoidHNjbGFzcy5hdXRob3IuanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi90cy90c2NsYXNzLmF1dGhvci50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiO0FBQUE7Q0FDQztBQURELDhCQUNDIn0=

View File

@ -1,7 +0,0 @@
"use strict";
class Date {
constructor() {
}
}
exports.Date = Date;
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoidHNjbGFzcy5kYXRlLmpzIiwic291cmNlUm9vdCI6IiIsInNvdXJjZXMiOlsiLi4vdHMvdHNjbGFzcy5kYXRlLnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiI7QUFBQTtJQUlJO0lBRUEsQ0FBQztDQUNKO0FBUEQsb0JBT0MifQ==

View File

@ -1,5 +0,0 @@
export declare class Time {
constructor();
readonly linuxMilliS: number;
readonly linuxS: number;
}

12
dist/tsclass.time.js vendored
View File

@ -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

0
docs/index.md Normal file
View File

7
npmextra.json Normal file
View File

@ -0,0 +1,7 @@
{
"npmci": {
"globalNpmTools": [
"npmts"
]
}
}

View File

@ -1,11 +1,11 @@
{
"name": "tsclass",
"version": "1.0.1",
"version": "1.0.12",
"description": "common classes for TypeScript",
"main": "dist/index.js",
"typings": "dist/index.d.ts",
"scripts": {
"test": "(npmts)"
"test": "(npmts --notest)"
},
"repository": {
"type": "git",
@ -20,8 +20,5 @@
"bugs": {
"url": "https://github.com/tsclass/tsclass/issues"
},
"homepage": "https://github.com/tsclass/tsclass#readme",
"devDependencies": {
"npmts": "^5.1.5"
}
"homepage": "https://github.com/tsclass/tsclass#readme"
}

View File

@ -1,2 +0,0 @@
export class TscAuthor {
}

16
ts/business/company.ts Normal file
View File

@ -0,0 +1,16 @@
import { IDate } from '../index'
/**
* describes a company's lifecycle state
*/
export type TCompanyStatus = 'planed' | 'founding' | 'active' | 'liquidation' | 'closed'
/**
* describes a company
*/
export interface ICompany {
name: string
foundedDate: IDate
closedDate: IDate
status: TCompanyStatus
}

3
ts/business/invoice.ts Normal file
View File

@ -0,0 +1,3 @@
export interface IInvoice {
}

1
ts/cloud/dns.ts Normal file
View File

@ -0,0 +1 @@
export type TDnsRecord = 'A' | 'AAAA' | 'CNAME' | 'TXT' | 'SRV' | 'LOC' | 'MX' | 'NS' | 'SPF'

23
ts/content/article.ts Normal file
View File

@ -0,0 +1,23 @@
import { IAuthor } from '../index'
export interface IArticle {
/**
* the title of an article
*/
title: string
/**
* the Author of an article
*/
author: IAuthor
/**
* the content of an article
*/
content: string
/**
* the tags of an article
*/
tags: string[]
}

25
ts/content/author.ts Normal file
View File

@ -0,0 +1,25 @@
import { IDate } from '../index'
import { IArticle } from '../index'
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[]
}

View File

@ -1,8 +0,0 @@
export class Date {
day: number
month: number
year: number
constructor(){
}
}

5
ts/general/date.ts Normal file
View File

@ -0,0 +1,5 @@
export interface IDate {
day: number
month: number
year: number
}

3
ts/general/time.ts Normal file
View File

@ -0,0 +1,3 @@
export interface ITime {
}

View File

@ -1,2 +1,14 @@
export * from "./tsclass.date";
export * from "./tsclass.time";
// Business
export * from './business/company'
export * from './business/invoice'
// Cloud
export * from './cloud/dns'
// Content
export * from './content/article'
export * from './content/author'
// General
export * from './general/date'
export * from './general/time'

View File

@ -1,3 +0,0 @@
export class TscInvoice {
}

View File

@ -1,11 +0,0 @@
export class Time {
constructor(){}
get linuxMilliS():number {
return 0
}
get linuxS():number {
return 0
}
}

View File

@ -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"
}
}

4
yarn.lock Normal file
View File

@ -0,0 +1,4 @@
# THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY.
# yarn lockfile v1