true when QbitRpcClient fits Copy, an interface a consumer declares
for the client, strictly enough that every call Copy allows is one the
client takes. Otherwise an object with each member of Copy that does not
fit, and why:
missing: the client has no such member. A member optional in Copy
(confirmChain?()) may be missing; check Required<Copy> to require it.
returns: what the client's method returns is not assignable to what
Copy's returns.
parameters: Copy allows arguments the client does not take. They are
compared both ways: the arguments Copy allows must be assignable to the
client's parameters, compared strictly rather than bivariantly, as
TypeScript compares methods; and they may hold no key, at any depth, that
the client's parameter there does not declare (UndeclaredKeys). So
call options (signal, timeoutMs) declared in a method's own options
do not fit: the client takes them in a separate, last argument, and
refuses them in the options with a TypeError.
type: a member that is not a method has a type the client's is not
assignable to, or one of the two is a method and the other is not.
Limits, where TypeScript gives the type nothing to compare:
Overloads: only the last signature of an overloaded member is checked.
Declare one signature per member.
Generic methods: a generic signature is compared at its constraints, so
a copy's generic method can pass where a call through it would not, and
the client's generic batch reports returns for a copy that
specializes it. Declare copies without type parameters.
Outpoints: lockUnspent and unlockUnspent accept a typed result with
its extra fields at run time, but declare { txid, vout }; a copy that
declares the extras reports parameters.
Check it in the consumer's type tests, which its CI compiles:
truewhenQbitRpcClientfitsCopy, an interface a consumer declares for the client, strictly enough that every callCopyallows is one the client takes. Otherwise an object with each member ofCopythat does not fit, and why:missing: the client has no such member. A member optional inCopy(confirmChain?()) may be missing; checkRequired<Copy>to require it.returns: what the client's method returns is not assignable to whatCopy's returns.parameters:Copyallows arguments the client does not take. They are compared both ways: the argumentsCopyallows must be assignable to the client's parameters, compared strictly rather than bivariantly, as TypeScript compares methods; and they may hold no key, at any depth, that the client's parameter there does not declare (UndeclaredKeys). So call options (signal,timeoutMs) declared in a method's own options do not fit: the client takes them in a separate, last argument, and refuses them in the options with aTypeError.type: a member that is not a method has a type the client's is not assignable to, or one of the two is a method and the other is not.Limits, where TypeScript gives the type nothing to compare:
batchreportsreturnsfor a copy that specializes it. Declare copies without type parameters.lockUnspentandunlockUnspentaccept a typed result with its extra fields at run time, but declare{ txid, vout }; a copy that declares the extras reportsparameters.Check it in the consumer's type tests, which its CI compiles: