js/jscore

    Dark Mode
Search:
  Source   Edit

This module wraps core JavaScript functions.

Unless your application has very specific requirements and solely targets JavaScript, you should be using the relevant functions in the math, json, and times stdlib modules instead.

Types

DateLib = ref object
  Source   Edit
DateTime = ref object
  Source   Edit
JsonLib = ref object
  Source   Edit
MathLib = ref object
  Source   Edit

Procs

proc abs(m: MathLib; a: SomeNumber): SomeNumber {.importjs, ...raises: [], tags: [].}
  Source   Edit
proc acos(m: MathLib; a: SomeNumber): float {.importjs, ...raises: [], tags: [].}
  Source   Edit
proc acosh(m: MathLib; a: SomeNumber): float {.importjs, ...raises: [], tags: [].}
  Source   Edit
proc asin(m: MathLib; a: SomeNumber): float {.importjs, ...raises: [], tags: [].}
  Source   Edit
proc asinh(m: MathLib; a: SomeNumber): float {.importjs, ...raises: [], tags: [].}
  Source   Edit
proc atan(m: MathLib; a: SomeNumber): float {.importjs, ...raises: [], tags: [].}
  Source   Edit
proc atan2(m: MathLib; a: SomeNumber): float {.importjs, ...raises: [], tags: [].}
  Source   Edit
proc atanh(m: MathLib; a: SomeNumber): float {.importjs, ...raises: [], tags: [].}
  Source   Edit
proc cbrt(m: MathLib; f: SomeFloat): SomeFloat {.importjs, ...raises: [], tags: [].}
  Source   Edit
proc ceil(m: MathLib; f: SomeFloat): SomeFloat {.importjs, ...raises: [], tags: [].}
  Source   Edit
proc clz32(m: MathLib; f: SomeInteger): int {.importjs, ...raises: [], tags: [].}
  Source   Edit
proc cos(m: MathLib; a: SomeNumber): float {.importjs, ...raises: [], tags: [].}
  Source   Edit
proc cosh(m: MathLib; a: SomeNumber): float {.importjs, ...raises: [], tags: [].}
  Source   Edit
func debugger() {.importjs: "debugger@", ...raises: [], tags: [].}
https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Statements/debugger   Source   Edit
proc exp(m: MathLib; a: SomeNumber): float {.importjs, ...raises: [], tags: [].}
  Source   Edit
proc expm1(m: MathLib; a: SomeNumber): float {.importjs, ...raises: [], tags: [].}
  Source   Edit
proc floor(m: MathLib; f: SomeFloat): int {.importjs, ...raises: [], tags: [].}
  Source   Edit
proc fround(m: MathLib; f: SomeFloat): float32 {.importjs, ...raises: [], tags: [].}
  Source   Edit
proc getDay(d: DateTime): int {.importjs, ...raises: [], tags: [].}
  Source   Edit
proc getFullYear(d: DateTime): int {.importjs, ...raises: [], tags: [].}
  Source   Edit
proc getHours(d: DateTime): int {.importjs, ...raises: [], tags: [].}
  Source   Edit
proc getMilliseconds(d: DateTime): int {.importjs, ...raises: [], tags: [].}
  Source   Edit
proc getMinutes(d: DateTime): int {.importjs, ...raises: [], tags: [].}
  Source   Edit
proc getMonth(d: DateTime): int {.importjs, ...raises: [], tags: [].}
  Source   Edit
proc getSeconds(d: DateTime): int {.importjs, ...raises: [], tags: [].}
  Source   Edit
proc getTime(d: DateTime): int {.importjs, ...raises: [], tags: [].}
  Source   Edit
proc getTimezoneOffset(d: DateTime): int {.importjs, ...raises: [], tags: [].}
  Source   Edit
proc getUTCDate(d: DateTime): int {.importjs, ...raises: [], tags: [].}
  Source   Edit
proc getUTCDay(d: DateTime): int {.importjs, ...raises: [], tags: [].}
  Source   Edit
proc getUTCFullYear(d: DateTime): int {.importjs, ...raises: [], tags: [].}
  Source   Edit
proc getUTCHours(d: DateTime): int {.importjs, ...raises: [], tags: [].}
  Source   Edit
proc getUTCMilliseconds(d: DateTime): int {.importjs, ...raises: [], tags: [].}
  Source   Edit
proc getUTCMinutes(d: DateTime): int {.importjs, ...raises: [], tags: [].}
  Source   Edit
proc getUTCMonth(d: DateTime): int {.importjs, ...raises: [], tags: [].}
  Source   Edit
proc getUTCSeconds(d: DateTime): int {.importjs, ...raises: [], tags: [].}
  Source   Edit
proc getYear(d: DateTime): int {.importjs, ...raises: [], tags: [].}
  Source   Edit
proc hypot(m: MathLib; args: varargs[distinct SomeNumber]): float {.importjs,
    ...raises: [], tags: [].}
  Source   Edit
proc imul(m: MathLib; a, b: int32): int32 {.importjs, ...raises: [], tags: [].}
  Source   Edit
proc log(m: MathLib; a: SomeNumber): float {.importjs, ...raises: [], tags: [].}
  Source   Edit
proc log1p(m: MathLib; a: SomeNumber): float {.importjs, ...raises: [], tags: [].}
  Source   Edit
proc log2(m: MathLib; a: SomeNumber): float {.importjs, ...raises: [], tags: [].}
  Source   Edit
proc log10(m: MathLib; a: SomeNumber): float {.importjs, ...raises: [], tags: [].}
  Source   Edit
proc max(m: MathLib; a, b: SomeNumber): SomeNumber {.importjs, ...raises: [],
    tags: [].}
  Source   Edit
proc min[T: SomeNumber | JsRoot](m: MathLib; a, b: T): T {.importjs, ...raises: [],
    tags: [].}
  Source   Edit
proc newDate(): DateTime {.importjs: "new Date()", ...raises: [], tags: [].}
  Source   Edit
proc newDate(date: int | int64 | string): DateTime {.importjs: "new Date(#)",
    ...raises: [], tags: [].}
  Source   Edit
proc newDate(year, month, day, hours, minutes, seconds, milliseconds: int): DateTime {.
    importjs: "new Date(#,#,#,#,#,#,#)", ...raises: [], tags: [].}
  Source   Edit
proc now(d: DateLib): int {.importjs, ...raises: [], tags: [].}
  Source   Edit
proc parse(d: DateLib; s: cstring): int {.importjs, ...raises: [], tags: [].}
  Source   Edit
proc parse(l: JsonLib; s: cstring): JsRoot {.importjs, ...raises: [], tags: [].}
  Source   Edit
proc pow(m: MathLib; a, b: distinct SomeNumber): float {.importjs, ...raises: [],
    tags: [].}
  Source   Edit
proc random(m: MathLib): float {.importjs, ...raises: [], tags: [].}
  Source   Edit
proc round(m: MathLib; f: SomeFloat): int {.importjs, ...raises: [], tags: [].}
  Source   Edit
proc setFullYear(d: DateTime; year: int) {.importjs, ...raises: [], tags: [].}
  Source   Edit
proc sign(m: MathLib; f: SomeNumber): int {.importjs, ...raises: [], tags: [].}
  Source   Edit
proc sin(m: MathLib; a: SomeNumber): float {.importjs, ...raises: [], tags: [].}
  Source   Edit
proc sinh(m: MathLib; a: SomeNumber): float {.importjs, ...raises: [], tags: [].}
  Source   Edit
proc sqrt(m: MathLib; f: SomeFloat): SomeFloat {.importjs, ...raises: [], tags: [].}
  Source   Edit
proc stringify(l: JsonLib; s: JsRoot): cstring {.importjs, ...raises: [], tags: [].}
  Source   Edit
proc tan(m: MathLib; a: SomeNumber): float {.importjs, ...raises: [], tags: [].}
  Source   Edit
proc tanh(m: MathLib; a: SomeNumber): float {.importjs, ...raises: [], tags: [].}
  Source   Edit
proc toString(d: DateTime): cstring {.importjs, ...raises: [], tags: [].}
  Source   Edit
proc trunc(m: MathLib; f: SomeFloat): int {.importjs, ...raises: [], tags: [].}
  Source   Edit
proc UTC(d: DateLib): int {.importjs, ...raises: [], tags: [].}
  Source   Edit