Improve selene type definitions

This commit is contained in:
Filip Tibell 2023-01-29 20:16:17 -05:00
parent 091c73038f
commit aa95fa2234
No known key found for this signature in database
2 changed files with 30 additions and 0 deletions

View file

@ -5,6 +5,17 @@ All notable changes to this project will be documented in this file.
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
## Unreleased
### Changed
- Improved type definitions file for Selene, now including constants like `process.env` + tags such as `readonly` and `mustuse` wherever applicable
### Fixed
- Fixed type definitions file for Selene not including all API members and parameters
- Fixed `process.exit` exiting at the first yield instead of exiting instantly as it should
## `0.2.0` - January 28th, 2023
### Added

View file

@ -3,14 +3,17 @@
globals:
# Console
console.resetColor:
args: []
console.setColor:
args:
- type: string
console.resetStyle:
args: []
console.setStyle:
args:
- type: string
console.format:
must_use: true
args:
- type: "..."
console.log:
@ -27,9 +30,11 @@ globals:
- type: "..."
# FS (filesystem)
fs.readFile:
must_use: true
args:
- type: string
fs.readDir:
must_use: true
args:
- type: string
fs.writeFile:
@ -46,24 +51,34 @@ globals:
args:
- type: string
fs.isFile:
must_use: true
args:
- type: string
fs.isDir:
must_use: true
args:
- type: string
# Net (networking)
net.jsonEncode:
must_use: true
args:
- type: any
- required: false
type: boolean
net.jsonDecode:
must_use: true
args:
- type: string
net.request:
args:
- type: any
# Processs
process.args:
property: read-only
process.cwd:
property: read-only
process.env:
property: new-fields
process.exit:
args:
- required: false
@ -73,8 +88,12 @@ globals:
- type: string
- required: false
type: table
- required: false
type: table
# Task
task.cancel:
args:
- type: thread
task.defer:
args:
- type: thread | function