зеркало из https://github.com/electron/electron.git
chore: augment promisifyMultiArg deprecation (#17066)
This commit is contained in:
Родитель
7a7389ab1c
Коммит
d9c7735a04
|
@ -5,6 +5,9 @@ const contentTracing = process.atomBinding('content_tracing')
|
||||||
contentTracing.getCategories = deprecate.promisify(contentTracing.getCategories)
|
contentTracing.getCategories = deprecate.promisify(contentTracing.getCategories)
|
||||||
contentTracing.startRecording = deprecate.promisify(contentTracing.startRecording)
|
contentTracing.startRecording = deprecate.promisify(contentTracing.startRecording)
|
||||||
contentTracing.stopRecording = deprecate.promisify(contentTracing.stopRecording)
|
contentTracing.stopRecording = deprecate.promisify(contentTracing.stopRecording)
|
||||||
contentTracing.getTraceBufferUsage = deprecate.promisifyMultiArg(contentTracing.getTraceBufferUsage)
|
contentTracing.getTraceBufferUsage = deprecate.promisifyMultiArg(
|
||||||
|
contentTracing.getTraceBufferUsage,
|
||||||
|
(value) => [value.paths, value.bookmarks]
|
||||||
|
)
|
||||||
|
|
||||||
module.exports = contentTracing
|
module.exports = contentTracing
|
||||||
|
|
|
@ -102,7 +102,7 @@ const deprecate: ElectronInternal.DeprecationUtil = {
|
||||||
} as T
|
} as T
|
||||||
},
|
},
|
||||||
|
|
||||||
promisifyMultiArg: <T extends (...args: any[]) => any>(fn: T): T => {
|
promisifyMultiArg: <T extends (...args: any[]) => any>(fn: T, convertPromiseValue: (v: any) => any): T => {
|
||||||
const fnName = fn.name || 'function'
|
const fnName = fn.name || 'function'
|
||||||
const oldName = `${fnName} with callbacks`
|
const oldName = `${fnName} with callbacks`
|
||||||
const newName = `${fnName} with Promises`
|
const newName = `${fnName} with Promises`
|
||||||
|
|
|
@ -66,7 +66,7 @@ declare namespace ElectronInternal {
|
||||||
renameProperty<T, K extends (keyof T & string)>(object: T, oldName: string, newName: K): T;
|
renameProperty<T, K extends (keyof T & string)>(object: T, oldName: string, newName: K): T;
|
||||||
|
|
||||||
promisify<T extends (...args: any[]) => any>(fn: T): T;
|
promisify<T extends (...args: any[]) => any>(fn: T): T;
|
||||||
promisifyMultiArg<T extends (...args: any[]) => any>(fn: T): T;
|
promisifyMultiArg<T extends (...args: any[]) => any>(fn: T, convertPromiseValue: (v: any) => any): T;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Internal IPC has _replyInternal and NO reply method
|
// Internal IPC has _replyInternal and NO reply method
|
||||||
|
|
Загрузка…
Ссылка в новой задаче