(doseq [sym '(js Math)]
  (inject-ns__ sym))

(doseq [sym '(object string number array function boolean default IEquiv IComparable IWatchable IDeref IPending
                     ISequential IAssociative ISorted ICounted IReversible ISeqable IIndexed IIterable ICollection
                     ISeq IVector IList IMap ISet ICloneable IAtom IChunk IChunkedNext IChunkedSeq IDerefWithTimeout
                     IDrop IEditableCollection IEmptyableCollection IEncodeClojure IEncodeJS IFind IFn IHash IKVReduce
                     ILookup IMapEntry IMeta IMultiFn INamed INext IPrintWithWriter IRecord IReduce IReset IStack ISwap
                     ITransientAssociative ITransientCollection ITransientMap ITransientSet ITransientVector IUUID
                     IVolatile IWithMeta IWriter)]
  (when-not (resolve sym)
    (intern__ *ns* sym)))

(def require-macros require)

(def ^:private require-opt-keys
  [:exclude :only :rename :refer :refer-macros])

(defn ^:private get-refer-opt
  [opts]
  (seq (concat (:refer opts) (:refer-macros opts))))

(def default-data-readers
  (merge default-data-readers
         {'js #'joker.core/identity
          'queue #'joker.core/identity}))

;; Redefine some core functions with type hints

(defn instance? ^Boolean [^"Type|Fn" c x] (instance?__ c x))

;; ClojureScript core vars not supported by Joker

(def *clojurescript-version*)
(def *main-cli-fn*)
(def *print-err-fn*)
(def *print-fn*)
(def *print-namespace-maps*)
(def *print-newline*)
(def *target*)
(def *unchecked-if*)
(def *warn-on-infer*)

;; ClojureScript core functions not supported by Joker

(defn js->clj ([x]) ([x & opts]))
(defn chunk-first [s])
(defn print-meta? [opts obj])
(defn m3-hash-int [in])
(defn stepper [xform iter])
(defn pr-str* [obj])
(defn eduction [& xforms])
(defn unchecked-remainder-int [x n])
(defn uuid [s])
(defn compare-indexed ([xs ys]) ([xs ys len n]))
(defn tree-map-add [comp tree k v found])
(defn reset-cache [method-cache method-table cached-hierarchy hierarchy])
(defn tail-off [pv])
(defn unchecked-subtract-int ([x]) ([x y]) ([x y & more]))
(defn native-satisfies? [p x])
(defn inst-ms [inst])
(defn linear-traversal-nth ([coll n]) ([coll n not-found]))
(defn write-all [writer & ss])
(defn keyword-identical? [x y])
(defn pv-aset [node idx val])
(defn prefers [multifn])
(defn unchecked-editable-array-for [tv i])
(defn aget ([array i]) ([array i & idxs]))
(defn iter [coll])
(defn mk-bound-fn [sc test key])
(defn tree-map-seq-push [node stack ascending?])
(defn obj-map [& keyvals])
(defn push-tail [pv level parent tailnode])
(defn array-index-of-equiv? [arr k])
(defn bitmap-indexed-node-index [bitmap bit])
(defn aclone [arr])
(defn vreset! [vol newval])
(defn set! [var-symbol expr])
(defn chunk [b])
(defn inode-kv-reduce [arr f init])
(defn obj-map->hash-map [m k v])
(defn isa? ([child parent]) ([h child parent]))
(defn munge [name])
(defn make-hierarchy [])
(defn tv-push-tail [tv level parent tail-node])
(defn unchecked-long [x])
(defn unchecked-negate [x])
(defn symbol-identical? [x y])
(defn inst? [x])
(defn bit-count [v])
(defn create-node ([shift key1 val1 key2hash key2 val2]) ([edit shift key1 val1 key2hash key2 val2]))
(defn unchecked-inc-int [x])
(defn array-list [])
(defn array-chunk ([arr]) ([arr off]) ([arr off end]))
(defn dispatch-fn [multifn])
(defn bit-shift-right-zero-fill [x n])
(defn js-reserved? [x])
(defn pr-sequential-writer [writer print-one begin sep end opts coll])
(defn accumulating-seq-count [coll])
(defn pv-clone-node [node])
(defn ns-lookup [ns-obj k])
(defn floats [x])
(defn tree-map-replace [comp tree k v])
(defn m3-mix-H1 [h1 k1])
(defn prim-seq ([prim]) ([prim i]))
(defn hash-keyword [k])
(defn alength [array])
(defn js-invoke [obj s & args])
(defn m3-mix-K1 [k1])
(defn unchecked-float [x])
(defn undefined? [x])
(defn reduced? [r])
(defn apply-to [f argc args])
(defn disj! ([tcoll val]) ([tcoll val & vals]))
(defn booleans [x])
(defn mask [hash shift])
(defn int-array ([size-or-seq]) ([size init-val-or-seq]))
(defn find-and-cache-best-method [name dispatch-val hierarchy method-table prefer-table method-cache cached-hierarchy])
(defn iterable? [x])
(defn cat [rf])
(defn set-from-indexed-seq [iseq])
(defn is_proto_ [x])
(defn conj! ([]) ([tcoll]) ([tcoll val]) ([tcoll val & vals]))
(defn array-index-of-identical? [arr k])
(defn array-index-of-nil? [arr])
(defn pop! [tcoll])
(defn chunk-append [b x])
(defn flatten1 [colls])
(defn transduce ([xform f coll]) ([xform f init coll]))
(defn js-delete [obj key])
(defn truth_ [x])
(defn array-index-of [arr k])
(defn key->js [k])
(defn new-path [edit level node])
(defn compare-and-set! [a oldval newval])
(defn array-seq ([array]) ([array i]))
(defn array-copy-downward [from i to j len])
(defn pack-array-node [array-node edit idx])
(defn print-map [m print-one writer opts])
(defn long [x])
(defn volatile? [x])
(defn tv-editable-tail [tl])
(defn unchecked-add-int ([]) ([x]) ([x y]) ([x y & more]))
(defn hash-ordered-coll [coll])
(defn extend-object! [obj fn-map])
(defn do-assoc [pv level node i val])
(defn tree-map-kv-reduce [node f init])
(defn pr-writer-ex-info [obj writer opts])
(defn short [x])
(defn tv-editable-root [node])
(defn ns-interns* [sym])
(defn unchecked-double [x])
(defn ranged-iterator [v start end])
(defn longs [x])
(defn set-print-err-fn! [f])
(defn es6-iterator [coll])
(defn munge-str [name])
(defn pr-str-with-opts [objs opts])
(defn unchecked-multiply-int ([]) ([x]) ([x y]) ([x y & more]))
(defn chunk-rest [s])
(defn remove-all-methods [multifn])
(defn pr-opts [])
(defn find-ns-obj [ns])
(defn hash-combine [seed hash])
(defn unchecked-int [x])
(defn js-keys [obj])
(defn inst-ms* [inst])
(defn array-iter [x])
(defn tv-pop-tail [tv level node])
(defn default-dispatch-val [multifn])
(defn unchecked-multiply ([]) ([x]) ([x y]) ([x y & more]))
(defn es6-iterator-seq [iter])
(defn unchecked-dec [x])
(defn hash-collision-node-find-index [arr cnt key])
(defn persistent-array-map-seq [arr i _meta])
(defn tagged-literal? [value])
(defn double-array ([size-or-seq]) ([size init-val-or-seq]))
(defn seq-reduce ([f coll]) ([f val coll]))
(defn balance-left [key val ins right])
(defn ex-cause [ex])
(defn array-map-index-of [m k])
(defn ex-message [ex])
(defn string-print [x])
(defn float [x])
(defn first-array-for-longvec [pv])
(defn es6-set-entries-iterator [coll])
(defn to-array-2d [coll])
(defn ExceptionInfo [message data cause])
(defn pop-tail [pv level node])
(defn dissoc! ([tcoll key]) ([tcoll key & ks]))
(defn assoc! ([tcoll key val]) ([tcoll key val & kvs]))
(defn unchecked-array-for [pv i])
(defn sorted-set [& keys])
(defn pr-with-opts [objs opts])
(defn strip-ns [named])
(defn array-reduce ([arr f]) ([arr f val]) ([arr f val idx]))
(defn tagged-literal [tag form])
(defn array-extend-kv [arr k v])
(defn tv-ensure-editable [edit node])
(defn unchecked-dec-int [x])
(defn hash-imap [m])
(defn dominates [x y prefer-table hierarchy])
(defn persistent! [tcoll])
(defn set-print-fn! [f])
(defn balance-right [key val left ins])
(defn throw-no-method-error [name dispatch-val])
(defn demunge-str [munged-name])
(defn add-watch [iref key f])
(defn pr-sb-with-opts [objs opts])
(defn js-obj ([]) ([& keyvals]))
(defn sorted? [x])
(defn array-map-extend-kv [m k v])
(defn prn-str-with-opts [objs opts])
(defn find-macros-ns [ns])
(defn array-index-of-keyword? [arr k])
(defn prefer-method [multifn dispatch-val-x dispatch-val-y])
(defn hash-symbol [sym])
(defn ensure-reduced [x])
(defn edit-and-set ([inode edit i a]) ([inode edit i a j b]))
(defn mix-collection-hash [hash-basis count])
(defn unchecked-add ([]) ([x]) ([x y]) ([x y & more]))
(defn fn->comparator [f])
(defn unreduced [x])
(defn record? [x])
(defn unchecked-divide-int ([x]) ([x y]) ([x y & more]))
(defn swap-global-hierarchy! [f & args])
(defn hash-string [k])
(defn set-validator! [iref val])
(defn balance-left-del [key val del right])
(defn unchecked-subtract ([x]) ([x y]) ([x y & more]))
(defn remove-pair [arr i])
(defn sorted-set-by [comparator & keys])
(defn cloneable? [value])
(defn hash-string* [s])
(defn key-test [key other])
(defn find-ns-obj* [ctxt xs])
(defn array [& var-args])
(defn remove-method [multifn dispatch-val])
(defn balance-right-del [key val left del])
(defn volatile! [val])
(defn bitpos [hash shift])
(defn m3-fmix [h1 len])
(defn hash-coll [coll])
(defn clone-and-set ([arr i a]) ([arr i a j b]))
(defn array->transient-hash-map [len arr])
(defn object? [x])
(defn lift-ns [m])
(defn tree-map-append [left right])
(defn fix [q])
(defn long-array ([size-or-seq]) ([size init-val-or-seq]))
(defn descendants ([tag]) ([h tag]))
(defn imul [a b])
(defn array-for [pv i])
(defn js-mod [n d])
(defn equiv-map [x y])
(defn object-array ([size-or-seq]) ([size init-val-or-seq]))
(defn derive ([tag parent]) ([h tag parent]))
(defn seq-iter [coll])
(defn compare-keywords [a b])
(defn ancestors ([tag]) ([h tag]))
(defn subseq ([sc test key]) ([sc start-test start-key end-test end-key]))
(defn create-inode-seq ([nodes]) ([nodes i s]))
(defn doubles [x])
(defn halt-when ([pred]) ([pred retf]))
(defn remove-watch [iref key])
(defn ifn? [f])
(defn pv-fresh-node [edit])
(defn replicate [n x])
(defn hash-iset [s])
(defn reduced [x])
(defn pr-writer-impl [obj writer opts])
(defn unchecked-byte [x])
(defn missing-protocol [proto obj])
(defn unchecked-short [x])
(defn methods [multifn])
(defn lazy-transformer [stepper])
(defn ci-reduce ([cicoll f]) ([cicoll f val]) ([cicoll f val idx]))
(defn reduceable? [x])
(defn rsubseq ([sc test key]) ([sc start-test start-key end-test end-key]))
(defn type->str [ty])
(defn obj-clone [obj ks])
(defn get-method [multifn dispatch-val])
(defn vector-index-out-of-bounds [i cnt])
(defn es6-entries-iterator [coll])
(defn create-array-node-seq ([nodes]) ([meta nodes i s]))
(defn aset ([array i val]) ([array idx idx2 & idxv]))
(defn int-rotate-left [x n])
(defn create-tree-map-seq [tree ascending? cnt])
(defn multi-stepper ([xform iters]) ([xform iters nexts]))
(defn chars [x])
(defn pr-seq-writer [objs writer opts])
(defn regexp? [x])
(defn underive ([tag parent]) ([h tag parent]))
(defn array-copy [from i to j len])
(defn obj-map-compare-keys [a b])
(defn nil-iter [])
(defn pr-writer [obj writer opts])
(defn ints [x])
(defn demunge-pattern [])
(defn to-array [s])
(defn build-subvec [meta v start end __hash])
(defn tree-map-remove [comp tree k found])
(defn array? [x])
(defn prefers* [x y prefer-table])
(defn clone [value])
(defn scan-array [incr k array])
(defn demunge [name])
(defn quote-string [s])
(defn byte [x])
(defn parents ([tag]) ([h tag]))
(defn array-index-of-symbol? [arr k])
(defn sorted-map-by [comparator & keyvals])
(defn get-global-hierarchy [])
(defn add-to-string-hash-cache [k])
(defn clj->js [x])
(defn pv-aget [node idx])
(defn transient [coll])
(defn chunk-cons [chunk rest])
(defn comparator [pred])
(defn print-prefix-map [prefix m print-one writer opts])
(defn sorted-map [& keyvals])
(defn string-iter [x])
(defn chunked-seq ([vec i off]) ([vec node i off]) ([vec node i off meta]))
(defn make-array ([size]) ([type size]) ([type size & more-sizes]))
(defn shorts [x])
(defn enable-console-print! [])
(defn completing ([f]) ([f cf]))
(defn unchecked-negate-int [x])
(defn equiv-sequential [x y])
(defn hash-unordered-coll [coll])
(defn unchecked-inc [x])
(defn preserving-reduced [rf])
(defn get-validator [iref])
(defn chunk-next [s])
(defn into-array ([aseq]) ([type aseq]))
(defn chunk-buffer [capacity])
(defn m3-hash-unencoded-chars [in])
(defn unchecked-char [x])
(defn system-time [])
(defn bytes [x])
(defn compare-symbols [a b])

;; ClojureScript core macros not supported by Joker

(defn this-as [name & body])
(defn import-macros [ns vars])
(defn goog-define [sym default])
(defn coercive-not [x])
(defn coercive-not= [x y])
(defn coercive-= [x y])
(defn coercive-boolean [x])
(defn js-arguments [])
(defn js-in [key obj])
(defn js-debugger [])
(defn js-comment [comment])
(defn unsafe-cast [t x])
(defn js-inline-comment [comment])
(defn exists? [x])
(defn caching-hash [coll hash-fn hash-key])
(defn specify! [expr & impls])
(defn specify [expr & impls])
(defn implements? [psym x])
(defn satisfies? [psym x])
(defn simple-benchmark [bindings expr iterations & opts])
(defn gen-apply-to [])
(defn js-str [s])
(defn es6-iterable [ty])
(defn use-macros [& args])
(defn copy-arguments [dest])
(defn divide [x & more])
(defn unsafe-bit-and [x y & more])

(def *known-macros*
  (merge
   *known-macros*
   {'cljs.core.async.macros/go-loop nil 'cljs.core.async.macros/alt! nil 'cljs.core.async.macros/alt!! nil
    'cljs.core.async.macros/alts! nil 'cljs.core.async.macros/alts!! nil 'this-as nil 'import-macros nil
    'goog-define nil 'specify! nil 'specify nil 'simple-benchmark nil 'use-macros nil
    'cljs.test/deftest nil 'cljs.test/is nil 'cljs.test/are nil}
   (:known-macros joker.core/*linter-config*)))

(defn- lib-name__
  [lib]
  (if (string? lib)
    (derive-info__ (symbol (joker.string/replace lib "/" "_")) lib)
    lib))

(defn- load-libs-options__
  []
  #{:as :reload :reload-all :require :use :verbose :refer :default :refer-macros :exclude :only :rename :include-macros})

(in-ns 'user)
(joker.core/refer 'joker.core)

