ivi-core
TypeScript icon, indicating that this package has built-in type declarations

0.14.0 • Public • Published

ivi Core Package

ivi-core package provides reusable code for browser and server environments.

Data Types

type Context<T = {}> = T;

Context.

Constants

Key Codes

const enum KeyCode {
  WinKeyFFLinux = 0,
  MacEnter = 3,
  Backspace = 8,
  Tab = 9,
  Clear = 12,
  ...
}

KeyboardEvent keyCode values.

Key Location

const enum KeyLocation {
  Standard = 0,
  Left = 1,
  Right = 2,
  NumPad = 3,
  Mobile = 4,
  Joystick = 5,
}

KeyboardEvent keyLocation values.

Mouse Buttons

const enum MouseButtons {
  Left = 1,
  Right = 1 << 1,
  Middle = 1 << 2,
  Fourh = 1 << 3,
  Fifth = 1 << 4,
}

MouseEvent buttons flags.

Data Structures

Arrays

function unorderedArrayDelete<T>(array: T[], index: number): void;

unorderedArrayDelete() deletes element from an array with O(1) complexity.

Repeatable Task List

type RepeatableTaskList = Array<() => boolean | undefined>;
function runRepeatableTasks(tasks: RepeatableTaskList);

RepeatableTaskList is a data structure for tasks that will be repeated until they return true value.

runRepeatableTasks() runs repeatable tasks.

Readme

Keywords

Package Sidebar

Install

npm i ivi-core

Weekly Downloads

2

Version

0.14.0

License

MIT

Unpacked Size

336 kB

Total Files

165

Last publish

Collaborators

  • localvoid