API optional augmentation (#4355)

* API optional augmentation

* Rebuild

* Rebuild

* Cleanups

* Adjust, no multi-imports

* Adjust

* Adjust

* Dedupe

* Augmented exports

* It builds via references (no circulars)

* Don't output *.manual.{js,cjs}
This commit is contained in:
Jaco
2021-12-19 21:30:34 +02:00
committed by GitHub
parent fe27d8059e
commit 3d4511607f
90 changed files with 282 additions and 322 deletions
-1
View File
@@ -2,4 +2,3 @@
// SPDX-License-Identifier: Apache-2.0
import '@polkadot/api-augment';
import '@polkadot/rpc-augment';
+2 -1
View File
@@ -1,8 +1,9 @@
// Copyright 2017-2021 @polkadot/api-derive authors & contributors
// SPDX-License-Identifier: Apache-2.0
import type { DeriveCustom } from '@polkadot/api-base/types';
import type { AnyFunction } from '@polkadot/types/types';
import type { DeriveCustom, ExactDerive } from './derive';
import type { ExactDerive } from './derive';
import type { DeriveApi } from './types';
import { lazyDeriveSection } from './util/lazy';
+1 -1
View File
@@ -1,7 +1,7 @@
// Copyright 2017-2021 @polkadot/api-derive authors & contributors
// SPDX-License-Identifier: Apache-2.0
import './augment';
import '@polkadot/api-augment';
import { derive } from '.';
-5
View File
@@ -1,7 +1,6 @@
// Copyright 2017-2021 @polkadot/api-derive authors & contributors
// SPDX-License-Identifier: Apache-2.0
import type { Observable } from 'rxjs';
import type { AnyFunction } from '@polkadot/types/types';
import * as accounts from './accounts';
@@ -34,8 +33,4 @@ type DeriveAllSections<AllSections> = {
[S in keyof AllSections]: DeriveSection<AllSections[S]>
};
type DeriveCreator = (instanceId: string, api: unknown) => (...args: unknown[]) => Observable<any>;
export type DeriveCustom = Record<string, Record<string, DeriveCreator>>;
export type ExactDerive = DeriveAllSections<typeof derive>;