Some type imports (interfaces) (#2887)
* Some type imports (interfaces) * Additional * Additional * Small movements/fixes * Additional * Additional * Unsaved...
This commit is contained in:
@@ -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,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,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>();
|
||||
|
||||
|
||||
@@ -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>;
|
||||
|
||||
Reference in New Issue
Block a user