Skip to content

Instantly share code, notes, and snippets.

@xantiagoma
Last active February 5, 2025 05:24
Show Gist options
  • Save xantiagoma/855b776d4ad0a5db9ae5770525816608 to your computer and use it in GitHub Desktop.
Save xantiagoma/855b776d4ad0a5db9ae5770525816608 to your computer and use it in GitHub Desktop.
Typescript Key and Value types of object
export const ECOMM_STEPS = {
HOME_DETAILS: 'home-details',
LOADER_SERVICE_SCREEN: 'service-loading-screen',
NO_SERVICE_SCREEN: 'no-service-screen',
FRANCHISE_SCREEN: 'franchise-screen',
ORKIN_GREEN: 'orkin-green',
SERVICE_SELECTION: 'service-selection',
PEST_SELECTION: 'pest-selection',
PEST_DETAILS: 'pest-details',
LOADER_PEST_RETURN: 'pest-return',
PERSONAL_DETAILS: 'personal-details',
LOADER_PERSONAL_DETAILS: 'loader-animation',
} as const;
export type ECOMM_STEPS_KEY = keyof typeof ECOMM_STEPS;
export type ECOMM_STEPS_VALUE = typeof ECOMM_STEPS[ECOMM_STEPS_KEY];
export type ECOMM_NEXT_STEP_RESPONSE = [ECOMM_STEPS_VALUE, any];
export type Await<T> = T extends PromiseLike<infer U> ? U : T
export type IFullAddressPromise = ReturnType<typeof getFullAddressObject>;
export type IFullAddress = Await<IFullAddressPromise>;
export type Props<T extends (...args:any[]) => any> = Parameters<T>[0];
const desktopButtonStyleProps: Props<typeof ChakraMenuButton> = {};
@xantiagoma
Copy link
Author

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment