Some type imports (interfaces) (#2887)

* Some type imports (interfaces)

* Additional

* Additional

* Small movements/fixes

* Additional

* Additional

* Unsaved...
This commit is contained in:
Jaco Greeff
2020-12-02 10:12:19 +01:00
committed by GitHub
parent 2769336344
commit 0e52e8fe23
342 changed files with 887 additions and 837 deletions
@@ -1,7 +1,7 @@
// Copyright 2017-2020 @polkadot/api-derive authors & contributors
// SPDX-License-Identifier: Apache-2.0
import { ApprovalFlag } from '@polkadot/types/interfaces';
import type { ApprovalFlag } from '@polkadot/types/interfaces';
import { TypeRegistry } from '@polkadot/types/create';
@@ -1,9 +1,8 @@
// Copyright 2017-2020 @polkadot/api-derive authors & contributors
// SPDX-License-Identifier: Apache-2.0
import { ApprovalFlag } from '@polkadot/types/interfaces/elections';
import { Vec } from '@polkadot/types';
import type { ApprovalFlag } from '@polkadot/types/interfaces/elections';
import type { Vec } from '@polkadot/types';
/** @internal */
export function approvalFlagsToBools (flags: Vec<ApprovalFlag> | ApprovalFlag[]): boolean[] {
@@ -19,7 +18,9 @@ export function approvalFlagsToBools (flags: Vec<ApprovalFlag> | ApprovalFlag[])
});
// slice off trailing "false" values, as in substrate
const lastApproval: number = bools.lastIndexOf(true);
const lastApproval = bools.lastIndexOf(true);
return lastApproval >= 0 ? bools.slice(0, lastApproval + 1) : [];
return lastApproval >= 0
? bools.slice(0, lastApproval + 1)
: [];
}
+1 -1
View File
@@ -1,7 +1,7 @@
// Copyright 2017-2020 @polkadot/api-derive authors & contributors
// SPDX-License-Identifier: Apache-2.0
import { DeriveCache } from './types';
import type { DeriveCache } from './types';
import { deriveNoopCache } from './cacheImpl';
+1 -1
View File
@@ -1,7 +1,7 @@
// Copyright 2017-2020 @polkadot/api-derive authors & contributors
// SPDX-License-Identifier: Apache-2.0
import { DeriveCache } from './types';
import type { DeriveCache } from './types';
const mapCache = new Map<string, any>();
+3 -1
View File
@@ -1,8 +1,10 @@
// Copyright 2017-2020 @polkadot/api-derive authors & contributors
// SPDX-License-Identifier: Apache-2.0
import type { Observer, TeardownLogic } from 'rxjs';
import createMemo from 'memoizee';
import { Observable, Observer, TeardownLogic } from 'rxjs';
import { Observable } from 'rxjs';
import { drr, normalizer } from '@polkadot/rpc-core/util';
type ObsFn <T> = (...params: any[]) => Observable<T>;