2.2.0 • Published 2 years ago

@webdoc/model v2.2.0

Weekly downloads
148
License
The Prosperity Pu...
Repository
github
Last release
2 years ago

© 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.

1.6.4

2 years ago

1.6.3

2 years ago

1.6.2

2 years ago

1.6.1

2 years ago

1.6.0

2 years ago

2.2.0

2 years ago

2.0.0-beta

2 years ago

2.0.0

2 years ago

2.1.2

2 years ago

2.1.1

2 years ago

2.1.0

2 years ago

1.6.6

2 years ago

1.6.5

2 years ago

1.5.7

2 years ago

1.5.6

2 years ago

1.5.5

3 years ago

1.5.4

3 years ago

1.5.3

3 years ago

1.5.2

3 years ago

1.5.1

3 years ago

1.5.0

3 years ago

1.3.4

3 years ago

1.3.3

3 years ago

1.3.2

3 years ago

1.4.0

3 years ago

1.3.1

3 years ago

1.2.2

3 years ago

1.3.0

3 years ago

1.2.1

3 years ago

1.2.0

3 years ago

1.1.6

3 years ago

1.1.5

3 years ago

1.1.4

3 years ago

1.1.3

3 years ago

1.1.2

3 years ago

1.1.1

3 years ago

1.1.0

3 years ago

1.0.1

4 years ago

1.0.0

4 years ago

0.1.98-alpha.0

4 years ago

0.1.95-alpha.0

4 years ago

0.1.93-alpha.0

4 years ago

0.1.91-alpha.0

4 years ago

0.1.82-alpha.0

4 years ago

0.1.73-alpha.0

4 years ago

0.1.71-alpha.0

4 years ago

0.1.69-alpha.0

4 years ago

0.1.67-alpha.0

4 years ago

0.1.65-alpha.0

4 years ago

0.1.64-alpha.0

4 years ago

0.1.54-alpha.0

4 years ago

0.1.53-alpha.0

4 years ago

0.1.50-alpha.0

4 years ago

0.1.46-alpha.0

4 years ago

0.1.41-alpha.0

4 years ago

0.1.45-alpha.0

4 years ago

0.1.29-alpha.0

4 years ago

0.1.27-alpha.0

4 years ago

0.1.22-alpha.0

4 years ago

0.1.17-alpha.0

4 years ago

0.1.16-alpha.0

4 years ago

0.1.14-alpha.0

4 years ago

0.1.12-alpha.0

4 years ago

0.1.4-alpha.0

4 years ago

0.1.2-alpha.0

4 years ago

0.1.1-alpha.0

4 years ago

0.1.0-alpha.0

4 years ago