Adding Comments
Adding Possiblity to generate a Documentation Signed-off-by: Martin Karkowski <m.karkowski@dozema.local>
This commit is contained in:
parent
510eb7fdfa
commit
27e5f5569b
2
.gitignore
vendored
2
.gitignore
vendored
@ -104,3 +104,5 @@ temp
|
|||||||
# TernJS port file
|
# TernJS port file
|
||||||
.tern-port
|
.tern-port
|
||||||
config/
|
config/
|
||||||
|
|
||||||
|
docs
|
17
jsdoc.json
Normal file
17
jsdoc.json
Normal file
@ -0,0 +1,17 @@
|
|||||||
|
{
|
||||||
|
"tags": {
|
||||||
|
"allowUnknownTags": [
|
||||||
|
"optional"
|
||||||
|
]
|
||||||
|
},
|
||||||
|
"plugins": [
|
||||||
|
"node_modules/better-docs/typescript"
|
||||||
|
],
|
||||||
|
"source": {
|
||||||
|
"includePattern": "\\.(ts|tsx)$"
|
||||||
|
},
|
||||||
|
"opts": {
|
||||||
|
"destination": "./docs/",
|
||||||
|
"recurse": true
|
||||||
|
}
|
||||||
|
}
|
@ -3,6 +3,17 @@ import { nopeDispatcher } from "../dispatcher/nopeDispatcher";
|
|||||||
|
|
||||||
export type pipe<T, K> = (scope: { [index: string]: any }, observable: Observable<T>) => Observable<K>
|
export type pipe<T, K> = (scope: { [index: string]: any }, observable: Observable<T>) => Observable<K>
|
||||||
|
|
||||||
|
/**
|
||||||
|
* A Remote Observable.
|
||||||
|
* This function acts a wrapper to access a Remote-Observable.
|
||||||
|
* The wrapper can be used to manipulate the item.
|
||||||
|
*
|
||||||
|
* @export
|
||||||
|
* @class nopeRemoteObservable
|
||||||
|
* @template T
|
||||||
|
* @template S
|
||||||
|
* @template G
|
||||||
|
*/
|
||||||
export class nopeRemoteObservable<T, S = T, G = T> {
|
export class nopeRemoteObservable<T, S = T, G = T> {
|
||||||
protected _pathes: {
|
protected _pathes: {
|
||||||
get: string,
|
get: string,
|
||||||
@ -29,14 +40,33 @@ export class nopeRemoteObservable<T, S = T, G = T> {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Currently used remote Value.
|
||||||
|
*
|
||||||
|
* @readonly
|
||||||
|
* @memberof nopeRemoteObservable
|
||||||
|
*/
|
||||||
public get currentRemoteValue() {
|
public get currentRemoteValue() {
|
||||||
return this.getRemoteValue()
|
return this.getRemoteValue()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Manually Funciton for getting the Remote Value.
|
||||||
|
*
|
||||||
|
* @return {*}
|
||||||
|
* @memberof nopeRemoteObservable
|
||||||
|
*/
|
||||||
public async getRemoteValue() {
|
public async getRemoteValue() {
|
||||||
return await this._dispatcher.performCall<G>(this._pathes.get, [])
|
return await this._dispatcher.performCall<G>(this._pathes.get, [])
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Updates the Remote Value. (This will although trigger a Subscription update)
|
||||||
|
*
|
||||||
|
* @param {S} value The Value to use
|
||||||
|
* @return {*} Function doesnt return something
|
||||||
|
* @memberof nopeRemoteObservable
|
||||||
|
*/
|
||||||
public async setRemoteValue(value: S) {
|
public async setRemoteValue(value: S) {
|
||||||
// Perform an Update.
|
// Perform an Update.
|
||||||
return await this._dispatcher.performCall<void>(this._pathes.set, [value]);
|
return await this._dispatcher.performCall<void>(this._pathes.set, [value]);
|
||||||
@ -44,8 +74,15 @@ export class nopeRemoteObservable<T, S = T, G = T> {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Function to Subscribe a NopeObservable on a Remote.
|
* Function to Subscribe a NopeObservable on a Remote.
|
||||||
* @param next the callback, which will be called on new Data.
|
*
|
||||||
* @param options
|
* @template K
|
||||||
|
* @param {(data: K) => void} next the callback, which will be called on new Data.
|
||||||
|
* @param {{
|
||||||
|
* scope?: { [index: string]: any },
|
||||||
|
* pipe?: pipe<G, K>
|
||||||
|
* }} [options={}] Options to enhance the Subscription. You can provide a Pipe. This pipe will be executed on the remote to reduce networktraffic.
|
||||||
|
* @return {*}
|
||||||
|
* @memberof nopeRemoteObservable
|
||||||
*/
|
*/
|
||||||
public async subscribe<K>(next: (data: K) => void, options: {
|
public async subscribe<K>(next: (data: K) => void, options: {
|
||||||
scope?: { [index: string]: any },
|
scope?: { [index: string]: any },
|
||||||
|
791
package-lock.json
generated
791
package-lock.json
generated
File diff suppressed because it is too large
Load Diff
@ -7,6 +7,7 @@
|
|||||||
"test": "echo \"Error: no test specified\" && exit 1",
|
"test": "echo \"Error: no test specified\" && exit 1",
|
||||||
"generate-frontend-interfaces": "openapi --input http://localhost:3000/api/api-docs --output ./pages/interfaces",
|
"generate-frontend-interfaces": "openapi --input http://localhost:3000/api/api-docs --output ./pages/interfaces",
|
||||||
"compile-backend": "tsc -p ./tsconfigBackend.json",
|
"compile-backend": "tsc -p ./tsconfigBackend.json",
|
||||||
|
"doc": "npx jsdoc ./lib -r -c jsdoc.json",
|
||||||
"dev": "next dev",
|
"dev": "next dev",
|
||||||
"build": "next build",
|
"build": "next build",
|
||||||
"start": "next start"
|
"start": "next start"
|
||||||
@ -56,7 +57,6 @@
|
|||||||
"socket.io-client": "^2.3.0",
|
"socket.io-client": "^2.3.0",
|
||||||
"swagger-ui-react": "^3.32.5",
|
"swagger-ui-react": "^3.32.5",
|
||||||
"ts-morph": "^8.1.0",
|
"ts-morph": "^8.1.0",
|
||||||
"typescript-json-schema": "^0.43.0",
|
|
||||||
"uuid": "^8.3.0",
|
"uuid": "^8.3.0",
|
||||||
"winston": "^3.3.3"
|
"winston": "^3.3.3"
|
||||||
},
|
},
|
||||||
@ -68,8 +68,11 @@
|
|||||||
"@types/react": "^16.9.49",
|
"@types/react": "^16.9.49",
|
||||||
"@types/socket.io": "^2.1.11",
|
"@types/socket.io": "^2.1.11",
|
||||||
"@types/socket.io-client": "^1.4.33",
|
"@types/socket.io-client": "^1.4.33",
|
||||||
|
"better-docs": "^2.3.2",
|
||||||
|
"jsdocs": "^1.0.0",
|
||||||
"npm-check-updates": "^8.1.1",
|
"npm-check-updates": "^8.1.1",
|
||||||
"openapi-typescript-codegen": "^0.4.11",
|
"openapi-typescript-codegen": "^0.4.11",
|
||||||
"typescript": "^4.0.2"
|
"typescript": "^4.0.2",
|
||||||
|
"typescript-json-schema": "^0.43.0"
|
||||||
}
|
}
|
||||||
}
|
}
|
Loading…
Reference in New Issue
Block a user