# typesl

> **TypeSL** (**Type**script **S**hader **L**anguage) enables Typescript -> GLSL Transpile.

Latest version **0.4.0** (published 2022-11-08) · MIT license · 0 weekly downloads

## Install

```sh
npm install typesl
pnpm add typesl
yarn add typesl
bun add typesl
```

Provides the command `tslc`.

## Health

**Score 20/100 (F)** — status: abandoned.

Positive: has types; no vulnerabilities.

Warnings: low downloads; no esm support; pre 1.0.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 0.4.0 |
| Published | 2022-11-08 |
| First published | 2022-08-21 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | bundled |
| Module format | CommonJS |
| Dependencies | 3 |
| Unpacked size | 108.9 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 23 |
| Maintainers | sier-vr |

## Links

- npm: https://www.npmjs.com/package/typesl
- Repository: https://github.com/SieR-VR/typesl
- Homepage: https://github.com/SieR-VR/typesl#readme
- Issues: https://github.com/SieR-VR/typesl/issues
- npm.io page: https://npm.io/package/typesl

## Dependencies (3)

- [typescript](https://npm.io/package/typescript.md) ^4.7.4
- [ttypescript](https://npm.io/package/ttypescript.md) ^1.5.13
- [transformer-query](https://npm.io/package/transformer-query.md) ^0.3.3

## Recent versions

- 0.4.0 (latest) — 2022-11-08
- 0.3.3 — 2022-08-22
- 0.3.2 — 2022-08-22
- 0.3.1 — 2022-08-22
- 0.3.0 — 2022-08-22
- 0.2.11 — 2022-08-22
- 0.2.10 — 2022-08-22
- 0.2.1 — 2022-08-22
- 0.2.0 — 2022-08-22
- 0.1.0 — 2022-08-21

## README

# TypeSL

**TypeSL** (**Type**script **S**hader **L**anguage) enables Typescript -> GLSL Transpile.

<!-- TABLE OF CONTENTS -->
<details>
  <summary>Table of Contents</summary>
  <ol>
    <li>
      <a href="#typesl">TypeSL</a>
    </li>
    <li>
      <a href="#getting-started">Getting Started</a>
      <ul>
        <li><a href="#prerequisites">Prerequisites</a></li>
        <li><a href="#installation">Installation</a></li>
      </ul>
    </li>
    <li><a href="#usage">Usage</a></li>
    <li><a href="#roadmap">Roadmap</a></li>
    <li><a href="#contributing">Contributing</a></li>
    <li><a href="#license">License</a></li>
  </ol>
</details>

# Example

```typescript

vert(attribute: RectangleAttribute, uniform: RectangleUniform): RectangleVarying {
    const positionVec4 = new Vec4(attribute.aPosition, 1.0);
    this.gl_Position = uniform.uProjectionMatrix * uniform.uModelViewMatrix * positionVec4;

    return {
        vTexCoord: attribute.aTexCoord
    };
}

```

transpiles to

```glsl

#version 300 es
precision highp float;

attribute vec3 aPosition;
attribute vec2 aTexCoord;

varying vec2 vTexCoord;

uniform mat4 uProjectionMatrix;
uniform mat4 uModelViewMatrix;

void main() {
    vec4 positionVec4 = vec4(aPosition, 1.0);
    gl_Position = uProjectionMatrix * uModelViewMatrix * positionVec4;
    vTexCoord = aTexCoord;
}

```

# Getting Started

## Prerequisites

1. [NodeJS](https://nodejs.org)

> NodeJS is a javascript runtime. This will enables run tslc.

2. [npm](https://www.npmjs.com/)

> npm (Node Package Manager) is package manager for nodejs, you need this for install TypeSL transpiler.

## Installation

```
npm install (-g) typesl
```

or

```
yarn (global) add typesl
```

# Usage

```
tslc {target file}
```

# Roadmap

- CLI support (sorry)
- Fragment shader (sorry)
- Geometry shader
- Operator methods
- Core profile

# Contributing

Pull request and issues always open!

# License

MIT License

---
_Source: https://npm.io/package/typesl · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
