jurisv / nodejs.extdirect

Ext.Direct connector for node.js (npm module)
41 stars 16 forks source link

Please add typescript definition #39

Open abenhamdine opened 7 years ago

abenhamdine commented 7 years ago

It would be cool to have ts definition for direct configuration :)

Here is my own interface, but properties could be optional too :

export interface ExtDirectConfig {
    /** Namespace in which server will be accessible from client side. Ex : 'Server' */
    rootNamespace: string,
    /** Support method discovery without `function` keyword. */
    ES6: boolean,
    /** API Name */
    apiName: string,
    /** URL to retrieve API configuration. Ex : '/directapi' */
    apiUrl: string,
    /** ,  URL to call Direct methods : ex "/direct" */
    classRouteUrl: string
    /** Direct class location in filesystem relative to the server directory : ex : '/direct', */
    classPath: string,
    /** Hosting server name. Ex : 'localhost' */
    server: string,
    /**  Hosting server port. Ex : "3000" */
    port: string,
    protocol: 'http' | 'https',
    /** Operation timeout. Default : 30000 */
    timeout: number,
    /** Set true to cache API's for production. During development setting to false will allow to make any changes and access API's without server reload */
    cacheAPI: boolean,
    /** Use relative URL's */
    relativeUrl: boolean,
    /** If true, will append req and res objects to method call */
    appendRequestResponseObjects: boolean,
    /** Metadata support */
    enableMetadata: boolean,
    /** Automatically append success true|false */
    responseHelper: boolean,
    /** Enable Helpers to have methods before and after API discovery as well as before and after Transaction batch */
    enableProcessors: boolean
}