Skip to content

Instantly share code, notes, and snippets.

@d1y
Created January 5, 2020 07:36
Show Gist options
  • Select an option

  • Save d1y/dbdbb8f0bd9c982a1925d46c2a38e5d3 to your computer and use it in GitHub Desktop.

Select an option

Save d1y/dbdbb8f0bd9c982a1925d46c2a38e5d3 to your computer and use it in GitHub Desktop.
typescript 限制输入值
import * as execa from 'execa'
type Desktop =
'kde' |
'gnome' |
// http://deepin.org
'dde' |
// https://elementary.io/
'pantheon' |
'win' |
'macos'
interface dialogInterface {
type: Desktop
}
class Dialog {
constructor(conf: dialogInterface) {
}
}
const options: dialogInterface = {
type: 'macos'
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment