本文整理匯總了TypeScript中@electron/internal/renderer/ipc-renderer-internal-utils.invoke函數的典型用法代碼示例。如果您正苦於以下問題:TypeScript invoke函數的具體用法?TypeScript invoke怎麽用?TypeScript invoke使用的例子?那麽, 這裏精選的函數代碼示例或許可以為您提供幫助。
在下文中一共展示了invoke函數的4個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的TypeScript代碼示例。
示例1: function
const showFileChooserDialog = function (callback: (blob: File) => void) {
invoke<[ string, any ]>('ELECTRON_INSPECTOR_SELECT_FILE').then(([path, data]) => {
if (path && data) {
callback(dataToHtml5FileObject(path, data))
}
})
}
示例2: attachGuest
export function attachGuest (
elementInstanceId: number, guestInstanceId: number, params: Record<string, any>, contentWindow: Window
) {
const embedderFrameId = (webFrame as ElectronInternal.WebFrameInternal).getWebFrameId(contentWindow)
if (embedderFrameId < 0) { // this error should not happen.
throw new Error('Invalid embedder frame')
}
invoke('ELECTRON_GUEST_VIEW_MANAGER_ATTACH_GUEST', embedderFrameId, elementInstanceId, guestInstanceId, params)
}
示例3: createGuest
export function createGuest (params: Record<string, any>): Promise<number> {
return invoke('ELECTRON_GUEST_VIEW_MANAGER_CREATE_GUEST', params)
}
示例4: destroyGuest
export function destroyGuest (guestInstanceId: number): void {
invoke('ELECTRON_GUEST_VIEW_MANAGER_DESTROY_GUEST', guestInstanceId)
}