API Overview - clojurescript


ClojureScript compiler and core runtime library



cljs.analyzer

Detailed API documentation

  
  
  
  Contents:
  aliasable-clj-ns? analyze analyze-deps analyze-file analyze-symbol cache-file clj-ns->cljs-ns confirm-bindings confirm-ns core-name? desugar-ns-specs empty-env forms-seq forms-seq* get-expander infer-tag intern-macros loaded-js-ns? locate-src macro-autoload-ns? macroexpand-1 parse-ns requires-analysis? resolve-existing-var resolve-macro-var resolve-var rewrite-cljs-aliases 

Variables and functions in cljs.analyzer.api: all-ns analyze analyze-file default-warning-handler empty-env empty-state find-ns forms-seq get-js-index get-options in-cljs-user no-warn ns-interns ns-publics ns-resolve parse-ns remove-ns resolve warning-enabled? with-state


cljs.build.api

Detailed API documentation
This is intended to be a stable api for those who need programmatic access
to ClojureScript's project building facilities.

For example: a build script may need to how to invalidate compiled
files so that they will be recompiled.
Contents: add-dependencies add-implicit-options build cljs-dependents-for-macro-namespaces compile goog-dep-string inputs mark-cljs-ns-for-recompile! ns->location ns->source output-unoptimized parse-js-ns source-on-disk src-file->goog-require src-file->target-file target-file-for-cljs-ns watch


cljs.closure

Detailed API documentation
Compile ClojureScript to JavaScript with optimizations from Google
 Closure Compiler producing runnable JavaScript.

 The Closure Compiler (compiler.jar) must be on the classpath.

 Use the 'build' function for end-to-end compilation.

 build = find-sources -> add-dependencies -> compile -> optimize -> output

 Two protocols are defined: IJavaScript and Compilable. The
 Compilable protocol is satisfied by something which can return one
 or more IJavaScripts.

 With IJavaScript objects in hand, calling add-dependencies will
 produce a sequence of IJavaScript objects which includes all
 required dependencies from the Closure library and ClojureScript,
 in dependency order. This function replaces the closurebuilder
 tool.

 The optimize function converts one or more IJavaScripts into a
 single string of JavaScript source code using the Closure Compiler
 API.

 The produced output is either a single string of optimized
 JavaScript or a deps file for use during development.
Contents: ->JavaScriptFile -compile -find-sources -paths -source-map -source-url add-dep-string add-dependencies add-dependency-sources add-js-sources add-preloads build build-modules build-provides cljs-dependencies cljs-source-for-namespace Compilable compile compile-dir compile-file compile-form-seq compile-from-jar compile-sources compiled-file convert-js-module deps-file emit-optimized-source-map find-cljs-dependencies get-compiled-cljs get-upstream-deps* Inputs ISourceMap jar-file-to-disk JavaScriptFile js-dependencies js-transforms known-opts load-externs make-options map->JavaScriptFile optimize optimize-modules output-modules output-unoptimized path-from-jarfile path-relative-to process-js-modules read-js rel-output-path set-options source-for-namespace source-on-disk watch write-javascript write-js?


cljs.compiler

Detailed API documentation

  
  
  
  Contents:
  cljs-files-in compile-file compile-root emit-arguments-to-array emit-comment rename-to-js requires-compilation? with-core-cljs 

Variables and functions in cljs.compiler.api: cljs-files-in compile-file compile-root emit requires-compilation? with-core-cljs


cljs.core

Detailed API documentation

  
  
  
  Contents:
  -> ->> .. amap and areduce as-> assert binding case comment cond cond-> cond->> condp declare defmacro defmethod defmulti defn defn- defonce defprotocol defrecord deftype delay doseq dotimes doto exists? extend-protocol extend-type fast-path-protocol-partitions-count fast-path-protocols fn for goog-define if-let if-not if-some implements? js-comment js-debugger js-inline-comment lazy-cat lazy-seq let letfn loop macroexpand macroexpand-1 memfn ns-interns ns-unmap or reify satisfies? simple-benchmark some-> some->> specify specify! this-as time undefined? unsafe-cast vswap! when when-first when-let when-not when-some while with-out-str with-redefs 


cljs.env

Detailed API documentation
A namespace that exists solely to provide a place for "compiler"
state that is accessed/maintained by many different components.
Contents: with-compiler-env

Variables and functions in cljs.env.macros: with-compiler-env


cljs.js

Detailed API documentation

  
  
  
  Contents:
  


cljs.js-deps

Detailed API documentation

  
  
  
  Contents:
  -closure-lib? -foreign? -provides -requires -source -url build-index dependency-order find-classpath-lib find-js-classpath find-js-fs find-js-jar find-url goog-dependencies* IJavaScript js-dependency-index load-foreign-library* load-library* parse-js-ns 


cljs.pprint

Detailed API documentation

  
  
  
  Contents:
  formatter formatter-out getf pp pprint-logical-block print-length-loop setf with-pprint-dispatch 


cljs.repl

Detailed API documentation

  
  
  
  Contents:
  -evaluate -get-error -load -parse-error -parse-stacktrace -print-stacktrace -repl-options -setup -tear-down analyze-source apropos dir doc evaluate-form find-doc IGetError IJavaScriptEnv IParseError IParseStacktrace IPrintStacktrace IReplEnvOptions js-src->cljs-src known-repl-opts load-namespace mapped-stacktrace ns-info print-mapped-stacktrace read-source-map repl repl-read skip-if-eol skip-whitespace source source-fn 

Variables and functions in cljs.repl.browser: ->BrowserEnv browser-eval BrowserEnv constrain-order load-javascript map->BrowserEnv repl-env send-for-eval

Variables and functions in cljs.repl.nashorn: ->NashornEnv eval-resource map->NashornEnv NashornEnv repl-env

Variables and functions in cljs.repl.node: ->NodeEnv load-javascript map->NodeEnv node-eval NodeEnv repl-env

Variables and functions in cljs.repl.reflect: parse-param

Variables and functions in cljs.repl.rhino: ->RhinoEnv load-file map->RhinoEnv repl-env RhinoEnv

Variables and functions in cljs.repl.server: connection dispatch-on parse-headers send-and-close set-connection start


cljs.source-map

Detailed API documentation

  
  
  
  Contents:
  decode decode-reverse encode encode* indexed-sources invert-reverse-map lines->segs merge-source-maps relativize-path seg->map seg-combine source-compare update-result update-reverse-result 


cljs.spec

Detailed API documentation

  
  
  
  Contents:
  & * + ? alt and cat coll-of conformer def every every-kv exercise-fn fdef fspec inst-in instrument instrument-all instrument-ns int-in keys keys* map-of merge multi-spec nilable or spec speced-vars tuple unstrument unstrument-all unstrument-ns with-instrument-disabled 

Variables and functions in cljs.spec.impl.gen: delay

Variables and functions in cljs.spec.test: run-all-tests run-tests


cljs.stacktrace

Detailed API documentation

  
  
  
  Contents:
  mapped-frame mapped-line-column-call mapped-stacktrace mapped-stacktrace-str parse-file parse-stacktrace 


cljs.support

Detailed API documentation

  
  
  
  Contents:
  assert-args 


cljs.tagged-literals

Detailed API documentation

  
  
  
  Contents:
  ->JSValue JSValue 


cljs.test

Detailed API documentation

  
  
  
  Contents:
  are assert-any assert-predicate async deftest function? is run-all-tests run-tests run-tests-block test-all-vars test-ns test-ns-block testing try-expr 


cljs.util

Detailed API documentation

  
  
  
  Contents:
  clojurescript-version ext get-name levenshtein-distance measure mkdirs ns->relpath ns->source suggestion unknown-opts 
Logo & site design by Tom Hickey.
Clojure auto-documentation system by Tom Faulhaber.