4 * Copyright 2013 Palantir Technologies, Inc.
6 * Licensed under the Apache License, Version 2.0 (the "License");
7 * you may not use this file except in compliance with the License.
8 * You may obtain a copy of the License at
10 * http://www.apache.org/licenses/LICENSE-2.0
12 * Unless required by applicable law or agreed to in writing, software
13 * distributed under the License is distributed on an "AS IS" BASIS,
14 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15 * See the License for the specific language governing permissions and
16 * limitations under the License.
18 Object.defineProperty(exports, "__esModule", { value: true });
19 var completedDocsRule_1 = require("../completedDocsRule");
20 var blockExclusion_1 = require("./blockExclusion");
21 var classExclusion_1 = require("./classExclusion");
22 var tagExclusion_1 = require("./tagExclusion");
23 exports.constructExclusionsMap = function (ruleArguments) {
24 var exclusions = new Map();
25 for (var _i = 0, ruleArguments_1 = ruleArguments; _i < ruleArguments_1.length; _i++) {
26 var ruleArgument = ruleArguments_1[_i];
27 addRequirements(exclusions, ruleArgument);
31 var addRequirements = function (exclusionsMap, descriptors) {
32 if (typeof descriptors === "string") {
33 exclusionsMap.set(descriptors, createRequirementsForDocType(descriptors, {}));
36 for (var _i = 0, _a = Object.keys(descriptors); _i < _a.length; _i++) {
38 exclusionsMap.set(docType, createRequirementsForDocType(docType, descriptors[docType]));
41 var createRequirementsForDocType = function (docType, descriptor) {
42 var requirements = [];
43 var overloadsSeparateDocs = false;
44 if (typeof descriptor === "object" && completedDocsRule_1.DESCRIPTOR_OVERLOADS in descriptor) {
45 overloadsSeparateDocs = !!descriptor[completedDocsRule_1.DESCRIPTOR_OVERLOADS];
47 if (docType === "methods" || docType === "properties") {
48 requirements.push(new classExclusion_1.ClassExclusion(descriptor));
51 requirements.push(new blockExclusion_1.BlockExclusion(descriptor));
53 if (descriptor.tags !== undefined) {
54 requirements.push(new tagExclusion_1.TagExclusion(descriptor));
57 overloadsSeparateDocs: overloadsSeparateDocs,
58 requirements: requirements,