https://github.com/exeteres/opc-types
OpenComputers and TypeScript
https://github.com/exeteres/opc-types
opencomputers openos typescript typings
Last synced: 29 days ago
JSON representation
OpenComputers and TypeScript
- Host: GitHub
- URL: https://github.com/exeteres/opc-types
- Owner: Exeteres
- License: mit
- Created: 2020-01-04T12:17:42.000Z (over 5 years ago)
- Default Branch: master
- Last Pushed: 2022-12-12T13:47:37.000Z (over 2 years ago)
- Last Synced: 2025-05-07T07:42:17.677Z (29 days ago)
- Topics: opencomputers, openos, typescript, typings
- Homepage:
- Size: 604 KB
- Stars: 21
- Watchers: 2
- Forks: 7
- Open Issues: 8
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- License: LICENSE
Awesome Lists containing this project
README
# OpenComputers and TypeScript
![]()
![]()
## Introduction
This repository contains type declarations for [OpenOS](https://ocdoc.cil.li/) and [GUI](https://github.com/IgorTimofeev/GUI) (and also some of it dependencies).
It is assumed that you will use [TypeScriptToLua](https://github.com/TypeScriptToLua/TypeScriptToLua) as a transpiler.
Some examples can be found in the `examples` folder. Also look at [VSCode extension](https://github.com/Exeteres/oc-ts-extension), which integrates TypeScript with OpenComputers.
## Installation
```shell
# Typings for OpenOS
yarn add @opct/openos # or npm install @opct/openos -S# Typings for MineOS
yarn add @opct/mineos# Typings for GUI
yarn add @opct/gui# TSTL
yarn add typescript-to-lua
``````json
// tsconfig.json
{
"compilerOptions": {
"target": "esnext",
"outDir": "dist",
"module": "commonjs",
"lib": ["esnext"],
"strict": true,
"moduleResolution": "node",
"rootDir": "src",
"types": [
"lua-types/jit",
"@opct/openos",
"@opct/gui",
"@opct/mineos"
]
},
"tstl": {
"luaTarget": "JIT"
}
}
```## Setting up a comfortable working environment
- You can use Visual Studio Code or any other editor with TypeScript support.
- Instead of a real mod, you can use an emulator. Otherwise, it is necessary to set `filesystem.bufferChanges` to `false` in order to have external access to the disk.
- Create a link to the disk to keep the source code separate from it:```shell
# linux / macos
ln -s /path/to/disk/home/app dist
``````cmd
# windows (cmd)
mklink /j dist C:\path\to\disk\home
```- Use `tstl --watch`