Use tsconfig references (#4328)
* Use tsconfig references * Move types-known (temp until lower-level split) * Sources * Adjust * tesconfig.eslint.json * Bumps * AdjustAdjust * Linting passing... a start... * Adjust * Merge derive * Merge * api-contract-support * It builds? * compare locations
This commit is contained in:
@@ -92,7 +92,7 @@ describe('Cached Observables', (): void => {
|
||||
it('creates different observables for different methods but same arguments', (): void => {
|
||||
// params do not match here
|
||||
// eslint-disable-next-line @typescript-eslint/no-unsafe-assignment,@typescript-eslint/no-unsafe-call,@typescript-eslint/no-unsafe-member-access
|
||||
const observable1 = (rpc.chain as any).subscribeNewHeads([123]);
|
||||
const observable1 = (rpc.chain).subscribeNewHeads([123]);
|
||||
const observable2 = rpc.state.subscribeStorage([123]);
|
||||
|
||||
expect(observable2).not.toBe(observable1);
|
||||
|
||||
@@ -1,4 +1,12 @@
|
||||
// Copyright 2017-2021 @polkadot/rpc-core authors & contributors
|
||||
// SPDX-License-Identifier: Apache-2.0
|
||||
|
||||
import type { AugmentedRpc } from './types';
|
||||
|
||||
export interface RpcInterface {
|
||||
[section: string]: {
|
||||
[method: string]: AugmentedRpc<(...params: any[]) => any>;
|
||||
}
|
||||
}
|
||||
|
||||
export const __PHANTOM_RPC = 'phantom-rpc';
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
// SPDX-License-Identifier: Apache-2.0
|
||||
|
||||
import type { Observable } from 'rxjs';
|
||||
import type { Codec, DefinitionRpc } from '@polkadot/types/types';
|
||||
import type { AnyFunction, Codec, DefinitionRpc } from '@polkadot/types/types';
|
||||
|
||||
export * from '@polkadot/rpc-core/types.jsonrpc';
|
||||
|
||||
@@ -11,3 +11,8 @@ export interface RpcInterfaceMethod {
|
||||
raw (...params: unknown[]): Observable<unknown>;
|
||||
meta: DefinitionRpc;
|
||||
}
|
||||
|
||||
export type AugmentedRpc<F extends AnyFunction> = F & {
|
||||
raw: <T> (...params: Parameters<F>) => Observable<T>;
|
||||
meta: DefinitionRpc;
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user