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