Hi there! I am trying to use generic type in React.ComponentClass's props
The example I have right now is:
import React from 'react';
interface A {
a: number;
}
function foo(param: React.ComponentClass<A>) {
return param;
}
function foobar<T extends A >(param: React.ComponentClass<T>) {
foo(param);
}
But it faile as this issue discribed: DefinitelyTyped/DefinitelyTyped#47824 Does anybody know how to solve this problem?
@mbergwall2222 You could always use the web interface to add those on your own fork, create a subsequent commit with tests, and then create a PR that way. I've done that a few times on other projects where I felt excessively lazy. But in any case, there really isn't a way to avoid the PR process - it's there for a reason.
I'm not a DT maintainer or a TS core dev, just someone somewhat familiar with their process and has been active in OSS in general for a while.
Model.updateOne(filter, doc)
should accept objects within an object (such as { $inc: { count: 1 } }
), however its typing doesn't allow this usage (although it's supported by Mongoose and is being widely used now).error TS2322: Type 'Number' is not assignable to type 'undefined'.
update{one|many}
and the findOneAndUpdate
methods ?
Hello all ! I tried using @types/koa-session with Koa but i have extends Koa context via
declare module 'koa' {
interface Context {
}
}
and i get the following error :
Argument of type 'import<DefaultState, Context>' is not assignable to parameter of type 'import<DefaultState, DefaultContext>'.
Types of property 'middleware' are incompatible.
how can i handle that ?
conn.sobject("Contact")
.find(
// conditions in JSON object
{ LastName : { $like : 'A%' },
CreatedDate: { $gte : jsforce.Date.YESTERDAY },
'Account.Name' : 'Sony, Inc.' },
// fields in JSON object
{ Id: 1,
Name: 1,
CreatedDate: 1 }
)
.sort({ CreatedDate: -1, Name : 1 })
.limit(5)
.skip(10)
.execute(function(err, records) {
if (err) { return console.error(err); }
console.log("fetched : " + records.length);
});
I made a PR for "big.js" 9 days ago. None of the three definition owners have reviewed the PR yet. One of the definition owners explicitly stated they hadn't used the library in a couple years and didn't feel comfortable reviewing.
How do I make progress on getting the PR merged?
$ npm test serve-static
> definitely-typed@0.0.3 test /home/chris/projects/DefinitelyTyped
> dtslint types "serve-static"
Error: /home/chris/projects/DefinitelyTyped/types/serve-static/serve-static-tests.ts:19:9
ERROR: 19:9 expect TypeScript@4.2 expected type to be:
Response<any, number>
got:
Response<never, number>
ERROR: 49:9 expect TypeScript@4.2 expected type to be:
Response<any, number>
got:
Response<never, number>
at /home/chris/projects/DefinitelyTyped/node_modules/dtslint/bin/index.js:206:19
at Generator.next (<anonymous>)
at fulfilled (/home/chris/projects/DefinitelyTyped/node_modules/dtslint/bin/index.js:6:58)
npm ERR! Test failed. See above for more details.
I'd like to report an issue with the review flow. I believe typescript-bot
requested a re-review unnecessarily in my PR: DefinitelyTyped/DefinitelyTyped#50378
What happened:
doberkofler
) accepted.eps1lon
) requested changes.typescript-bot
requested that Maintainer 1 re-review and accept the changes.Step 6 seems like a mistake, since Maintainer 2 has already accepted the latest changes.
Typescript Bot issue:
typescript-bot
keep saying "I'm ready to merge this PR...", I commented "Ready to merge" as requested buttypescript-boot
respond again with the same message "I'm ready to merge this PR...". This seems to go in a loop and I can't merge the PR.The bot seems to be broken here?
Tried again and the PR is merged now. All good