How to use the @microsoft/api-extractor/lib/generators/ApiJsonFile.convertKindToJson function in @microsoft/api-extractor

To help you get started, we’ve selected a few @microsoft/api-extractor 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 SimplrJS / ts-docs-gen / src / extractor / api-json-generator.ts View on Github external
for (const param of apiFunction.params) {
            // FIXME: any
            if (apiFunction.documentation.parameters[param.name] == null) {
                apiFunction.documentation.parameters[param.name] = {} as any;
            }

            this.visitApiParam(param, apiFunction.documentation.parameters[param.name]);
        }
        const returnValueNode: IReturn = {
            type: apiFunction.returnType,
            description: apiFunction.documentation.returnsMessage
        };

        const newNode: Object = {
            kind: ApiJsonFile.convertKindToJson(apiFunction.kind),
            returnValue: returnValueNode,
            parameters: apiFunction.documentation.parameters,
            deprecatedMessage: apiFunction.documentation.deprecatedMessage || [],
            summary: apiFunction.documentation.summary || [],
            remarks: apiFunction.documentation.remarks || [],
            isBeta: apiFunction.documentation.releaseTag === ReleaseTag.Beta
        };

        if (refObject != null) {
            refObject[apiFunction.name] = newNode;
        }
    }
github SimplrJS / ts-docs-gen / src / extractor / api-json-generator.ts View on Github external
newNode = {
                kind: ApiJsonFile.convertKindToJson(ApiItemKind.Constructor),
                signature: apiMethod.getDeclarationLine(),
                parameters: apiMethod.documentation.parameters || {},
                deprecatedMessage: apiMethod.documentation.deprecatedMessage || [],
                summary: apiMethod.documentation.summary || [],
                remarks: apiMethod.documentation.remarks || []
            };
        } else {
            const returnValueNode: IReturn = {
                type: apiMethod.returnType,
                description: apiMethod.documentation.returnsMessage
            };

            newNode = {
                kind: ApiJsonFile.convertKindToJson(apiMethod.kind),
                signature: apiMethod.getDeclarationLine(),
                accessModifier: apiMethod.accessModifier ? AccessModifier[apiMethod.accessModifier].toLowerCase() : "",
                isOptional: !!apiMethod.isOptional,
                isStatic: !!apiMethod.isStatic,
                returnValue: returnValueNode,
                parameters: apiMethod.documentation.parameters,
                deprecatedMessage: apiMethod.documentation.deprecatedMessage || [],
                summary: apiMethod.documentation.summary || [],
                remarks: apiMethod.documentation.remarks || [],
                isBeta: apiMethod.documentation.releaseTag === ReleaseTag.Beta
            };
        }

        if (refObject != null) {
            refObject[apiMethod.name] = newNode;
        }