adding functions
This commit is contained in:
parent
33849143dd
commit
227dfdc161
@ -4,28 +4,60 @@ import { IF01 } from "./testExternalDescriptor";
|
||||
import { IF02 } from "./testExternalDescriptorReference";
|
||||
|
||||
export interface IF00 {
|
||||
// Test property
|
||||
hello: 'world'
|
||||
}
|
||||
|
||||
exportsElementsToDispatcher('test-api')
|
||||
@exportsElementsToDispatcher({
|
||||
uri: 'test'
|
||||
})
|
||||
export class CLWithInterface {
|
||||
@exportPropertyToDispatcher
|
||||
exportedAttributeSimple = new nopeObservable<boolean>(false);
|
||||
|
||||
@exportPropertyToDispatcher
|
||||
exportedAttributeComplex = new nopeObservable<{
|
||||
element01: number,
|
||||
element01: IF00,
|
||||
num: number
|
||||
}>({
|
||||
element01: 0,
|
||||
element01: {
|
||||
hello:"world"
|
||||
},
|
||||
num: 0
|
||||
});
|
||||
|
||||
@exportMethodToDispatcher()
|
||||
async exportedFunction(a: number, b: number, operator: (a: IF00,b: IF01) => Promise<IF02>){
|
||||
|
||||
/**
|
||||
*
|
||||
* Function which will add two Nodes.
|
||||
* @param a Parameter a
|
||||
* @param b Parameter b
|
||||
*/
|
||||
@exportMethodToDispatcher({
|
||||
url: 'exportedFunction'
|
||||
})
|
||||
async exportedFunction(a: number, b: number, operator: (a: IF00,b: IF01) => Promise<{
|
||||
test: IF02,
|
||||
x: string
|
||||
}>){
|
||||
// Comment etc.
|
||||
return await operator(a,b);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Function which will add two Nodes.
|
||||
* @param a Parameter a
|
||||
* @param b Parameter b
|
||||
*/
|
||||
@exportMethodToDispatcher({
|
||||
url: 'exportedStringFunction'
|
||||
})
|
||||
async exportedStringFunction(a: string, b: string){
|
||||
// Comment etc.
|
||||
return "";
|
||||
}
|
||||
|
||||
exportedFunctionWithError(a: number, b: number, operator: (a: number,b: number) => Promise<number>){
|
||||
return operator(a,b);
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user