-
-
Notifications
You must be signed in to change notification settings - Fork 47
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merge Ezno runtime definitions with existing TS definition files #121
Comments
Some thinking on Also I don't quite know the status of how much of
Taking a flick through some things
|
What does the |
For example here ezno/checker/definitions/overrides.d.ts Lines 129 to 130 in 24e35b9
and if its input are known and literal (for example 16), then it can be calculated in Rust
which is how you get the errors here. It is a slightly bit gimmicky, it can catch against some always true cases but only when you are dealing with constants. It is still WIP, some cases are changing, it is slightly abused for the
|
@kaleidawave, why is a code mod required? Why not simply parse the ES5 definitions first, then the custom definitions overwriting clashing names in memory in a similar fashion as e.g. |
Hmm that is an option, will consider! With the binary definition file system for the base definitions the duplicate work will only be at build time. |
I will have to account for slight differences in definitions. For example in interface Array<T> {
// ...
push();
}
interface ArrayConstructor {
// ...
isArray();
readonly prototype: Array<any>
}
declare var Array: ArrayConstructor; In Ezno I have been typing it with class Array<T> {
// ...
push()
static isArray() ...
} |
Currently the checker is built around definitions from this file
https://github.com/kaleidawave/ezno/blob/main/checker/definitions/overrides.d.ts
To support more of the runtime (as highlighted in #118), the checker should be able to use definitions from the TypeScript repository (such as
es5.d.ts
) to provide the same type coverage. As can be seen inoverrides.d.ts
, Ezno has some extended definitions to provide better information to the checker. What should be done is to create a tool (code mod / code modification) (similar tocode_blocks_to_script.rs
that parseses5.d.ts
but selectively overwrites with definitions inoverrides.d.ts
to produce a final definition file build.Warning
#120 (increasing the count of types and layout) is really needed to support the scale of
es5.d.ts
The text was updated successfully, but these errors were encountered: