本文整理汇总了TypeScript中electron-settings.set函数的典型用法代码示例。如果您正苦于以下问题:TypeScript set函数的具体用法?TypeScript set怎么用?TypeScript set使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了set函数的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的TypeScript代码示例。
示例1: set
export function set(key: settingKeys, value: any): Promise<void> {
if (isDev) {
DEV_CONFIG[key] = value;
return Promise.resolve()
}
return settings.set(key, value)
}
示例2: _saveState
private _saveState(): void {
const isMaximized = this._window.isMaximized()
const isFullScreen = this._window.isFullScreen()
this._state = { isFullScreen, isMaximized }
if (!(isMaximized || isFullScreen)) {
this._state.bounds = this._window.getBounds()
}
appConfig.set(this._stateName, this._state as any)
}
示例3: test_set
async function test_set() {
await settings.set('c', true) === undefined;
}
示例4: click
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)
}
}
]
},
{
示例5:
set: (preference: any) => {
settings.set(ZEIT_AUTH_TOKEN, preference);
}