Home Reference Source

Function

Static Public Summary
public

coerceArray(arr: *): {"type": *, "data": *}

public
public

async collectArgs(func: *, call: *, hooks: *): {"args": *, "namedArgs": *}

A helper method interpreting a given function definition following the function spec from TODO:link-to-func-specification

public

compileFunction(name: *, decl: *, code: *, commentBlocks: *): *

public

compileJavascript(code: *, options: {}): *

public

extractDetailsFromError(error: *): {"type": string, "message": *, "line": *, "column": *}

public

extractFunctionSpecFromDoc(doc: *): {"name": *, "title": *, "description": *, "summary": *, "examples": *, "params": *, "_return": *}

public

findGlobals(ast: *, options: {}): *

public

pack(value: *, opts: {}): {"type": *, "data": *}

public

parseValue(text: *): *

public

type(value: *): string

Get the type code for a value

public

unpack(pkg: *): *

Static Public

public coerceArray(arr: *): {"type": *, "data": *} source

import {coerceArray} from 'stencila-js/src/types.js'

Params:

NameTypeAttributeDescription
arr *

Return:

{"type": *, "data": *}

public coercedArrayType(arr: *): string source

import {coercedArrayType} from 'stencila-js/src/types.js'

Params:

NameTypeAttributeDescription
arr *

Return:

string

public async collectArgs(func: *, call: *, hooks: *): {"args": *, "namedArgs": *} source

import collectArgs from 'stencila-js/src/collectArgs.js'

A helper method interpreting a given function definition following the function spec from TODO:link-to-func-specification

Params:

NameTypeAttributeDescription
func *
call *
hooks *

Return:

{"args": *, "namedArgs": *}

public compileFunction(name: *, decl: *, code: *, commentBlocks: *): * source

import compileFunction from 'stencila-js/src/compileFunction.js'

Params:

NameTypeAttributeDescription
name *
decl *
code *
commentBlocks *

Return:

*

public compileJavascript(code: *, options: {}): * source

import compileJavascript from 'stencila-js/src/compileJavascript.js'

Params:

NameTypeAttributeDescription
code *
options {}
  • optional
  • default: {}

Return:

*

public extractDetailsFromError(error: *): {"type": string, "message": *, "line": *, "column": *} source

import extractDetailsFromError from 'stencila-js/src/packError.js'

Params:

NameTypeAttributeDescription
error *

Return:

{"type": string, "message": *, "line": *, "column": *}

public extractFunctionSpecFromDoc(doc: *): {"name": *, "title": *, "description": *, "summary": *, "examples": *, "params": *, "_return": *} source

import extractFunctionSpecFromDoc from 'stencila-js/src/extractFunctionSpecFromDoc.js'

Params:

NameTypeAttributeDescription
doc *

Return:

{"name": *, "title": *, "description": *, "summary": *, "examples": *, "params": *, "_return": *}

public findGlobals(ast: *, options: {}): * source

import findGlobals from 'stencila-js/src/findGlobals.js'

Params:

NameTypeAttributeDescription
ast *
options {}
  • optional
  • default: {}

Return:

*

public pack(value: *, opts: {}): {"type": *, "data": *} source

import {pack} from 'stencila-js/src/types.js'

Params:

NameTypeAttributeDescription
value *
opts {}
  • optional
  • default: {}

Return:

{"type": *, "data": *}

public parseValue(text: *): * source

import parseValue from 'stencila-js/src/parseValue.js'

Params:

NameTypeAttributeDescription
text *

Return:

*

public type(value: *): string source

import {type} from 'stencila-js/src/types.js'

Get the type code for a value

Params:

NameTypeAttributeDescription
value *

A JavaScript value

Return:

string

Type code for value

public unpack(pkg: *): * source

import {unpack} from 'stencila-js/src/types.js'

Params:

NameTypeAttributeDescription
pkg *

Return:

*