Skip to content

Commit

Permalink
Use import type { ... } (polkadot-js#4052)
Browse files Browse the repository at this point in the history
* Use import type { ... }

* value imports

* TypeDefInfo

* Apply suggestions from code review

* fixes... am going blind.
  • Loading branch information
jacogr authored Nov 19, 2020
1 parent 79ed228 commit a0b82d8
Show file tree
Hide file tree
Showing 487 changed files with 890 additions and 876 deletions.
2 changes: 1 addition & 1 deletion packages/apps-config/src/api/bundle/spec/acala.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
// Copyright 2017-2020 @polkadot/apps-config authors & contributors
// SPDX-License-Identifier: Apache-2.0

import { OverrideBundleDefinition } from '@polkadot/types/types';
import type { OverrideBundleDefinition } from '@polkadot/types/types';

import { typesBundleForPolkadot } from '@acala-network/type-definitions';

Expand Down
2 changes: 1 addition & 1 deletion packages/apps-config/src/api/bundle/spec/laminar.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
// Copyright 2017-2020 @polkadot/apps-config authors & contributors
// SPDX-License-Identifier: Apache-2.0

import { OverrideBundleDefinition } from '@polkadot/types/types';
import type { OverrideBundleDefinition } from '@polkadot/types/types';

import { typesBundleForPolkadot } from '@laminar/type-definitions';

Expand Down
2 changes: 1 addition & 1 deletion packages/apps-config/src/api/rpc/moonbeam.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
// Copyright 2017-2020 @polkadot/apps-config authors & contributors
// SPDX-License-Identifier: Apache-2.0

import { DefinitionRpc, DefinitionRpcParam } from '@polkadot/types/types';
import type { DefinitionRpc, DefinitionRpcParam } from '@polkadot/types/types';

export default function (): Record<string, Record<string, DefinitionRpc>> {
function generateDescription (description:string, returnType:string, params:DefinitionRpcParam[] = []):DefinitionRpc {
Expand Down
2 changes: 1 addition & 1 deletion packages/apps-config/src/links/index.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
// Copyright 2017-2020 @polkadot/apps-config authors & contributors
// SPDX-License-Identifier: Apache-2.0

import { ExternalDef } from './types';
import type { ExternalDef } from './types';

import Commonwealth from './commonwealth';
import Polkascan from './polkascan';
Expand Down
2 changes: 1 addition & 1 deletion packages/apps-config/src/settings/endpoints.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
// SPDX-License-Identifier: Apache-2.0

import type { TFunction } from 'i18next';
import { LinkOption } from './types';
import type { LinkOption } from './types';

import { CUSTOM_ENDPOINT_KEY } from './constants';

Expand Down
2 changes: 1 addition & 1 deletion packages/apps-config/src/settings/languages.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
// SPDX-License-Identifier: Apache-2.0

import type { TFunction } from 'i18next';
import { Option } from './types';
import type { Option } from './types';

export function createLanguages (t: TFunction): Option[] {
return [
Expand Down
2 changes: 1 addition & 1 deletion packages/apps-config/src/settings/ss58.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
// SPDX-License-Identifier: Apache-2.0

import type { TFunction } from 'i18next';
import { Option } from './types';
import type { Option } from './types';

import known from '@polkadot/networks';

Expand Down
2 changes: 1 addition & 1 deletion packages/apps-electron/src/api/account-store-api.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
// Copyright 2017-2020 @polkadot/apps authors & contributors
// SPDX-License-Identifier: Apache-2.0

import { KeyringJson } from '@polkadot/ui-keyring/types';
import type { KeyringJson } from '@polkadot/ui-keyring/types';

export interface AccountStoreApi {
all: () => Promise<{ key: string, value: KeyringJson }[]>
Expand Down
6 changes: 4 additions & 2 deletions packages/apps-electron/src/main/account-store.spec.ts
Original file line number Diff line number Diff line change
@@ -1,11 +1,13 @@
// Copyright 2017-2020 @polkadot/apps authors & contributors
// SPDX-License-Identifier: Apache-2.0

import type { KeyringJson } from '@polkadot/ui-keyring/types';

import * as tmp from 'tmp';
import { FileStore } from '@polkadot/ui-keyring/stores';

import { accountStoreIpcHandler } from './account-store';
import { KeyringJson } from '@polkadot/ui-keyring/types';
import { IpcMainHandler } from './ipc-main-handler';
import * as tmp from 'tmp';

const exampleAccount = (address: string): KeyringJson => ({
address,
Expand Down
5 changes: 3 additions & 2 deletions packages/apps-electron/src/main/account-store.ts
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
// Copyright 2017-2020 @polkadot/apps authors & contributors
// SPDX-License-Identifier: Apache-2.0

import type { KeyringJson } from '@polkadot/ui-keyring/types';

import { app } from 'electron';
import { FileStore } from '@polkadot/ui-keyring/stores';
import { KeyringJson } from '@polkadot/ui-keyring/types';
import path from 'path';
import { FileStore } from '@polkadot/ui-keyring/stores';

import { IpcMainHandler } from './ipc-main-handler';
import { registerIpcHandler } from './register-ipc-handler';
Expand Down
3 changes: 2 additions & 1 deletion packages/apps-electron/src/preload.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
// Copyright 2017-2020 @polkadot/apps authors & contributors
// SPDX-License-Identifier: Apache-2.0

import { KeyringJson } from '@polkadot/ui-keyring/types';
import type { KeyringJson } from '@polkadot/ui-keyring/types';

import { contextBridge, ipcRenderer } from 'electron';

contextBridge.exposeInMainWorld('ElectronMain', {
Expand Down
3 changes: 2 additions & 1 deletion packages/apps-electron/src/renderer/remote-electron-store.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
// Copyright 2017-2020 @polkadot/apps authors & contributors
// SPDX-License-Identifier: Apache-2.0

import { KeyringJson, KeyringStore } from '@polkadot/ui-keyring/types';
import type { KeyringJson, KeyringStore } from '@polkadot/ui-keyring/types';

import { AccountStoreApi } from '../api/account-store-api';

export class RemoteElectronStore implements KeyringStore {
Expand Down
2 changes: 1 addition & 1 deletion packages/apps-routing/src/accounts.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
// SPDX-License-Identifier: Apache-2.0

import type { TFunction } from 'i18next';
import { Route } from './types';
import type { Route } from './types';

import Component, { useCounter } from '@polkadot/app-accounts';

Expand Down
2 changes: 1 addition & 1 deletion packages/apps-routing/src/addresses.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
// SPDX-License-Identifier: Apache-2.0

import type { TFunction } from 'i18next';
import { Route } from './types';
import type { Route } from './types';

import Component from '@polkadot/app-addresses';

Expand Down
2 changes: 1 addition & 1 deletion packages/apps-routing/src/calendar.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
// SPDX-License-Identifier: Apache-2.0

import type { TFunction } from 'i18next';
import { Route } from './types';
import type { Route } from './types';

import Component from '@polkadot/app-calendar';

Expand Down
2 changes: 1 addition & 1 deletion packages/apps-routing/src/claims.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
// SPDX-License-Identifier: Apache-2.0

import type { TFunction } from 'i18next';
import { Route } from './types';
import type { Route } from './types';

import Component, { useCounter } from '@polkadot/app-claims';

Expand Down
2 changes: 1 addition & 1 deletion packages/apps-routing/src/contracts.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
// SPDX-License-Identifier: Apache-2.0

import type { TFunction } from 'i18next';
import { Route } from './types';
import type { Route } from './types';

import Component from '@polkadot/app-contracts';

Expand Down
2 changes: 1 addition & 1 deletion packages/apps-routing/src/council.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
// SPDX-License-Identifier: Apache-2.0

import type { TFunction } from 'i18next';
import { Route } from './types';
import type { Route } from './types';

import Component, { useCounter } from '@polkadot/app-council';

Expand Down
2 changes: 1 addition & 1 deletion packages/apps-routing/src/democracy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
// SPDX-License-Identifier: Apache-2.0

import type { TFunction } from 'i18next';
import { Route } from './types';
import type { Route } from './types';

import Component, { useCounter } from '@polkadot/app-democracy';

Expand Down
2 changes: 1 addition & 1 deletion packages/apps-routing/src/explorer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
// SPDX-License-Identifier: Apache-2.0

import type { TFunction } from 'i18next';
import { Route } from './types';
import type { Route } from './types';

import Component from '@polkadot/app-explorer';

Expand Down
2 changes: 1 addition & 1 deletion packages/apps-routing/src/extrinsics.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
// SPDX-License-Identifier: Apache-2.0

import type { TFunction } from 'i18next';
import { Route } from './types';
import type { Route } from './types';

import Component from '@polkadot/app-extrinsics';

Expand Down
2 changes: 1 addition & 1 deletion packages/apps-routing/src/generic-asset.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
// SPDX-License-Identifier: Apache-2.0

import type { TFunction } from 'i18next';
import { Route } from './types';
import type { Route } from './types';

import Component from '@polkadot/app-generic-asset';

Expand Down
2 changes: 1 addition & 1 deletion packages/apps-routing/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
// SPDX-License-Identifier: Apache-2.0

import type { TFunction } from 'i18next';
import { Routes } from './types';
import type { Routes } from './types';

import accounts from './accounts';
import addresses from './addresses';
Expand Down
2 changes: 1 addition & 1 deletion packages/apps-routing/src/js.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
// SPDX-License-Identifier: Apache-2.0

import type { TFunction } from 'i18next';
import { Route } from './types';
import type { Route } from './types';

import Component from '@polkadot/app-js';

Expand Down
2 changes: 1 addition & 1 deletion packages/apps-routing/src/parachains.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
// SPDX-License-Identifier: Apache-2.0

import type { TFunction } from 'i18next';
import { Route } from './types';
import type { Route } from './types';

import Component from '@polkadot/app-parachains';

Expand Down
2 changes: 1 addition & 1 deletion packages/apps-routing/src/poll.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
// SPDX-License-Identifier: Apache-2.0

import type { TFunction } from 'i18next';
import { Route } from './types';
import type { Route } from './types';

import Component from '@polkadot/app-poll';

Expand Down
2 changes: 1 addition & 1 deletion packages/apps-routing/src/rpc.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
// SPDX-License-Identifier: Apache-2.0

import type { TFunction } from 'i18next';
import { Route } from './types';
import type { Route } from './types';

import Component from '@polkadot/app-rpc';

Expand Down
2 changes: 1 addition & 1 deletion packages/apps-routing/src/settings.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
// SPDX-License-Identifier: Apache-2.0

import type { TFunction } from 'i18next';
import { Route } from './types';
import type { Route } from './types';

import Component, { useCounter } from '@polkadot/app-settings';

Expand Down
2 changes: 1 addition & 1 deletion packages/apps-routing/src/signing.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
// SPDX-License-Identifier: Apache-2.0

import type { TFunction } from 'i18next';
import { Route } from './types';
import type { Route } from './types';

import Component from '@polkadot/app-signing';

Expand Down
2 changes: 1 addition & 1 deletion packages/apps-routing/src/society.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
// SPDX-License-Identifier: Apache-2.0

import type { TFunction } from 'i18next';
import { Route } from './types';
import type { Route } from './types';

import Component, { useCounter } from '@polkadot/app-society';

Expand Down
2 changes: 1 addition & 1 deletion packages/apps-routing/src/staking.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
// SPDX-License-Identifier: Apache-2.0

import type { TFunction } from 'i18next';
import { Route } from './types';
import type { Route } from './types';

import Component from '@polkadot/app-staking';

Expand Down
2 changes: 1 addition & 1 deletion packages/apps-routing/src/storage.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
// SPDX-License-Identifier: Apache-2.0

import type { TFunction } from 'i18next';
import { Route } from './types';
import type { Route } from './types';

import Component from '@polkadot/app-storage';

Expand Down
2 changes: 1 addition & 1 deletion packages/apps-routing/src/sudo.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
// SPDX-License-Identifier: Apache-2.0

import type { TFunction } from 'i18next';
import { Route } from './types';
import type { Route } from './types';

import Component from '@polkadot/app-sudo';

Expand Down
2 changes: 1 addition & 1 deletion packages/apps-routing/src/techcomm.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
// SPDX-License-Identifier: Apache-2.0

import type { TFunction } from 'i18next';
import { Route } from './types';
import type { Route } from './types';

import Component, { useCounter } from '@polkadot/app-tech-comm';

Expand Down
2 changes: 1 addition & 1 deletion packages/apps-routing/src/transfer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
// SPDX-License-Identifier: Apache-2.0

import type { TFunction } from 'i18next';
import { Route } from './types';
import type { Route } from './types';

import Modal from '@polkadot/app-accounts/modals/Transfer';

Expand Down
2 changes: 1 addition & 1 deletion packages/apps-routing/src/treasury.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
// SPDX-License-Identifier: Apache-2.0

import type { TFunction } from 'i18next';
import { Route } from './types';
import type { Route } from './types';

import Component, { useCounter } from '@polkadot/app-treasury';

Expand Down
2 changes: 1 addition & 1 deletion packages/apps-routing/src/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
// SPDX-License-Identifier: Apache-2.0

import type { IconName } from '@fortawesome/fontawesome-svg-core';
import { AppProps, BareProps } from '@polkadot/react-components/types';
import type { AppProps, BareProps } from '@polkadot/react-components/types';

export type RouteGroup = 'accounts' | 'developer' | 'governance' | 'network' | 'settings';

Expand Down
2 changes: 1 addition & 1 deletion packages/apps/src/Apps.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
// Copyright 2017-2020 @polkadot/apps authors & contributors
// SPDX-License-Identifier: Apache-2.0

import { BareProps as Props, ThemeDef, ThemeProps } from '@polkadot/react-components/types';
import type { BareProps as Props, ThemeDef, ThemeProps } from '@polkadot/react-components/types';

import React, { useContext, useMemo } from 'react';
import styled, { ThemeContext } from 'styled-components';
Expand Down
2 changes: 1 addition & 1 deletion packages/apps/src/Content/NotFound.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
// Copyright 2017-2020 @polkadot/apps authors & contributors
// SPDX-License-Identifier: Apache-2.0

import { RouteProps } from '@polkadot/apps-routing/types';
import type { RouteProps } from '@polkadot/apps-routing/types';

import React from 'react';
import { Redirect } from 'react-router';
Expand Down
6 changes: 3 additions & 3 deletions packages/apps/src/Content/Status.tsx
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
// Copyright 2017-2020 @polkadot/apps authors & contributors
// SPDX-License-Identifier: Apache-2.0

import { EventRecord } from '@polkadot/types/interfaces';
import { KeyringOptions } from '@polkadot/ui-keyring/options/types';
import { ActionStatus } from '@polkadot/react-components/Status/types';
import type { EventRecord } from '@polkadot/types/interfaces';
import type { KeyringOptions } from '@polkadot/ui-keyring/options/types';
import type { ActionStatus } from '@polkadot/react-components/Status/types';

import React, { useContext, useEffect } from 'react';
import { Status as StatusDisplay, StatusContext } from '@polkadot/react-components';
Expand Down
2 changes: 1 addition & 1 deletion packages/apps/src/Content/index.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
// Copyright 2017-2020 @polkadot/apps authors & contributors
// SPDX-License-Identifier: Apache-2.0

import { Route } from '@polkadot/apps-routing/types';
import type { Route } from '@polkadot/apps-routing/types';

import React, { Suspense, useContext, useMemo } from 'react';
import { useLocation } from 'react-router-dom';
Expand Down
4 changes: 2 additions & 2 deletions packages/apps/src/Endpoints/Group.tsx
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
// Copyright 2017-2020 @polkadot/apps authors & contributors
// SPDX-License-Identifier: Apache-2.0

import { ThemeProps } from '@polkadot/react-components/types';
import { Group } from './types';
import type { ThemeProps } from '@polkadot/react-components/types';
import type { Group } from './types';

import React, { useCallback } from 'react';
import styled from 'styled-components';
Expand Down
Loading

0 comments on commit a0b82d8

Please sign in to comment.