update documentation

This commit is contained in:
Philipp Kunz 2024-04-16 18:40:54 +02:00
parent e13236e10f
commit faa173b034
5 changed files with 158 additions and 52 deletions

View File

@ -6,12 +6,30 @@
"gitzone": { "gitzone": {
"projectType": "npm", "projectType": "npm",
"module": { "module": {
"githost": "gitlab.com", "githost": "code.foss.global",
"gitscope": "tsclass", "gitscope": "tsclass",
"gitrepo": "tsclass", "gitrepo": "tsclass",
"description": "common classes for TypeScript", "description": "Provides TypeScript definitions for various business, financial, networking, content, and other common classes.",
"npmPackagename": "@tsclass/tsclass", "npmPackagename": "@tsclass/tsclass",
"license": "MIT" "license": "MIT",
"keywords": [
"TypeScript",
"Classes",
"Interfaces",
"Code Quality",
"Networking",
"Business",
"Finance",
"Content Management",
"Containerization",
"Database",
"Event Management",
"Authentication",
"Web Development"
]
} }
},
"tsdoc": {
"legal": "\n## License and Legal Information\n\nThis repository contains open-source code that is licensed under the MIT License. A copy of the MIT License can be found in the [license](license) file within this repository. \n\n**Please note:** The MIT License does not grant permission to use the trade names, trademarks, service marks, or product names of the project, except as required for reasonable and customary use in describing the origin of the work and reproducing the content of the NOTICE file.\n\n### Trademarks\n\nThis project is owned and maintained by Task Venture Capital GmbH. The names and logos associated with Task Venture Capital GmbH and any related products or services are trademarks of Task Venture Capital GmbH and are not included within the scope of the MIT license granted herein. Use of these trademarks must comply with Task Venture Capital GmbH's Trademark Guidelines, and any usage must be approved in writing by Task Venture Capital GmbH.\n\n### Company Information\n\nTask Venture Capital GmbH \nRegistered at District court Bremen HRB 35230 HB, Germany\n\nFor any legal inquiries or if you require further information, please contact us via email at hello@task.vc.\n\nBy using this repository, you acknowledge that you have read this section, agree to comply with its terms, and understand that the licensing of the code does not imply endorsement by Task Venture Capital GmbH of any derivative works.\n"
} }
} }

View File

@ -2,7 +2,7 @@
"name": "@tsclass/tsclass", "name": "@tsclass/tsclass",
"version": "4.0.52", "version": "4.0.52",
"private": false, "private": false,
"description": "common classes for TypeScript", "description": "Provides TypeScript definitions for various business, financial, networking, content, and other common classes.",
"main": "dist_ts/index.js", "main": "dist_ts/index.js",
"typings": "dist_ts/index.d.ts", "typings": "dist_ts/index.d.ts",
"type": "module", "type": "module",
@ -17,7 +17,18 @@
}, },
"keywords": [ "keywords": [
"TypeScript", "TypeScript",
"Classes" "Classes",
"Interfaces",
"Code Quality",
"Networking",
"Business",
"Finance",
"Content Management",
"Containerization",
"Database",
"Event Management",
"Authentication",
"Web Development"
], ],
"author": "Lossless GmbH", "author": "Lossless GmbH",
"license": "MIT", "license": "MIT",
@ -50,4 +61,4 @@
"browserslist": [ "browserslist": [
"last 1 chrome versions" "last 1 chrome versions"
] ]
} }

1
readme.hints.md Normal file
View File

@ -0,0 +1 @@

164
readme.md
View File

@ -1,68 +1,144 @@
# @tsclass/tsclass # @tsclass/tsclass
common classes for TypeScript common classes for TypeScript
## Availabililty and Links ## Install
* [npmjs.org (npm package)](https://www.npmjs.com/package/@tsclass/tsclass)
* [gitlab.com (source)](https://gitlab.com/tsclass/tsclass)
* [github.com (source mirror)](https://github.com/tsclass/tsclass)
* [docs (typedoc)](https://tsclass.gitlab.io/tsclass/)
## Status for master To install `@tsclass/tsclass`, run the following command in your project directory:
Status Category | Status Badge ```bash
-- | -- npm install @tsclass/tsclass
GitLab Pipelines | [![pipeline status](https://gitlab.com/tsclass/tsclass/badges/master/pipeline.svg)](https://lossless.cloud) ```
GitLab Pipline Test Coverage | [![coverage report](https://gitlab.com/tsclass/tsclass/badges/master/coverage.svg)](https://lossless.cloud)
npm | [![npm downloads per month](https://badgen.net/npm/dy/@tsclass/tsclass)](https://lossless.cloud) This will add `@tsclass/tsclass` to your project's dependencies.
Snyk | [![Known Vulnerabilities](https://badgen.net/snyk/tsclass/tsclass)](https://lossless.cloud)
TypeScript Support | [![TypeScript](https://badgen.net/badge/TypeScript/>=%203.x/blue?icon=typescript)](https://lossless.cloud)
node Support | [![node](https://img.shields.io/badge/node->=%2010.x.x-blue.svg)](https://nodejs.org/dist/latest-v10.x/docs/api/)
Code Style | [![Code Style](https://badgen.net/badge/style/prettier/purple)](https://lossless.cloud)
PackagePhobia (total standalone install weight) | [![PackagePhobia](https://badgen.net/packagephobia/install/@tsclass/tsclass)](https://lossless.cloud)
PackagePhobia (package size on registry) | [![PackagePhobia](https://badgen.net/packagephobia/publish/@tsclass/tsclass)](https://lossless.cloud)
BundlePhobia (total size when bundled) | [![BundlePhobia](https://badgen.net/bundlephobia/minzip/@tsclass/tsclass)](https://lossless.cloud)
Platform support | [![Supports Windows 10](https://badgen.net/badge/supports%20Windows%2010/yes/green?icon=windows)](https://lossless.cloud) [![Supports Mac OS X](https://badgen.net/badge/supports%20Mac%20OS%20X/yes/green?icon=apple)](https://lossless.cloud)
## Usage ## Usage
Use TypeScript for best in class instellisense. `@tsclass/tsclass` offers a comprehensive TypeScript library that provides common classes and interfaces for various domains, including business, finance, content, networking, and more. The package utilizes ESM syntax and is intended for use with TypeScript for optimal developer experience.
tsclass exposes many commonly used objects as interface to implement (-> extends keyword) by individual implementations. ### Getting Started
They come complete with best in class intellisense and are easy to require.
```javascript First, ensure that you are using ES Modules in your TypeScript project by having `"type": "module"` in your `package.json`, and install the package as described above.
import { IInvoice } from 'tsclass';
class myOwnInvoice implements IInvoice { ### Importing Classes and Interfaces
constructor() {
super(); // you need to call super() in the constructor You can import classes and interfaces from `@tsclass/tsclass` as follows:
}
} ```typescript
import { business, finance, content } from '@tsclass/tsclass';
``` ```
### Time/Date ### Business Domain
- Date The business domain includes classes for managing contacts, companies, and projects. Here is how you can work with a company and contact classes:
- Time
### Publications/Websites/Blogs ```typescript
import { business } from '@tsclass/tsclass';
- Article const companyContact: business.IContact = {
- Author type: 'company',
name: 'Example Company',
address: {
streetName: 'Main St',
houseNumber: '123',
postalCode: '12345',
city: 'Example City',
country: 'Exland'
},
description: 'An example company for demonstration purposes.',
email: 'contact@example.com'
};
### Finance const exampleCompany: business.ICompany = {
name: 'Example Company',
foundedDate: {
day: 1,
month: 1,
year: 2020
},
status: 'active',
contact: companyContact
};
```
- Invoice ### Finance Domain
> The modules in bold letters exist as own modules and can be used seperately The finance domain provides interfaces for working with invoices, transactions, and payment information. Heres how you can define an invoice:
## Contribution ```typescript
import { finance } from '@tsclass/tsclass';
We are always happy for code contributions. If you are not the code contributing type that is ok. Still, maintaining Open Source repositories takes considerable time and thought. If you like the quality of what we do and our modules are useful to you we would appreciate a little monthly contribution: You can [contribute one time](https://lossless.link/contribute-onetime) or [contribute monthly](https://lossless.link/contribute). :) const exampleInvoice: finance.IInvoice = {
id: 'INV12345',
billedBy: companyContact,
billedTo: companyContact, // In a real scenario, this should be a different contact.
status: 'draft',
items: [
{
name: 'Product 1',
unitType: 'Item',
unitQuantity: 2,
unitNetPrice: 50,
vatPercentage: 20,
currency: 'EUR'
}
],
dueInDays: 30,
reverseCharge: false
};
```
For further information read the linked docs at the top of this readme. ### Network Domain
> MIT licensed | **©** [Lossless GmbH](https://lossless.gmbh) Networking interfaces, such as those for managing SSH keys or network nodes, are available under the `network` namespace:
| By using this npm module you agree to our [privacy policy](https://lossless.gmbH/privacy)
[![repo-footer](https://lossless.gitlab.io/publicrelations/repofooter.svg)](https://maintainedby.lossless.com) ```typescript
import { network } from '@tsclass/tsclass';
const sshKey: network.ISshKey = {
keyName: 'example-ssh-key',
public: 'ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQD...'
// Private key is typically kept secret and not included in source code
};
```
### Storage Domain
Interfaces for storage management, such as S3 descriptors, can be found under the `storage` namespace:
```typescript
import { storage } from '@tsclass/tsclass';
const s3Descriptor: storage.IS3Descriptor = {
endpoint: 's3.example.com',
accessKey: 'AKIAIOSFODNN7EXAMPLE',
accessSecret: 'wJalrXUtnFEMI/K7MDENG/bPxRfiCYEXAMPLEKEY',
useSsl: true
};
```
### Content and More
`@tsclass/tsclass` also provides classes for the content domain (e.g., articles, authors) and many other utilities across different fields. The examples above only scratch the surface of what `@tsclass/tsclass` offers. Depending on your project's needs, explore other domains and interfaces provided by the library.
Remember, while `@tsclass/tsclass` aims to streamline the TypeScript development process by providing ready-to-use classes and interfaces, it is crucial to adapt these examples to your specific project requirements, ensuring that all aspects, such as security (especially for networking and storage operations), are adequately handled.
For a deeper look into all available classes and interfaces, refer to the TypeScript definitions in the package. This will also give you insight into additional functionalities such as content management, events, authentication, and more detailed use cases within each domain.
## License and Legal Information
This repository contains open-source code that is licensed under the MIT License. A copy of the MIT License can be found in the [license](license) file within this repository.
**Please note:** The MIT License does not grant permission to use the trade names, trademarks, service marks, or product names of the project, except as required for reasonable and customary use in describing the origin of the work and reproducing the content of the NOTICE file.
### Trademarks
This project is owned and maintained by Task Venture Capital GmbH. The names and logos associated with Task Venture Capital GmbH and any related products or services are trademarks of Task Venture Capital GmbH and are not included within the scope of the MIT license granted herein. Use of these trademarks must comply with Task Venture Capital GmbH's Trademark Guidelines, and any usage must be approved in writing by Task Venture Capital GmbH.
### Company Information
Task Venture Capital GmbH
Registered at District court Bremen HRB 35230 HB, Germany
For any legal inquiries or if you require further information, please contact us via email at hello@task.vc.
By using this repository, you acknowledge that you have read this section, agree to comply with its terms, and understand that the licensing of the code does not imply endorsement by Task Venture Capital GmbH of any derivative works.

View File

@ -3,8 +3,8 @@
"experimentalDecorators": true, "experimentalDecorators": true,
"useDefineForClassFields": false, "useDefineForClassFields": false,
"target": "ES2022", "target": "ES2022",
"module": "ES2022", "module": "NodeNext",
"moduleResolution": "nodenext", "moduleResolution": "NodeNext",
"esModuleInterop": true, "esModuleInterop": true,
"verbatimModuleSyntax": true "verbatimModuleSyntax": true
}, },