Created
February 22, 2022 14:00
-
-
Save koistya/3131c50722dd033f64abe6a4c19cdedf to your computer and use it in GitHub Desktop.
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
interface PluginConfigTypes { | |
gtag: { | |
trackingID: string | |
} | |
otherPlugin: { | |
test: number | |
} | |
} | |
type Config<K extends keyof PluginConfigTypes> = { | |
title: string | |
plugins: K[] | |
} & Pick<PluginConfigTypes, K> | |
function createConfig< | |
K extends keyof PluginConfigTypes | |
>(config: Config<K>) { | |
return config | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment