How to use the @microsoft/api-extractor/lib/definitions/ApiItem.ApiItemKind.Constructor 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
if (!apiMethod.supportedName) {
            return;
        }

        for (const param of apiMethod.params) {
            if (apiMethod.documentation.parameters[param.name] == null) {
                apiMethod.documentation.parameters[param.name] = {} as any;
            }

            this.visitApiParam(param, apiMethod.documentation.parameters[param.name]);
        }

        let newNode: Object;
        if (apiMethod.name === "__constructor") {
            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() : "",