Skip to content

Commit e79b262

Browse files
committed
Add types file
1 parent d8140cc commit e79b262

File tree

5 files changed

+16
-21
lines changed

5 files changed

+16
-21
lines changed

packages/connect-react/src/components/Errors.tsx

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -13,13 +13,9 @@ export type ErrorsProps<T extends ConfigurableProps, U extends ConfigurableProp>
1313
export function Errors<T extends ConfigurableProps, U extends ConfigurableProp>(props: ErrorsProps<T, U>) {
1414
const { field } = props;
1515
const {
16-
errors, prop,
16+
errors = {}, prop = {},
1717
} = field
1818

19-
if (!Object.keys(errors || {}).length) {
20-
return null;
21-
}
22-
2319
if (!errors[prop.name]) {
2420
return null
2521
}

packages/connect-react/src/hooks/form-context.tsx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,9 +14,9 @@ import {
1414
stringPropErrors,
1515
} from "../utils/component";
1616
import _ from "lodash";
17-
import type {
18-
SdkError, Observation,
19-
} from "@pipedream/types"
17+
import {
18+
Observation, SdkError,
19+
} from "../types";
2020

2121
export type DynamicProps<T extends ConfigurableProps> = { id: string; configurableProps: T; }; // TODO
2222

packages/connect-react/src/hooks/form-field-context.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ export type FormFieldContext<T extends ConfigurableProp> = {
1717
onChange: (value: PropValue<T["type"]> | undefined) => void;
1818
extra: FormFieldContextExtra<T>;
1919
errors: Record<string, string[]>;
20-
enableDebugging: boolean;
20+
enableDebugging?: boolean;
2121
};
2222

2323
export const FormFieldContext = createContext<FormFieldContext<any /* XXX fix */> | undefined>(undefined); // eslint-disable-line @typescript-eslint/no-explicit-any
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
export type SdkError = {
2+
name: string;
3+
message: string;
4+
}
5+
6+
export type Observation = {
7+
ts: number;
8+
k: string;
9+
h?: string;
10+
err?: Error;
11+
}

types/src/index.ts

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -397,15 +397,3 @@ export function defineAction<
397397
(component: Action<Methods, ActionPropDefinitions>): Action<Methods, ActionPropDefinitions> {
398398
return component;
399399
}
400-
401-
export type SdkError = {
402-
name: string;
403-
message: string;
404-
}
405-
406-
export type Observation = {
407-
ts: number;
408-
k: string;
409-
h?: string;
410-
err?: Error;
411-
}

0 commit comments

Comments
 (0)