Skip to content
This repository was archived by the owner on Feb 1, 2024. It is now read-only.

Commit 7cf9b4b

Browse files
author
Achim Schneider
committed
fix more ts impoerts
1 parent 06237fb commit 7cf9b4b

File tree

11 files changed

+26
-22
lines changed

11 files changed

+26
-22
lines changed

packages/ink-editor/src/api/compile.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import * as Common from '@paritytech/commontypes';
1+
import Common from '@paritytech/commontypes';
22

33
export type CompileApiRequest = Common.CompilationRequest;
44

packages/ink-editor/src/api/format.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import * as Common from '@paritytech/commontypes';
1+
import Common from '@paritytech/commontypes';
22

33
export type FormattingApiRequest = Common.FormattingRequest;
44

packages/ink-editor/src/api/gists/create.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import * as Common from '@paritytech/commontypes';
1+
import Common from '@paritytech/commontypes';
22

33
// -------------------------------------------------------------------------------------------------
44
// Types

packages/ink-editor/src/api/gists/load.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import * as Common from '@paritytech/commontypes';
1+
import Common from '@paritytech/commontypes';
22

33
// -------------------------------------------------------------------------------------------------
44
// Types

packages/ink-editor/src/api/testing.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import * as Common from '@paritytech/commontypes';
1+
import Common from '@paritytech/commontypes';
22

33
export type TestingApiRequest = Common.TestingRequest;
44

packages/playground/__tests__/context/app/reducer.test.tsx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { CompilationResult } from '@paritytech/commontypes';
1+
import Common from '@paritytech/commontypes';
22
import { reducer, defaultState, CompileState, Action } from '~/context/app/reducer';
33

44
describe('Given the reducer is used to manage state', () => {
@@ -110,7 +110,7 @@ describe('Given the reducer is used to manage state', () => {
110110
test('When endpoint returns "OK" with "ERROR"', () => {
111111
// Given
112112
const type = 'SET_COMPILE_STATE';
113-
const compilationPayload: CompilationResult = {
113+
const compilationPayload: Common.CompilationResult = {
114114
type: 'ERROR',
115115
payload: {
116116
stdout: '',
@@ -137,7 +137,7 @@ describe('Given the reducer is used to manage state', () => {
137137
test('When endpoint returns "OK" with "SUCCESS"', () => {
138138
// Given
139139
const type = 'SET_COMPILE_STATE';
140-
const compilationPayload: CompilationResult = {
140+
const compilationPayload: Common.CompilationResult = {
141141
type: 'SUCCESS',
142142
payload: {
143143
wasm: [1, 2, 3],

packages/playground/__tests__/context/reducer.test.tsx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { CompilationResult } from '@paritytech/commontypes';
1+
import Common from '@paritytech/commontypes';
22
import { reducer, defaultState, CompileState, Action } from '~/context/app/reducer';
33

44
describe('Given the reducer is used to manage state', () => {
@@ -110,7 +110,7 @@ describe('Given the reducer is used to manage state', () => {
110110
test('When endpoint returns "OK" with "ERROR"', () => {
111111
// Given
112112
const type = 'SET_COMPILE_STATE';
113-
const compilationPayload: CompilationResult = {
113+
const compilationPayload: Common.CompilationResult = {
114114
type: 'ERROR',
115115
payload: {
116116
stdout: '',
@@ -137,7 +137,7 @@ describe('Given the reducer is used to manage state', () => {
137137
test('When endpoint returns "OK" with "SUCCESS"', () => {
138138
// Given
139139
const type = 'SET_COMPILE_STATE';
140-
const compilationPayload: CompilationResult = {
140+
const compilationPayload: Common.CompilationResult = {
141141
type: 'SUCCESS',
142142
payload: {
143143
wasm: [1, 2, 3],

packages/playground/src/app/Header/ShareSubmenu.tsx

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,13 +6,13 @@ import { gistCreate } from '~/context/side-effects/create-gist';
66
import { AppContext } from '~/context/app/';
77
import { MessageContext } from '~/context/messages/';
88
import { MessageState, MessageDispatch } from '~/context/messages/reducer';
9-
import { Gist, GistCreateResponse } from '@paritytech/commontypes';
9+
import Common from '@paritytech/commontypes';
1010
import { GistCreateApiResponse } from '@paritytech/ink-editor/api/gists';
1111
import qs from 'qs';
1212

1313
const ViewError = ({ message }: { message: string }) => <div>{message}</div>;
1414

15-
const ViewGist = ({ gist }: { gist?: Gist }) => (
15+
const ViewGist = ({ gist }: { gist?: Common.Gist }) => (
1616
<>
1717
<LabeledLink
1818
label="Link to Playground:"
@@ -31,7 +31,11 @@ const gitPlaygroundUrl = (id: string): string => {
3131
return `${window.location.origin}/?${qs.stringify({ id })}`;
3232
};
3333

34-
const GistCreateResponse = ({ response }: { response: GistCreateResponse }): ReactElement => {
34+
const GistCreateResponse = ({
35+
response,
36+
}: {
37+
response: Common.GistCreateResponse;
38+
}): ReactElement => {
3539
switch (response.type) {
3640
case 'SUCCESS':
3741
return <ViewGist gist={response.payload} />;

packages/playground/src/context/messages/reducer.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { CompilationResult, TestingResult, FormattingResult } from '@paritytech/commontypes';
1+
import Common from '@paritytech/commontypes';
22
import { Message, Status, Severity, Prompt } from '@paritytech/components/';
33
import * as sizeLimit from '~/constants';
44
import { extractContractSize } from '../side-effects/compile';
@@ -33,7 +33,7 @@ export type CompilationMessage = {
3333
payload: {
3434
status: Status;
3535
content: string;
36-
result?: CompilationResult;
36+
result?: Common.CompilationResult;
3737
};
3838
};
3939

@@ -42,7 +42,7 @@ export type TestingMessage = {
4242
payload: {
4343
status: Status;
4444
content: string;
45-
result?: TestingResult;
45+
result?: Common.TestingResult;
4646
};
4747
};
4848

@@ -51,7 +51,7 @@ export type FormattingMessage = {
5151
payload: {
5252
status: Status;
5353
content: string;
54-
result?: FormattingResult;
54+
result?: Common.FormattingResult;
5555
};
5656
};
5757

packages/playground/src/context/side-effects/create-gist.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ import { State, Dispatch } from '../app/reducer';
22
import { MessageAction, MessageDispatch, GistMessage } from '../messages/reducer';
33
import * as monaco from 'monaco-editor/esm/vs/editor/editor.api';
44
import { GistCreateApiResponse, gistCreateRequest } from '@paritytech/ink-editor/api/gists';
5-
import { GistCreateResponse } from '@paritytech/commontypes';
5+
import Common from '@paritytech/commontypes';
66
import { GIST_CREATE_URL } from '~/env';
77

88
const resetToNotAsked = (dispatch: Dispatch, dispatchMessage: MessageDispatch): void => {
@@ -39,7 +39,7 @@ const getMessageAction = (result: GistCreateApiResponse): GistMessage => {
3939
}
4040
};
4141

42-
const handleOk = (response: GistCreateResponse): GistMessage => {
42+
const handleOk = (response: Common.GistCreateResponse): GistMessage => {
4343
switch (response.type) {
4444
case 'ERROR':
4545
return {

0 commit comments

Comments
 (0)