Skip to content

Commit

Permalink
useGenericObjectState: Fix types so that setFormValue function narrow…
Browse files Browse the repository at this point in the history
…s value type by key

Signed-off-by: Mike Turley <[email protected]>
  • Loading branch information
mturley committed Jul 10, 2024
1 parent a90b5d7 commit c938bbc
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions frontend/src/pages/projects/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,12 +9,14 @@ import {
Volume,
VolumeMount,
} from '~/types';
import { ValueOf } from '~/typeHelpers';
import { AWSSecretKind } from '~/k8sTypes';
import { AcceleratorProfileState } from '~/utilities/useAcceleratorProfileState';
import { AwsKeys } from './dataConnections/const';

export type UpdateObjectAtPropAndValue<T> = (propKey: keyof T, propValue: ValueOf<T>) => void;
export type UpdateObjectAtPropAndValue<T> = <K extends keyof T = keyof T>(
propKey: K,
propValue: T[K],
) => void;

export type NameDescType = {
name: string;
Expand Down

0 comments on commit c938bbc

Please sign in to comment.