New Research: Supply Chain Attack on Axios Pulls Malicious Dependency from npm.Details →
Socket
Book a DemoSign in
Socket

@webdoc/model

Package Overview
Dependencies
Maintainers
1
Versions
67
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@webdoc/model

Doclet API for JavaScript

latest
Source
npmnpm
Version
2.2.0
Version published
Weekly downloads
12K
26.16%
Maintainers
1
Weekly downloads
 
Created
Source

© 2020-2022 webdoc Labs

@webdoc/model

This package is the API for editing and querying in-memory documentation tree models. @webdoc/types defines the node structure.

Installation :package:

This package is usually a dependency of templates and other webdoc packages.

npm install @webdoc/model

Usage :newspaper_roll:

import * as model from '@webdoc/model';

Constructing and editing documents

const entity = model.createDoc(
  "DocumentedEntity",
  "ClassDoc",
  {
    "description": "This is a programmatically created document!",
  }
);

const entityNs = model.doc("Documentation.Entities", documentTree);

model.addChildDoc(entity, entityNs);

@webdoc/model exports helper functions for creating and searching documents and mounting them into document trees.

Data types

model.createFunctionType(
  [model.createSimpleKeywordType("Promise")], // params
  model.createSimpleKeywordType("boolean"),   // returns
);

@webdoc/model exports helper functions for creating and joining data types. The DataType type is defined in @webdoc/types.

Querying

// Gets all the methods named "generic" in DocumentedEntity. Each signature of the method has a separate document. The
// # operator excludes any static "generic"-named methods.
const genericSignatures = model.query("Documentation.Entities.DocumentedEntity#generic", documentTree);

@webdoc/model exports a query engine for its document path language.

Runtime type-checking

const isInstantiable = model.isClass(doc) || model.isInterface(doc);

@webdoc/model exports helper functions for checking the types of document passed.

Keywords

doclet

FAQs

Package last updated on 23 Oct 2022

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts