Skip to content

Instantly share code, notes, and snippets.

@wolak041
Created May 16, 2023 16:39
Show Gist options
  • Save wolak041/057a370b6d4f1eb1c58a725569d193b9 to your computer and use it in GitHub Desktop.
Save wolak041/057a370b6d4f1eb1c58a725569d193b9 to your computer and use it in GitHub Desktop.
interface Messenger {
sendText: () => void;
sendFile: () => void;
}
type Async<T> = {
[Property in keyof T as Capitalize<Property & string>]: () => Promise<void>;
};
// type AsyncMessenger = {
// SendText: () => Promise<void>;
// SendFile: () => Promise<void>;
// }
type AsyncMessenger = Async<Messenger>;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment