All type schemas that are derived from CodeBlock
All type schemas that are derived from CodeFragment
All type schemas that are derived from Code
All type schemas that are derived from ContactPoint
All type schemas that are derived from CreativeWork
All type schemas that are derived from Entity
All type schemas that are derived from Enumeration
All type schemas that are derived from Grant
Union type for valid inline content.
All type schemas that are derived from Mark
All type schemas that are derived from Math
All type schemas that are derived from MediaObject
Union type for all valid nodes.
All type schemas that are derived from Thing
All type schemas that are derived from Validator
All type schemas that are derived from Variable
Get the version string (e.g "1.2.3") for this package
Get the major version string (e.g "1") for this package
Get the minor version string (e.g "1.2") for this package
Create a ArrayValidator
node
Object containing ArrayValidator schema properties as key/value pairs
ArrayValidator schema node
Create a AudioObject
node
Object containing AudioObject schema properties as key/value pairs
AudioObject schema node
Create a BooleanValidator
node
Object containing BooleanValidator schema properties as key/value pairs
BooleanValidator schema node
Create a CodeExpression
node
Object containing CodeExpression schema properties as key/value pairs
CodeExpression schema node
Create a CodeFragment
node
Object containing CodeFragment schema properties as key/value pairs
CodeFragment schema node
Create a Collection
node
Object containing Collection schema properties as key/value pairs
Collection schema node
Create a ConstantValidator
node
Object containing ConstantValidator schema properties as key/value pairs
ConstantValidator schema node
Create a ContactPoint
node
Object containing ContactPoint schema properties as key/value pairs
ContactPoint schema node
Create a CreativeWork
node
Object containing CreativeWork schema properties as key/value pairs
CreativeWork schema node
Create a DatatableColumn
node
Object containing DatatableColumn schema properties as key/value pairs
DatatableColumn schema node
Create a DefinedTerm
node
Object containing DefinedTerm schema properties as key/value pairs
DefinedTerm schema node
Create a EnumValidator
node
Object containing EnumValidator schema properties as key/value pairs
EnumValidator schema node
Create a Enumeration
node
Object containing Enumeration schema properties as key/value pairs
Enumeration schema node
Create a ImageObject
node
Object containing ImageObject schema properties as key/value pairs
ImageObject schema node
Create a IntegerValidator
node
Object containing IntegerValidator schema properties as key/value pairs
IntegerValidator schema node
A type guard to determine whether a node is of a specific type. Returns a boolean value and narrows the TypeScript inferred type to the type.
e.g. isA('Paragraph', node)
The name of the type to test for
The node being tested
Type guard to determine whether a node is BlockContent
.
The node to get the type for
Type guard to determine whether a node is a CreativeWork
.
The node to get the type for
Type guard to determine whether a node is InlineContent
.
The node to get the type for
Type guard to determine whether a node is both InlineContent
and
and an Entity
.
The node to get the type for
Type guard to determine whether a node is a primitive type. Returns a boolean value and narrows the TypeScript inferred type.
The node to get the type for
Returns true if node is one of null
, boolean
, string
, or number
Returns a type guard to determine whether a node is of a specific type. Returns a boolean value and narrows the TypeScript inferred type to the type.
e.g. article.content.filter(isType('Paragraph'))
The type to test for
Get Stencila Schema's JSON-LD @context
as an object.
Get the name of a term in the Stencila Schema's JSON-LD @context
from a URL.
This is the inverse of jsonLdTermUrl
.
A url to resolve into a term
Get the URL for a term in the Stencila Schema's JSON-LD @context
from it's name.
This uses the JSON-LD @context
in stencila.jsonld
(which
provides a mapping between vocabularies) to translate
type names used in the Stencila Schema
to those used in other schemas (e.g. Schema.org, Bioschemas).
The compact IRIs
in the @context
e.g. schema:Person
are expanded to a URL
e.g. http://schema.org/Person
suitable for the itemtype
attribute.
A term in the JSON-LD @context
. May, or may not be in
the stencila
namespace
Get the URL of Stencila Schema's JSON-LD @context
or
for a specific stencila:
term e.g. CodeChunk
, outputs
.
The @context
's URL needs to have a trailing slash because
it gets prefixed to all keys during JSON-LD expansion.
e.g. the term CodeChunk
gets expanded to http://schema.stenci.la/v0/jsonld/CodeChunk
(which in gets redirected to https://unpkg.com/@stencila/schema@0.32.1/dist/CodeChunk.jsonld
)
The Stencila term (type or property) to generate the URL for. Defaults to empty string i.e. the context.
Get all the properties in all types in the Stencila Schema.
Returns a alphabetically sorted Record
with information on
each property, including the types that it occurs on,
and whether or not it is an array property.
Get all the names of all types in the Stencila Schema.
Get all Stencila Schema's JSON Schemas.
Create a MathFragment
node
Object containing MathFragment schema properties as key/value pairs
MathFragment schema node
Create a MediaObject
node
Object containing MediaObject schema properties as key/value pairs
MediaObject schema node
Create all Microdata attributes for a Stencila Node
.
The node e.g. a Person
node
The name of the property that this node is part of e.g authors
Is this an item within an array property e.g a Person
within authors
The id used to link to / from this Microdata item
Create MicrodataItem
attributes for a node.
Does not create the itemscope
and itemtype
attributes for nodes that
are primitive (and therefore which do not represent a "scope" having
itemprop
s nested within it). Instead, for primitive nodes, other than Text
add the data-itemtype
attribute, do they can be styled if so desired.
The node to create Microdata attributes for
Id of the Microdata item. Used to link to this node using the itemref
property.
Get the HTML Microdata itemprop
for a Stencila Schema property.
The itemprop
attribute is normally just the name of the property
i.e. it is not prefixed by a base URL. This function returns the
[prefix, name]
pair e.g. ["schema", "author"]
,
["codemeta", "maintainer"]
because you may only want to encode
itemprop
s for well known schemas e.g. schema.org
The name of the property
Is the node for which attributes are being generated
an item within an array property? e.g. a Person
in authors
.
Get the HTML Microdata itemtype
for a Stencila Schema type
Create MicrodataProperty
attributes for a node property.
The name of the property
Id of another Microdata item to link to using the itemref
property.
Get the 'pseudo' HTML Microdata attribute for the root element.
This attribute name / value pair is used to scope CSS variables to
the root Stencila node in an HML document. It is used by Encoda when
encoding to HTML, it is in Thema to scope CSS variable thereby
avoiding variable name clashes from using the CSS :root
pseudo-class.
Although not directly related to Microdata, given it is used in both of those projects, this appears to be the best place for it.
Get the Stencila Schema type from a HTML Microdata itemtype
.
This is the inverse of microdataItemtype
.
Get the URL used in Microdata attributes.
This is used to normalize the versioned URL from the JSON-LD context.
Create a MonetaryGrant
node
Object containing MonetaryGrant schema properties as key/value pairs
MonetaryGrant schema node
Returns a type guard to determine whether a node belongs to a set of types. Returns a boolean value and narrows the TypeScript inferred type to the type.
A Stencila schema node object
Create a NontextualAnnotation
node
Object containing NontextualAnnotation schema properties as key/value pairs
NontextualAnnotation schema node
Create a NumberValidator
node
Object containing NumberValidator schema properties as key/value pairs
NumberValidator schema node
Create a Organization
node
Object containing Organization schema properties as key/value pairs
Organization schema node
Create a Periodical
node
Object containing Periodical schema properties as key/value pairs
Periodical schema node
Create a PostalAddress
node
Object containing PostalAddress schema properties as key/value pairs
PostalAddress schema node
Create a PropertyValue
node
Object containing PropertyValue schema properties as key/value pairs
PropertyValue schema node
Create a PublicationIssue
node
Object containing PublicationIssue schema properties as key/value pairs
PublicationIssue schema node
Create a PublicationVolume
node
Object containing PublicationVolume schema properties as key/value pairs
PublicationVolume schema node
Create a QuoteBlock
node
Object containing QuoteBlock schema properties as key/value pairs
QuoteBlock schema node
Create a SoftwareApplication
node
Object containing SoftwareApplication schema properties as key/value pairs
SoftwareApplication schema node
Create a SoftwareEnvironment
node
Object containing SoftwareEnvironment schema properties as key/value pairs
SoftwareEnvironment schema node
Create a SoftwareSession
node
Object containing SoftwareSession schema properties as key/value pairs
SoftwareSession schema node
Create a SoftwareSourceCode
node
Object containing SoftwareSourceCode schema properties as key/value pairs
SoftwareSourceCode schema node
Create a StringValidator
node
Object containing StringValidator schema properties as key/value pairs
StringValidator schema node
Create a Superscript
node
Object containing Superscript schema properties as key/value pairs
Superscript schema node
Create a ThematicBreak
node
Object containing ThematicBreak schema properties as key/value pairs
ThematicBreak schema node
Create a TupleValidator
node
Object containing TupleValidator schema properties as key/value pairs
TupleValidator schema node
Returns a function which returns true is the type is a member of the type map.
An object containing schema type values
Create a VideoObject
node
Object containing VideoObject schema properties as key/value pairs
VideoObject schema node
Create a VolumeMount
node
Object containing VolumeMount schema properties as key/value pairs
VolumeMount schema node
Generated using TypeDoc
Union type for valid block content.