Compare commits
49 Commits
Author | SHA1 | Date | |
---|---|---|---|
a8ee64eb54 | |||
f75d0f9378 | |||
e9293ec31e | |||
b04155e4f1 | |||
bc8534d382 | |||
a2a1d61671 | |||
a580ba53dd | |||
e194e2a3b6 | |||
0c2ded6288 | |||
6742e3ca73 | |||
e2deb4f7b3 | |||
0d48aa8b00 | |||
bfc646c308 | |||
ab008d16e8 | |||
7f5b86864d | |||
825148442b | |||
2a18ec1555 | |||
c5284ff813 | |||
498934237d | |||
ac73badd76 | |||
90698230ae | |||
04f37d5665 | |||
0f26791ee2 | |||
34e65462e2 | |||
f55ac65e20 | |||
474ce92b88 | |||
de95e03699 | |||
1e4adeede6 | |||
ca67505870 | |||
18eabb11af | |||
3572dc6574 | |||
0d815f0414 | |||
d6c361750d | |||
d877aed78b | |||
ac7848a462 | |||
76037fba47 | |||
36a7347a3d | |||
d748505b8a | |||
def1a8add3 | |||
1f75449985 | |||
d2380c2192 | |||
1e3fd5830d | |||
3d9c7bbec7 | |||
884186e429 | |||
dd3fc64dee | |||
45db664a3b | |||
8e79dafb5b | |||
a753df98ec | |||
22aad56954 |
121
.gitlab-ci.yml
121
.gitlab-ci.yml
@ -1,59 +1,142 @@
|
||||
image: hosttoday/ht-docker-node:npmts
|
||||
# gitzone standard
|
||||
image: hosttoday/ht-docker-node:npmci
|
||||
|
||||
cache:
|
||||
paths:
|
||||
- .npmci_cache/
|
||||
key: "$CI_BUILD_STAGE"
|
||||
|
||||
stages:
|
||||
- security
|
||||
- test
|
||||
- release
|
||||
- trigger
|
||||
- pages
|
||||
- metadata
|
||||
|
||||
# ====================
|
||||
# security stage
|
||||
# ====================
|
||||
mirror:
|
||||
stage: security
|
||||
script:
|
||||
- npmci git mirror
|
||||
tags:
|
||||
- docker
|
||||
- notpriv
|
||||
|
||||
snyk:
|
||||
stage: security
|
||||
script:
|
||||
- npmci command npm install -g snyk
|
||||
- npmci command npm install --ignore-scripts
|
||||
- npmci command snyk test
|
||||
tags:
|
||||
- docker
|
||||
- notpriv
|
||||
|
||||
# ====================
|
||||
# test stage
|
||||
# ====================
|
||||
testLEGACY:
|
||||
stage: test
|
||||
script:
|
||||
- npmci test legacy
|
||||
- npmci node install legacy
|
||||
- npmci npm install
|
||||
- npmci npm test
|
||||
coverage: /\d+.?\d+?\%\s*coverage/
|
||||
tags:
|
||||
- docker
|
||||
- docker
|
||||
- notpriv
|
||||
allow_failure: true
|
||||
|
||||
testLTS:
|
||||
stage: test
|
||||
script:
|
||||
- npmci test lts
|
||||
- npmci node install lts
|
||||
- npmci npm install
|
||||
- npmci npm test
|
||||
coverage: /\d+.?\d+?\%\s*coverage/
|
||||
tags:
|
||||
- docker
|
||||
- docker
|
||||
- notpriv
|
||||
|
||||
testSTABLE:
|
||||
stage: test
|
||||
script:
|
||||
- npmci test stable
|
||||
- npmci node install stable
|
||||
- npmci npm install
|
||||
- npmci npm test
|
||||
coverage: /\d+.?\d+?\%\s*coverage/
|
||||
tags:
|
||||
- docker
|
||||
- docker
|
||||
- notpriv
|
||||
|
||||
release:
|
||||
stage: release
|
||||
script:
|
||||
- npmci publish
|
||||
- npmci node install stable
|
||||
- npmci npm publish
|
||||
only:
|
||||
- tags
|
||||
- tags
|
||||
tags:
|
||||
- docker
|
||||
- docker
|
||||
- notpriv
|
||||
|
||||
# ====================
|
||||
# metadata stage
|
||||
# ====================
|
||||
codequality:
|
||||
stage: metadata
|
||||
image: docker:stable
|
||||
allow_failure: true
|
||||
services:
|
||||
- docker:stable-dind
|
||||
script:
|
||||
- export SP_VERSION=$(echo "$CI_SERVER_VERSION" | sed 's/^\([0-9]*\)\.\([0-9]*\).*/\1-\2-stable/')
|
||||
- docker run
|
||||
--env SOURCE_CODE="$PWD"
|
||||
--volume "$PWD":/code
|
||||
--volume /var/run/docker.sock:/var/run/docker.sock
|
||||
"registry.gitlab.com/gitlab-org/security-products/codequality:$SP_VERSION" /code
|
||||
artifacts:
|
||||
paths: [codeclimate.json]
|
||||
tags:
|
||||
- docker
|
||||
- priv
|
||||
|
||||
trigger:
|
||||
stage: trigger
|
||||
stage: metadata
|
||||
script:
|
||||
- npmci trigger
|
||||
- npmci trigger
|
||||
only:
|
||||
- tags
|
||||
- tags
|
||||
tags:
|
||||
- docker
|
||||
- docker
|
||||
- notpriv
|
||||
|
||||
pages:
|
||||
image: hosttoday/ht-docker-node:npmpage
|
||||
stage: pages
|
||||
image: hosttoday/ht-docker-node:npmci
|
||||
stage: metadata
|
||||
script:
|
||||
- npmci command npmpage --host gitlab
|
||||
- npmci command npm install -g npmpage
|
||||
- npmci command npmpage
|
||||
tags:
|
||||
- docker
|
||||
- notpriv
|
||||
only:
|
||||
- tags
|
||||
artifacts:
|
||||
expire_in: 1 week
|
||||
paths:
|
||||
- public
|
||||
allow_failure: true
|
||||
|
||||
windowsCompatibility:
|
||||
image: stefanscherer/node-windows:10-build-tools
|
||||
stage: metadata
|
||||
script:
|
||||
- npmci npm install
|
||||
- npmci npm test
|
||||
coverage: /\d+.?\d+?\%\s*coverage/
|
||||
tags:
|
||||
- windows
|
||||
allow_failure: true
|
||||
|
4
.npmignore
Normal file
4
.npmignore
Normal file
@ -0,0 +1,4 @@
|
||||
coverage/
|
||||
pages/
|
||||
public/
|
||||
node_modules/
|
57
README.md
57
README.md
@ -1,31 +1,62 @@
|
||||
# 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://www.npmjs.com/package/tsclass)
|
||||
[](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
|
||||
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 {
|
||||
constructor(){
|
||||
super() // you need to call super() in the constructor
|
||||
}
|
||||
class myOwnInvoice implements IInvoice {
|
||||
constructor() {
|
||||
super(); // you need to call super() in the constructor
|
||||
}
|
||||
}
|
||||
|
||||
```
|
||||
|
||||
### Time/Date
|
||||
* Date
|
||||
* Time
|
||||
|
||||
- Date
|
||||
- Time
|
||||
|
||||
### Publications/Websites/Blogs
|
||||
* Article
|
||||
* Author
|
||||
|
||||
- Article
|
||||
- Author
|
||||
|
||||
### Finance
|
||||
* Invoice
|
||||
|
||||
- Invoice
|
||||
|
||||
> 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)
|
||||
|
||||
[](https://push.rocks)
|
||||
|
2
dist/index.d.ts
vendored
2
dist/index.d.ts
vendored
@ -1,2 +0,0 @@
|
||||
export * from "./tsclass.date";
|
||||
export * from "./tsclass.time";
|
7
dist/index.js
vendored
7
dist/index.js
vendored
@ -1,7 +0,0 @@
|
||||
"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
|
16
dist/tsclass.article.d.ts
vendored
16
dist/tsclass.article.d.ts
vendored
@ -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;
|
||||
}
|
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=
|
6
dist/tsclass.date.d.ts
vendored
6
dist/tsclass.date.d.ts
vendored
@ -1,6 +0,0 @@
|
||||
export declare class Date {
|
||||
day: number;
|
||||
month: number;
|
||||
year: number;
|
||||
constructor();
|
||||
}
|
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
|
0
docs/index.md
Normal file
0
docs/index.md
Normal file
8
npmextra.json
Normal file
8
npmextra.json
Normal file
@ -0,0 +1,8 @@
|
||||
{
|
||||
"npmci": {
|
||||
"npmGlobalTools": [
|
||||
"npmts"
|
||||
],
|
||||
"npmAccessLevel": "public"
|
||||
}
|
||||
}
|
108
package-lock.json
generated
Normal file
108
package-lock.json
generated
Normal file
@ -0,0 +1,108 @@
|
||||
{
|
||||
"name": "@tsclass/tsclass",
|
||||
"version": "1.0.24",
|
||||
"lockfileVersion": 1,
|
||||
"requires": true,
|
||||
"dependencies": {
|
||||
"@gitzone/tsrun": {
|
||||
"version": "1.0.5",
|
||||
"resolved": "https://registry.npmjs.org/@gitzone/tsrun/-/tsrun-1.0.5.tgz",
|
||||
"integrity": "sha512-zSiRnlvNAlBmrqknwH9B0gIRx7IEegPzmN+DZ4yN3f+L62WlVbKyPLeeV09SKE8BFiGo+0VIGiQW3EV/9mXMfw==",
|
||||
"dev": true,
|
||||
"requires": {
|
||||
"ts-node": "^6.1.0",
|
||||
"typescript": "^2.9.1"
|
||||
}
|
||||
},
|
||||
"arrify": {
|
||||
"version": "1.0.1",
|
||||
"resolved": "https://registry.npmjs.org/arrify/-/arrify-1.0.1.tgz",
|
||||
"integrity": "sha1-iYUI2iIm84DfkEcoRWhJwVAaSw0=",
|
||||
"dev": true
|
||||
},
|
||||
"buffer-from": {
|
||||
"version": "1.1.0",
|
||||
"resolved": "https://registry.npmjs.org/buffer-from/-/buffer-from-1.1.0.tgz",
|
||||
"integrity": "sha512-c5mRlguI/Pe2dSZmpER62rSCu0ryKmWddzRYsuXc50U2/g8jMOulc31VZMa4mYx31U5xsmSOpDCgH88Vl9cDGQ==",
|
||||
"dev": true
|
||||
},
|
||||
"diff": {
|
||||
"version": "3.5.0",
|
||||
"resolved": "https://registry.npmjs.org/diff/-/diff-3.5.0.tgz",
|
||||
"integrity": "sha512-A46qtFgd+g7pDZinpnwiRJtxbC1hpgf0uzP3iG89scHk0AUC7A1TGxf5OiiOUv/JMZR8GOt8hL900hV0bOy5xA==",
|
||||
"dev": true
|
||||
},
|
||||
"make-error": {
|
||||
"version": "1.3.4",
|
||||
"resolved": "https://registry.npmjs.org/make-error/-/make-error-1.3.4.tgz",
|
||||
"integrity": "sha512-0Dab5btKVPhibSalc9QGXb559ED7G7iLjFXBaj9Wq8O3vorueR5K5jaE3hkG6ZQINyhA/JgG6Qk4qdFQjsYV6g==",
|
||||
"dev": true
|
||||
},
|
||||
"minimist": {
|
||||
"version": "1.2.0",
|
||||
"resolved": "https://registry.npmjs.org/minimist/-/minimist-1.2.0.tgz",
|
||||
"integrity": "sha1-o1AIsg9BOD7sH7kU9M1d95omQoQ=",
|
||||
"dev": true
|
||||
},
|
||||
"mkdirp": {
|
||||
"version": "0.5.1",
|
||||
"resolved": "https://registry.npmjs.org/mkdirp/-/mkdirp-0.5.1.tgz",
|
||||
"integrity": "sha1-MAV0OOrGz3+MR2fzhkjWaX11yQM=",
|
||||
"dev": true,
|
||||
"requires": {
|
||||
"minimist": "0.0.8"
|
||||
},
|
||||
"dependencies": {
|
||||
"minimist": {
|
||||
"version": "0.0.8",
|
||||
"resolved": "https://registry.npmjs.org/minimist/-/minimist-0.0.8.tgz",
|
||||
"integrity": "sha1-hX/Kv8M5fSYluCKCYuhqp6ARsF0=",
|
||||
"dev": true
|
||||
}
|
||||
}
|
||||
},
|
||||
"source-map": {
|
||||
"version": "0.6.1",
|
||||
"resolved": "https://registry.npmjs.org/source-map/-/source-map-0.6.1.tgz",
|
||||
"integrity": "sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g==",
|
||||
"dev": true
|
||||
},
|
||||
"source-map-support": {
|
||||
"version": "0.5.6",
|
||||
"resolved": "https://registry.npmjs.org/source-map-support/-/source-map-support-0.5.6.tgz",
|
||||
"integrity": "sha512-N4KXEz7jcKqPf2b2vZF11lQIz9W5ZMuUcIOGj243lduidkf2fjkVKJS9vNxVWn3u/uxX38AcE8U9nnH9FPcq+g==",
|
||||
"dev": true,
|
||||
"requires": {
|
||||
"buffer-from": "^1.0.0",
|
||||
"source-map": "^0.6.0"
|
||||
}
|
||||
},
|
||||
"ts-node": {
|
||||
"version": "6.1.1",
|
||||
"resolved": "https://registry.npmjs.org/ts-node/-/ts-node-6.1.1.tgz",
|
||||
"integrity": "sha512-79FnymLGDBd/nXoiak1L6w6fd9Zz9Ge/x8/Aglaeh31KkqRLDzbfT1vBGlO5dqc76WzufTlW4IYl7e01CVUF5A==",
|
||||
"dev": true,
|
||||
"requires": {
|
||||
"arrify": "^1.0.0",
|
||||
"diff": "^3.1.0",
|
||||
"make-error": "^1.1.1",
|
||||
"minimist": "^1.2.0",
|
||||
"mkdirp": "^0.5.1",
|
||||
"source-map-support": "^0.5.6",
|
||||
"yn": "^2.0.0"
|
||||
}
|
||||
},
|
||||
"typescript": {
|
||||
"version": "2.9.2",
|
||||
"resolved": "https://registry.npmjs.org/typescript/-/typescript-2.9.2.tgz",
|
||||
"integrity": "sha512-Gr4p6nFNaoufRIY4NMdpQRNmgxVIGMs4Fcu/ujdYk3nAZqk7supzBE9idmvfZIlH/Cuj//dvi+019qEue9lV0w==",
|
||||
"dev": true
|
||||
},
|
||||
"yn": {
|
||||
"version": "2.0.0",
|
||||
"resolved": "https://registry.npmjs.org/yn/-/yn-2.0.0.tgz",
|
||||
"integrity": "sha1-5a2ryKz0CPY4X8dklWhMiOavaJo=",
|
||||
"dev": true
|
||||
}
|
||||
}
|
||||
}
|
11
package.json
11
package.json
@ -1,11 +1,13 @@
|
||||
{
|
||||
"name": "tsclass",
|
||||
"version": "1.0.1",
|
||||
"name": "@tsclass/tsclass",
|
||||
"version": "1.0.24",
|
||||
"private": false,
|
||||
"description": "common classes for TypeScript",
|
||||
"main": "dist/index.js",
|
||||
"typings": "dist/index.d.ts",
|
||||
"scripts": {
|
||||
"test": "(npmts)"
|
||||
"test": "tsrun test/test.ts",
|
||||
"build": "npmts --notest"
|
||||
},
|
||||
"repository": {
|
||||
"type": "git",
|
||||
@ -21,7 +23,8 @@
|
||||
"url": "https://github.com/tsclass/tsclass/issues"
|
||||
},
|
||||
"homepage": "https://github.com/tsclass/tsclass#readme",
|
||||
"dependencies": {},
|
||||
"devDependencies": {
|
||||
"npmts": "^5.1.5"
|
||||
"@gitzone/tsrun": "^1.0.5"
|
||||
}
|
||||
}
|
||||
|
3
test/test.ts
Normal file
3
test/test.ts
Normal file
@ -0,0 +1,3 @@
|
||||
import * as tsclass from '../ts/index';
|
||||
|
||||
let contact: tsclass.IContact;
|
@ -1,23 +0,0 @@
|
||||
import { TscAuthor } from './author'
|
||||
|
||||
export class TscArticle {
|
||||
/**
|
||||
* the title of an article
|
||||
*/
|
||||
title: string
|
||||
|
||||
/**
|
||||
* the Author of an article
|
||||
*/
|
||||
author: TscAuthor
|
||||
|
||||
/**
|
||||
* the content of an article
|
||||
*/
|
||||
content: string
|
||||
|
||||
/**
|
||||
* the tags of an article
|
||||
*/
|
||||
tags: string[]
|
||||
}
|
@ -1,2 +0,0 @@
|
||||
export class TscAuthor {
|
||||
}
|
8
ts/business/address.ts
Normal file
8
ts/business/address.ts
Normal file
@ -0,0 +1,8 @@
|
||||
export interface IAddress {
|
||||
name?: string;
|
||||
streetName: string;
|
||||
houseNumber: string;
|
||||
postalCode: string;
|
||||
city: string;
|
||||
country: string;
|
||||
}
|
17
ts/business/company.ts
Normal file
17
ts/business/company.ts
Normal file
@ -0,0 +1,17 @@
|
||||
import { IContact } from '../index';
|
||||
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;
|
||||
}
|
26
ts/business/contact.ts
Normal file
26
ts/business/contact.ts
Normal file
@ -0,0 +1,26 @@
|
||||
import { IAddress } from '../index';
|
||||
|
||||
export type TContactSalutation = 'Mr' | 'Ms' | 'Mrs';
|
||||
|
||||
export type TContactType = 'person' | 'company';
|
||||
|
||||
export type TContactTitle = 'Doctor' | 'Professor';
|
||||
|
||||
export interface IContact {
|
||||
// =======
|
||||
// general
|
||||
// =======
|
||||
salutation?: TContactSalutation;
|
||||
type: TContactType;
|
||||
title: TContactTitle;
|
||||
name: string;
|
||||
surname?: string;
|
||||
legalEntity?: string;
|
||||
address: IAddress;
|
||||
|
||||
// =========
|
||||
// financial
|
||||
// =========
|
||||
vatId?: string;
|
||||
bankAccountNumber?: string;
|
||||
}
|
17
ts/business/invoice.ts
Normal file
17
ts/business/invoice.ts
Normal file
@ -0,0 +1,17 @@
|
||||
import { IContact } from '../index';
|
||||
|
||||
export type TInvoiceStatus = 'draft' | 'invoice' | 'paid' | 'refunded';
|
||||
|
||||
export interface IInvoiceItem {
|
||||
name: string;
|
||||
unitType: string;
|
||||
quantity: number;
|
||||
vatPercentage: number;
|
||||
}
|
||||
|
||||
export interface IInvoice {
|
||||
billedBy: IContact;
|
||||
billedTo: IContact;
|
||||
status: TInvoiceStatus;
|
||||
items: IInvoiceItem[];
|
||||
}
|
1
ts/cloud/dns.ts
Normal file
1
ts/cloud/dns.ts
Normal file
@ -0,0 +1 @@
|
||||
export type TDnsRecord = 'A' | 'AAAA' | 'CNAME' | 'TXT' | 'SRV' | 'LOC' | 'MX' | 'NS' | 'SPF';
|
23
ts/content/article.ts
Normal file
23
ts/content/article.ts
Normal 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[];
|
||||
}
|
24
ts/content/author.ts
Normal file
24
ts/content/author.ts
Normal file
@ -0,0 +1,24 @@
|
||||
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[];
|
||||
}
|
@ -1,8 +0,0 @@
|
||||
export class Date {
|
||||
day: number
|
||||
month: number
|
||||
year: number
|
||||
constructor(){
|
||||
|
||||
}
|
||||
}
|
5
ts/general/date.ts
Normal file
5
ts/general/date.ts
Normal file
@ -0,0 +1,5 @@
|
||||
export interface IDate {
|
||||
day: number;
|
||||
month: number;
|
||||
year: number;
|
||||
}
|
1
ts/general/time.ts
Normal file
1
ts/general/time.ts
Normal file
@ -0,0 +1 @@
|
||||
export interface ITime {}
|
18
ts/index.ts
18
ts/index.ts
@ -1,2 +1,16 @@
|
||||
export * from "./tsclass.date";
|
||||
export * from "./tsclass.time";
|
||||
// Business
|
||||
export * from './business/address';
|
||||
export * from './business/company';
|
||||
export * from './business/contact';
|
||||
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';
|
||||
|
@ -1,3 +0,0 @@
|
||||
export class TscInvoice {
|
||||
|
||||
}
|
11
ts/time.ts
11
ts/time.ts
@ -1,11 +0,0 @@
|
||||
export class Time {
|
||||
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