Skip to content

Latest commit

 

History

History
97 lines (63 loc) · 2.36 KB

Dev.md

File metadata and controls

97 lines (63 loc) · 2.36 KB

@squirrel-forge/ui-util

Back to table of contents

Documentation

Javascript / Dev

Array <[ Dev ]> DOM

Table of contents


ConsoleInterceptor

ConsoleInterceptor class - Drop-in replacement for window.console making output controllable.

Class overview

class ConsoleInterceptor extends EventDispatcher {
  constructor( options, debug ) {}
  console : Console // Native console
  native : Boolean // Log to native status
  events : Boolean // Log to events status
  detach() {} // Boolean
}

For more details check the ConsoleInterceptor source file.

Events

  • debug.{console.method} - Fired when a given {console.method} is called, as in "debug.log" or "debug.error".

tabFocus

tabFocus - Display outline on focused elements

Description

tabFocus( style = '2px dashed deeppink', offset = '4px', log = true ) // Function

Binds a global event to highlight elements focused by keyboard control and returns a callback to unbind.

Parameters

Parameter Type Default Description
style String '2px dashed deeppink' CSS outline style
offset String '4px' CSS outline offset
log Boolean true Log focused element to console

Return Values

Type/Value Description
Function Callback to remove tabFocus

Examples

const disableTabFocus = tabFocus(); // Enable tab focus debug
disableTabFocus(); // Disable tab focus debug

TestRunner

TestRunner class - Basic test wrapper for frontend code.

Class overview

class TestRunner {
    constructor( render ) {}
    render : Console // Native console or other output object
    run( test ) {} // TRTestResult[]
    display( results ) {} // void
}

For more details check the ConsoleInterceptor source file.


Array <[ Dev ]> DOM