本文整理匯總了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);
}