Options
All
  • Public
  • Public/Protected
  • All
Menu
     

Interface Params

Config properties for the GNParam object.

Hierarchy

  • Params

Index

Properties

Name

Name: string

The fullname of the Param.

Optional Aliases

Aliases: string[]

An array of other names that will reference this Param in:

Example:

// config/endpoints.cfg.js
module.exports = () => ({
    __DEFAULTS: {
        Params: {
            MyParam: new GNParam({ Name: 'My Param', Aliases: ['YourParam'] })
        }
    },
    User: {
        Actions: {
            Friend: new RouteDB({
                Params: {
                    YourParam: true // Refers to __DEFAULTS.Params.MyParam
                }
            })
            "/": new RouteDB({
                Params: {
                    MyParam: true // Refers to __DEFAULTS.Params.MyParam
                }
            })
        }
    }
});

Default

Default: any

The default value for the Param. If this value is declare as function that returns the actual value, this default will be considered hidden, and will not appear in the REST-API Docs.

Format

Format: CBFormat

A callback that handles any post-processing needed before hydration.

Desc

Desc: GNDescr | Descr

A GNDescr object or {@link Params.Descr} config describing the Param.