How to use the typedoc/dist/lib/converter/plugins/CommentPlugin.CommentPlugin.removeReflection function in typedoc

To help you get started, we’ve selected a few typedoc 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 swimos / swim / swim-system-js / swim-core-js / @swim / build / main / DocTarget.ts View on Github external
const fileReflection = fileInfo.reflection as typedoc.DeclarationReflection;
      const targetReflection = targetInfo.reflection as typedoc.ContainerReflection;

      const childReflections = reflections.filter((reflection) => reflection.parent === fileReflection);
      for (let i = 0; i < childReflections.length; i += 1) {
        const childReflection = childReflections[i] as typedoc.DeclarationReflection;
        childReflection.parent = targetReflection;
        if (!targetReflection.children) {
          targetReflection.children = [];
        }
        targetReflection.children!.push(childReflection);
      }
      if (fileReflection.children) {
        fileReflection.children.length = 0;
      }
      CommentPlugin.removeReflection(context.project, fileReflection);
    }

    if (rootTarget.project.umbrella) {
      for (let i = 0; i < targets.length; i += 1) {
        const target = targets[i];
        const targetReflection = targetReflections[target.uid]!.reflection as typedoc.ContainerReflection;
        if (targetReflection !== rootReflection && target.project.umbrella) {
          // add library reflections to parent framework reflection
          const targetDeps = target.deps;
          for (let j = 0; j < targetDeps.length; j += 1) {
            const targetDep = targetDeps[j];
            const depReflection = targetReflections[targetDep.uid]!.reflection as typedoc.DeclarationReflection;
            const oldParentReflection = depReflection.parent as typedoc.ContainerReflection | undefined;
            if (oldParentReflection && oldParentReflection.children) {
              const index = oldParentReflection.children.indexOf(depReflection);
              if (index >= 0) {
github swimos / swim / swim-system-js / swim-core-js / @swim / build / main / DocTarget.ts View on Github external
} else {
      // lift root library reflections into project reflection
      const childReflections = reflections.filter((reflection) => reflection.parent === rootReflection);
      for (let i = 0; i < childReflections.length; i += 1) {
        const childReflection = childReflections[i] as typedoc.DeclarationReflection;
        childReflection.parent = context.project;
        if (!context.project.children) {
          context.project.children = [];
        }
        context.project.children!.push(childReflection);
      }
      if (rootReflection.children) {
        rootReflection.children.length = 0;
      }
      context.project.comment = rootReflection.comment;
      CommentPlugin.removeReflection(context.project, rootReflection);

      for (const targetName in targetReflections) {
        const targetInfo = targetReflections[targetName]!;
        CommentPlugin.removeReflection(context.project, targetInfo.reflection!);
      }
    }
  }
}
github swimos / swim / swim-js / swim-core-js / @swim / build / main / DocTarget.ts View on Github external
const fileReflection = fileInfo.reflection as DeclarationReflection;
      const targetReflection = targetInfo.reflection as ContainerReflection;

      const childReflections = reflections.filter((reflection) => reflection.parent === fileReflection);
      for (let i = 0; i < childReflections.length; i += 1) {
        const childReflection = childReflections[i] as DeclarationReflection;
        childReflection.parent = targetReflection;
        if (!targetReflection.children) {
          targetReflection.children = [];
        }
        targetReflection.children!.push(childReflection);
      }
      if (fileReflection.children) {
        fileReflection.children.length = 0;
      }
      CommentPlugin.removeReflection(context.project, fileReflection);
    }

    if (rootTarget.project.umbrella) {
      CommentPlugin.removeReflection(context.project, rootReflection);
    } else {
      // lift root library reflections into project reflection
      const childReflections = reflections.filter((reflection) => reflection.parent === rootReflection);
      for (let i = 0; i < childReflections.length; i += 1) {
        const childReflection = childReflections[i] as DeclarationReflection;
        childReflection.parent = context.project;
        if (!context.project.children) {
          context.project.children = [];
        }
        context.project.children!.push(childReflection);
      }
      if (rootReflection.children) {
github swimos / swim / swim-js / swim-core-js / @swim / build / main / DocTarget.ts View on Github external
const childReflection = childReflections[i] as DeclarationReflection;
        childReflection.parent = context.project;
        if (!context.project.children) {
          context.project.children = [];
        }
        context.project.children!.push(childReflection);
      }
      if (rootReflection.children) {
        rootReflection.children.length = 0;
      }
      context.project.comment = rootReflection.comment;
      CommentPlugin.removeReflection(context.project, rootReflection);

      for (const targetName in targetReflections) {
        const targetInfo = targetReflections[targetName]!;
        CommentPlugin.removeReflection(context.project, targetInfo.reflection!);
      }
    }
  }
}
github stimulusjs / stimulus / packages / typedoc-plugin-stimulus / src / remove_private_methods.ts View on Github external
private removeReflectionFromProject(reflection: Reflection, project: ProjectReflection) {
    CommentPlugin.removeReflection(project, reflection)
    if (reflection.parent && (reflection.parent.kind & ReflectionKind.FunctionOrMethod)) {
      CommentPlugin.removeReflection(project, reflection.parent)
    }
  }
}
github GregRos / parjs / src / generate-docs / typedoc-plugin.ts View on Github external
arr.forEach(x => {
            let remove = false;

            if (x.flags.isExternal) {
                x.flags.isExternal = false;
            }
            remove = !x.flags.isExported || x.flags.isPrivate;
            if (remove) {
                CommentPlugin.removeReflection(context.project, x);
            }
        });
github stimulusjs / stimulus / packages / typedoc-plugin-stimulus / src / remove_private_methods.ts View on Github external
private removeReflectionFromProject(reflection: Reflection, project: ProjectReflection) {
    CommentPlugin.removeReflection(project, reflection)
    if (reflection.parent && (reflection.parent.kind & ReflectionKind.FunctionOrMethod)) {
      CommentPlugin.removeReflection(project, reflection.parent)
    }
  }
}
github swimos / swim / swim-system-js / swim-core-js / @swim / build / main / DocTarget.ts View on Github external
const childReflection = childReflections[i] as typedoc.DeclarationReflection;
        childReflection.parent = context.project;
        if (!context.project.children) {
          context.project.children = [];
        }
        context.project.children!.push(childReflection);
      }
      if (rootReflection.children) {
        rootReflection.children.length = 0;
      }
      context.project.comment = rootReflection.comment;
      CommentPlugin.removeReflection(context.project, rootReflection);

      for (const targetName in targetReflections) {
        const targetInfo = targetReflections[targetName]!;
        CommentPlugin.removeReflection(context.project, targetInfo.reflection!);
      }
    }
  }
}