... This Source Code Form is subject to the terms of the Mozilla Public License, v. 2.0.
... If a copy of the MPL was not distributed with this file, You can obtain one at https://mozilla.org/MPL/2.0/.

(.require
 [library
  [lux (.except)
   ["$" documentation]
   [data
    ["[0]" text (.only \n)
     ["%" \\injection]]]]]
 [\\library
  ["[0]" /]])

(the .public documentation
  (List $.Documentation)
  (list ($.module /._
                  "")

        ($.definition (/.Object brand))
        ($.definition /.Function)
        ($.definition /.Symbol)
        ($.definition /.Null)
        ($.definition /.Undefined)
        ($.definition /.Boolean)
        ($.definition /.Number)
        ($.definition /.String)
        ($.definition /.null?)
        ($.definition /.on_browser?)
        ($.definition /.on_nashorn?)
        ($.definition /.on_node_js?)

        ($.definition /.null
          "The null pointer.")

        ($.definition /.import
          "Easily import types, methods, functions and constants."
          ($.example (' (import Uint8Array
                          "[1]::[0]")))
          ($.example (' (import TextEncoder
                          "[1]::[0]"
                          (new [/.String])
                          (encode [/.String] Uint8Array))))
          ($.example (' (import TextDecoder
                          "[1]::[0]"
                          (new [/.String])
                          (decode [/.String] String)))))

        ($.definition /.type_of
          "The type of an object, as text."
          ($.example (' (= "boolean"
                           (type_of true))))
          ($.example (' (= "number"
                           (type_of +123.456))))
          ($.example (' (= "string"
                           (type_of "789"))))
          ($.example (' (= "function"
                           (type_of (function (_ value) value))))))

        ($.definition /.global
          "Allows using definitions from the JavaScript host platform."
          ($.example (' (global .Decimal [Math PI]))))

        ($.definition /.function
          (%.message "Allows defining closures/anonymous-functions in the form that JavaScript expects."
                     \n "This is useful for adapting Lux functions for usage by JavaScript code.")
          ($.example (' (is /.Function
                            (function [left right]
                              (do_something (as Foo left) (as Bar right)))))))
        ))
