refactor: don't expose deprecate as an internal module (#35311)

This commit is contained in:
Milan Burda 2022-08-15 10:09:33 +02:00 committed by GitHub
parent 81766707fc
commit 8424779906
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
11 changed files with 149 additions and 174 deletions

View file

@ -147,12 +147,6 @@ declare namespace Electron {
_throw(error: Error | string): void;
}
const deprecate: ElectronInternal.DeprecationUtil;
namespace Main {
const deprecate: ElectronInternal.DeprecationUtil;
}
class View {}
// Experimental views API
@ -193,21 +187,6 @@ declare namespace Electron {
}
declare namespace ElectronInternal {
type DeprecationHandler = (message: string) => void;
interface DeprecationUtil {
warnOnce(oldName: string, newName?: string): () => void;
setHandler(handler: DeprecationHandler | null): void;
getHandler(): DeprecationHandler | null;
warn(oldName: string, newName: string): void;
log(message: string): void;
removeFunction<T extends Function>(fn: T, removedName: string): T;
renameFunction<T extends Function>(fn: T, newName: string): T;
event(emitter: NodeJS.EventEmitter, oldName: string, newName: string): void;
removeProperty<T, K extends (keyof T & string)>(object: T, propertyName: K, onlyForValues?: any[]): T;
renameProperty<T, K extends (keyof T & string)>(object: T, oldName: string, newName: K): T;
moveAPI<T extends Function>(fn: T, oldUsage: string, newUsage: string): T;
}
interface DesktopCapturer {
startHandling(captureWindow: boolean, captureScreen: boolean, thumbnailSize: Electron.Size, fetchWindowIcons: boolean): void;
_onerror?: (error: string) => void;