How to use the jsdoctypeparser.Builder.FunctionType function in jsdoctypeparser

To help you get started, we’ve selected a few jsdoctypeparser examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github jscs-dev / jscs-jsdoc / lib / jsdoc.js View on Github external
case node instanceof TypeBuilder.GenericType:
            // genericTypeName: string,
            // parameterTypeUnions: Array.
            node.typeName = node.genericTypeName.type;
            res = cb(node) || [];
            if (node.parameterTypeUnions) {
                // node.parameterTypeUnions.collectionNode = node;
                res.concat(node.parameterTypeUnions.map(function(subnode) {
                    subnode.parentElement = node;
                    _iterateDocTypes(subnode, cb);
                }));
            }
            break;

        case node instanceof TypeBuilder.FunctionType:
            // parameterTypeUnions: Array.,
            // returnTypeUnion: TypeUnion|null,
            // isConstructor: boolean,
            // contextTypeUnion: TypeUnion|null
            node.typeName = 'Function';
            res = cb(node) || [];
            res.concat(node.parameterTypeUnions.map(function(subnode) {
                subnode.parentElement = node;
                _iterateDocTypes(subnode, cb);
            }));
            if (node.returnTypeUnion) {
                node.returnTypeUnion.collectionNode = node;
                res.concat(_iterateDocTypes(node.returnTypeUnion, cb));
            }
            if (node.contextTypeUnion) {
                node.contextTypeUnion.collectionNode = node;