Touch & Sell JS API
    Preparing search index...

    Class TSDocument

    TSDocument objects can be of various types, they can be retrieved through TouchSell and opened through this API.

    Index

    Properties

    documentType: string

    the document type: form, image, doc, ppt, xls, pdf, txt, audio, video, d3, html, script

    id: number

    the document id (differs from the corresponding node id).

    linkuri?: string

    the URI to the actual file if relevant (all types but form and script) or undefined

    name: string

    the document name.

    Methods

    • Returns Promise<string>

      the content of the document

    • Parameters

      • key: string

        The key for the document variable.

      • namespace: string = 'script'

        The namespace for the variable. Default value is “script”.

      Returns Promise<string | null>

      the value for the key or NULL.

    • Parameters

      • params: Record<string, unknown>

        The hashmap of parameters (pairs of string key/value) to pass when opening the node.

      Returns Promise<void>

    • Parameters

      • key: string

        The key for the document variable.

      • value: string

        The value corresponding to “key”.

      • namespace: string = 'script'

        The namespace for the variable. Default value is “script”.

      Returns Promise<void>

    • Submit a form (only if documentType is “form”)

      Parameters

      • answers: Record<number, string>

      Returns Promise<boolean>