refactor: improve function deprecation module (#19012)

* add removeFunction to deprecation module

* clarify deprecate api

* throw error

* change error msg
This commit is contained in:
Micha Hanselmann 2019-07-08 18:01:35 -07:00 committed by Cheng Zhao
parent a90306876e
commit d79e6bbffe
3 changed files with 18 additions and 5 deletions

View file

@ -76,7 +76,8 @@ declare namespace ElectronInternal {
getHandler(): DeprecationHandler | null;
warn(oldName: string, newName: string): void;
log(message: string): void;
function(fn: Function, newName: string): Function;
removeFunction(fn: Function, removedName: string): Function;
renameFunction(fn: Function, newName: string): Function;
event(emitter: NodeJS.EventEmitter, oldName: string, newName: string): void;
fnToProperty(module: any, prop: string, getter: string, setter: string): void;
removeProperty<T, K extends (keyof T & string)>(object: T, propertyName: K): T;