@depla/reka-types
TypeScript icon, indicating that this package has built-in type declarations

0.1.10 • Public • Published

@depla/reka-types

Package for creating and interacting with Reka data types (ie: the AST and the View)

Installation

npm install @depla/reka-types

Creating a new Type

To create a new type, use the builder function which will return a new Type instance:

import * as t from '@depla/reka-types';

// Using the builder function
const literal = t.literal({
    value: 0
});
// or manually: new Literal({ value: 0 })

Checking an instance's type

import * as t from '@depla/reka-types';

const literal = t.literal({ value : 0 });

console.log(literal instanceof t.Literal); // true
console.log(literal instanceof t.Expression); // true
console.log(literal instanceof t.RekaComponent); // false

Readme

Keywords

none

Package Sidebar

Install

npm i @depla/reka-types

Weekly Downloads

1

Version

0.1.10

License

MIT

Unpacked Size

215 kB

Total Files

44

Last publish

Collaborators

  • sergeylukin