Skip to content

Types: autogeneration ideas #41

Open
@lostrepo

Description

@lostrepo

Current dynamic type chains

Native lib types: lib/<name>/api.js => lib/apis.all.d.ts => globals.d.ts
Imports: <some path>.d.ts or <some path>.js

Current type generation file

lib/types.js

Wants:

  • 1. Self-sufficient single globals.d.ts:
  • 1.1. Autogenerated static interfaces for Native libs (https://github.com/lostrepo/lo/tree/feat/static/typegen | standalone globals.d.ts: lo lib/test.js > globals.d.ts)
  • 1.2. Manual declare "lib/<name>.js" { ... } types for lib/<name>.js
  • 2. Debatable. Current Native lib types chain without lib/apis.all.d.ts on top of (1). Replacement types, not overrides. For real-time types during development phase of Native lib api for lo or user project. Ideally need this feature to pick lib/<name>/api.js with lo.load/lo.library(<name>) so won't need to search file system for relevant names beforehand
  • 3. globals.d.ts segments:
  • 3.1. User types
  • 3.2. (1.2)
  • 3.3. Base types
  • 3.4. (1.1) and other autogenerated stuff
  • 3.5. (2). Generate segment using lo type <config.js path> --dev or something like that. Empty as first step before build (maybe just find offset to exclude segment from embed). Expose relevant method(s) in lib/types.js

Metadata

Metadata

Labels

planningIssues related to future plans/proposals

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions