Skip to content

Instantly share code, notes, and snippets.

@wolak041
Created May 16, 2023 16:38
Show Gist options
  • Save wolak041/cbe5666a8a5b6209aa270d3e4bcd16a1 to your computer and use it in GitHub Desktop.
Save wolak041/cbe5666a8a5b6209aa270d3e4bcd16a1 to your computer and use it in GitHub Desktop.
interface Messenger {
sendText: () => void;
sendFile: () => void;
}
type Async<T> = {
[Property in keyof T]: () => 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