Comments (1)
I've fixed the error by shifting the Readonly
type wrapper from Driver.Promisive
to Driver
. Therefore, the error has been fixed. From the [email protected]
update, there would not be any error in the [email protected]
environment.
By the way, there's not any difference between below two codes, but TypeScript v3.9.2 compiler draws different results. I need to study the detailed reason and write an issue to the TypeScript, with much easier sample code than below:
Before Patch - Be Compile Error
The Readonly
type is wrapping the Driver.Promisive
type from the inside.
export type Driver<Controller extends object, Parametric extends boolean = false>
= Driver.Promisive<Controller, Parametric>;
export namespace Driver
{
export type Promisive<Instance extends object, UseParametric extends boolean = false> = Readonly<
{
[P in keyof Instance]: Instance[P] extends Function
? Functional<Instance[P], UseParametric> // function, its return type would be capsuled in the Promise
: value_of<Instance[P]> extends object
? Instance[P] extends object
? Promisive<Instance[P], UseParametric> // object would be promisified
: never // cannot be
: never // atomic value
} & IRemoteObject>;
}
After Patch - No Error
The Readonly
type is wrapping Driver.Promisive
type from the outside by the Driver
type.
export type Driver<Controller extends object, Parametric extends boolean = false>
= Readonly<Driver.Promisive<Controller, Parametric>>;
export namespace Driver
{
export type Promisive<Instance extends object, UseParametric extends boolean = false> =
{
[P in keyof Instance]: Instance[P] extends Function
? Functional<Instance[P], UseParametric> // function, its return type would be capsuled in the Promise
: value_of<Instance[P]> extends object
? Instance[P] extends object
? Promisive<Instance[P], UseParametric> // object would be promisified
: never // cannot be
: never // atomic value
};
}
from tgrid.
Related Issues (20)
- Generate d.ts files for faye-websocket HOT 1
- Headers info when connecting to a web-socket server
- Enhance WebConnector.connect() method through Latch
- Add headers in every connection method
- Strict Generic Definition
- WorkerServer.getHeaders(): Promise<Headers>
- Refactor communicator classes to use abstract connector and acceptor
- Refactor connector classes to assign header in the constructor level.
- Refactor API Docs
- Support default import statement
- WebServer.close() waits all clients to be disconnected.
- Test whether all of the features are exported without any omission
- Change all the let symbols to be const if possible
- Move internal types of Driver to independent typings module
- Connector.connect() with detailed options through the object type
- Update for the [email protected]
- `Worker` to support both `thread` and `process` mode
- Import NodeJS only module wrapper for browser
- ESLint and Prettier
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 tgrid.