Last active
February 5, 2025 05:24
-
-
Save xantiagoma/855b776d4ad0a5db9ae5770525816608 to your computer and use it in GitHub Desktop.
Typescript Key and Value types of object
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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]; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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> = {}; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
https://www.typescriptlang.org/docs/handbook/utility-types.html