本文整理汇总了TypeScript中electron-settings.get函数的典型用法代码示例。如果您正苦于以下问题:TypeScript get函数的具体用法?TypeScript get怎么用?TypeScript get使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了get函数的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的TypeScript代码示例。
示例1: get
export function get(value: settingKeys): Promise<any> {
if (isDev) {
return Promise.resolve(DEV_CONFIG[value])
}
return settings.get(value)
}
示例2: constructor
public constructor(stateName: string, window: BrowserWindow) {
this._stateName = `state.window.${stateName}`
this._window = window
// Set the window state from appConfig if available,
// otherwise use defaults
this._state = appConfig.has(this._stateName)
? (appConfig.get(this._stateName) as State)
: { isMaximized: true }
return this
}
示例3: init
export function init(): void {
setMinimalMode(Boolean(appConfig.get(CONFIG_KEY, false)))
}
示例4: test_get
async function test_get() {
await settings.get('b') === '';
}
示例5: click
{
label: 'Default Mailto Client',
type: 'checkbox',
checked: app.isDefaultProtocolClient('mailto'),
click() {
if (app.isDefaultProtocolClient('mailto')) {
app.removeAsDefaultProtocolClient('mailto')
} else {
app.setAsDefaultProtocolClient('mailto')
}
}
},
{
label: 'Minimal Mode',
type: 'checkbox',
checked: Boolean(appConfig.get(MINIMAL_MODE_CONFIG_KEY)),
click({ checked }) {
appConfig.set(MINIMAL_MODE_CONFIG_KEY, checked)
setMinimalMode(checked)
}
},
{
label: 'Debug Mode',
type: 'checkbox',
checked: Boolean(appConfig.get(DEBUG_MODE_CONFIG_KEY)),
click({ checked }) {
appConfig.set(DEBUG_MODE_CONFIG_KEY, checked)
showRestartDialog(checked)
}
}
]
示例6:
get: () => {
return settings.get(ZEIT_AUTH_TOKEN);
},