adding template to create a client
This commit is contained in:
parent
5418c837d3
commit
bd219003bc
53
lib/templates/clientInterface.handlebars
Normal file
53
lib/templates/clientInterface.handlebars
Normal file
@ -0,0 +1,53 @@
|
|||||||
|
// Automatic Genearted File for Backendclass: "{{className}}"
|
||||||
|
// To update run `npm run build:backend`
|
||||||
|
|
||||||
|
import { nopeDispatcher } from "../nopeDispatcher"
|
||||||
|
|
||||||
|
{{!--
|
||||||
|
/**
|
||||||
|
* Interface for the Analyzing Result
|
||||||
|
*/
|
||||||
|
export interface IAnalyzeResult {
|
||||||
|
// Name of the Class
|
||||||
|
className: string,
|
||||||
|
// Decorators of the Class
|
||||||
|
classDecorator: DecoratorInformation,
|
||||||
|
// Methods of the Class
|
||||||
|
methods: (MethodInformation & DecoratorInformation)[],
|
||||||
|
// Properties of the Class
|
||||||
|
properties: (PropertyInformation & DecoratorInformation)[],
|
||||||
|
// Imports of the Class (contians external Files)
|
||||||
|
imports: {
|
||||||
|
content: string,
|
||||||
|
required: boolean,
|
||||||
|
}
|
||||||
|
}
|
||||||
|
--}}
|
||||||
|
{{#if imports.required}}
|
||||||
|
{{{imports.content}}}
|
||||||
|
{{/if}}
|
||||||
|
|
||||||
|
export class {{className}} {
|
||||||
|
constructor(protected _dispatcher: nopeDispatcher){
|
||||||
|
|
||||||
|
}
|
||||||
|
{{!--
|
||||||
|
declaration: MethodDeclaration;
|
||||||
|
params: ParameterInformation[];
|
||||||
|
isAbstract: boolean;
|
||||||
|
name: string;
|
||||||
|
isAsync: boolean;
|
||||||
|
isGenerator: boolean;
|
||||||
|
isImplementation: boolean;
|
||||||
|
returnType: TypeInformation;
|
||||||
|
head: string;
|
||||||
|
--}}
|
||||||
|
{{#each methods}}
|
||||||
|
|
||||||
|
{{{authorDescription}}}
|
||||||
|
public async {{name}}{{{head}}}{
|
||||||
|
// Perform the Method
|
||||||
|
return await this._dispatcher.performCall<{{{returnType.simplifiedSubType}}}>('{{../classDecorator.decoratorSettings.exportsElementsToDispatcher.uri}}/{{decoratorSettings.exportMethodToDispatcher.url}}', [{{#each params}}{{name}}{{#unless @last}}, {{/unless}}{{/each}}])
|
||||||
|
}
|
||||||
|
{{/each}}
|
||||||
|
}
|
Loading…
Reference in New Issue
Block a user