Packages

t

korolev.Context

BaseAccess

trait BaseAccess[F[_], S, M] extends AnyRef

Linear Supertypes
AnyRef, Any
Known Subclasses
Ordering
  1. Alphabetic
  2. By Inheritance
Inherited
  1. BaseAccess
  2. AnyRef
  3. Any
  1. Hide All
  2. Show All
Visibility
  1. Public
  2. Protected

Abstract Value Members

  1. abstract def downloadFileAsStream(handler: FileHandler): F[Stream[F, Bytes]]

    Download file from the client side by file handler

  2. abstract def downloadFiles(id: ElementId): F[List[(FileHandler, Bytes)]]

    Download the selected file list from input appropriate to given element id.

    Download the selected file list from input appropriate to given element id. Use this method carefully because all files are saving to RAM.

  3. abstract def downloadFilesAsStream(id: ElementId): F[List[(FileHandler, Stream[F, Bytes])]]

    Same as downloadFiles but for stream mode.

    Same as downloadFiles but for stream mode. The method is useful when user want to upload very large files list which is problematic to keep in memory (especially when count of users is more than one).

  4. abstract def downloadFormData(id: ElementId): F[FormData]

    Downloads form from the client.

    Downloads form from the client. Useful when when you want to read big amount of fields. Do not use this method for downloading files, however it is possible.

    event(submit) { access =>
      access
        .downloadFormData(myForm)
        .flatMap { formData =>
          val picture = data.file("picture") // Array[Byte]
          val title = data.text("title") // String
          access.transition {
            // ... transtion
          }
        }
    }
    id

    form elementId

  5. abstract def evalJs(code: JsCode): F[String]

    Execute arbitrary JavaScript code on client and get stringified JSON back.

    Execute arbitrary JavaScript code on client and get stringified JSON back.

    for {
      _ <- access.evalJs("new Date().getTimezoneOffset()").map(offset => ...)
      _ <- access.evalJs(js"$myForm.submit()").map(offset => ...)
    } yield ()
  6. abstract def focus(id: ElementId): F[Unit]

    Makes focus on the element

  7. abstract def imap[S2](map: PartialFunction[S, S2], contramap: PartialFunction[(S, S2), S]): Access[F, S2, M]
  8. abstract def listFiles(id: ElementId): F[List[FileHandler]]

    Get only file list for input

  9. abstract def property(id: ElementId): PropertyHandler[F]

    Extracts property of element from client-side DOM.

    Extracts property of element from client-side DOM.

    Example:
    1. event('click) { access =>
        for {
          request <- access.property(searchField).get('value)
          result  <- searchModel.search(request)
          _       <- access.transition {
            case state: State.Awesome =>
              state.copy(list = searchResult)
          }
        } yield ()
      }
    Since

    0.6.0

    See also

    Scope.elementId

  10. abstract def publish(message: M): F[Unit]

    Publish message to environment.

  11. abstract def registerCallback(name: String)(f: (String) => F[Unit]): F[Unit]

    Register callback that could be invoked from the client side.

    Register callback that could be invoked from the client side.

    // Scala
    access.registerCallback("myCallback") { myArg =>
      Future(println(myArg))
    }
    
    // JavaScript
    Korolev.invokeCallback('myCallback', 'myArgValue');
  12. abstract def resetForm(id: ElementId): F[Unit]

    Purge inputs in given form.

    Purge inputs in given form.

    id

    form element id binding

  13. abstract def sessionId: F[Qsid]

    Gives current session id.

  14. abstract def state: F[S]

    Gives current state.

  15. abstract def syncTransition(f: Transition[S]): F[Unit]

    Applies transition to current state and awaits render.

  16. abstract def transition(f: Transition[S]): F[Unit]

    Applies transition to current state.

  17. abstract def uploadFile(name: String, stream: Stream[F, Bytes], size: Option[Long], mimeType: String = MimeTypes.`application/octet-stream`): F[Unit]

    Upload stream to the client side with selected name, size and mimeType

Concrete Value Members

  1. final def !=(arg0: Any): Boolean
    Definition Classes
    AnyRef → Any
  2. final def ##: Int
    Definition Classes
    AnyRef → Any
  3. final def ==(arg0: Any): Boolean
    Definition Classes
    AnyRef → Any
  4. final def asInstanceOf[T0]: T0
    Definition Classes
    Any
  5. def clone(): AnyRef
    Attributes
    protected[lang]
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.CloneNotSupportedException]) @native() @IntrinsicCandidate()
  6. final def eq(arg0: AnyRef): Boolean
    Definition Classes
    AnyRef
  7. def equals(arg0: AnyRef): Boolean
    Definition Classes
    AnyRef → Any
  8. def evalJs(code: String): F[String]
  9. final def getClass(): Class[_ <: AnyRef]
    Definition Classes
    AnyRef → Any
    Annotations
    @native() @IntrinsicCandidate()
  10. def hashCode(): Int
    Definition Classes
    AnyRef → Any
    Annotations
    @native() @IntrinsicCandidate()
  11. def imap[S2](lens: Lens[S, S2]): Access[F, S2, M]
  12. final def isInstanceOf[T0]: Boolean
    Definition Classes
    Any
  13. final def maybeTransition(f: PartialFunction[S, S]): F[Unit]

    Applies transition to current state.

  14. final def ne(arg0: AnyRef): Boolean
    Definition Classes
    AnyRef
  15. final def notify(): Unit
    Definition Classes
    AnyRef
    Annotations
    @native() @IntrinsicCandidate()
  16. final def notifyAll(): Unit
    Definition Classes
    AnyRef
    Annotations
    @native() @IntrinsicCandidate()
  17. final def property(id: ElementId, propName: String): F[String]

    Shortcut for property(id).get(propName).

    Shortcut for property(id).get(propName).

    Since

    0.13.0

  18. final def synchronized[T0](arg0: => T0): T0
    Definition Classes
    AnyRef
  19. def toString(): String
    Definition Classes
    AnyRef → Any
  20. final def valueOf(id: ElementId): F[String]

    Shortcut for property(id).get('value).

    Shortcut for property(id).get('value).

    Since

    0.6.0

  21. final def wait(arg0: Long, arg1: Int): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.InterruptedException])
  22. final def wait(arg0: Long): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.InterruptedException]) @native()
  23. final def wait(): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.InterruptedException])

Deprecated Value Members

  1. def finalize(): Unit
    Attributes
    protected[lang]
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.Throwable]) @Deprecated
    Deprecated
  2. final def property(id: ElementId, propName: Symbol): F[String]

    Shortcut for property(id).get(propName).

    Shortcut for property(id).get(propName).

    Annotations
    @deprecated
    Deprecated

    (Since version 0.13.0) Use "propertyName" instead of 'propertyName

    Since

    0.6.0

Inherited from AnyRef

Inherited from Any

Ungrouped