Comments (3)
Definitely, I am still vetting couple options, but the best way that I can come with extending the class like this
import nucleoid, { Prototype } from "nucleoidjs";
const app = nucleoid();
class User extends Prototype {
name: string;
constructor(name: string) {
super();
this.name = name;
}
}
app.post("/users", () => User.filter((u) => u.name === "Daphne"));
from nucleoid.
The way I understand this is that when I register a class I get static helper methods on the class in runtime but these do not exist in the code itself, nor their type declarations.
That is right, the runtime rerenders JavaScript and creates graph (all of them happens at the runtime tho). It provides some shortcuts like turning class into array in order to query like in database table. Since all of them happening at the runtime, it is quite conflicts with TypeScript, which is compile time.
from nucleoid.
I think an extendible prototype solution would be the cleanest. I would be easy to read and understand, while not clashing with ide's
from nucleoid.
Related Issues (11)
- Generate OpenAPI inside home folder
- Navigation problem HOT 19
- Split context from OpenAPI
- GrammarError in Home page HOT 1
- Less code snippets in Readme file HOT 2
- ES6 Modules
- How can I run multiple instances of my server and keep data consistency?
- Deprecate Run APIs HOT 1
- Python Support HOT 1
- TypeScript Support
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from nucleoid.