@steambrew/client
Version:
A support library for creating plugins with Millennium.
19 lines (18 loc) • 792 B
TypeScript
export declare let callOriginal: symbol;
export interface PatchOptions {
singleShot?: boolean;
}
type GenericPatchHandler = (args: any[], ret?: any) => any;
export interface Patch {
original: Function;
property: string;
object: any;
patchedFunction: any;
hasUnpatched: boolean;
handler: GenericPatchHandler;
unpatch: () => void;
}
export declare function beforePatch(object: any, property: string, handler: (args: any[]) => any, options?: PatchOptions): Patch;
export declare function afterPatch(object: any, property: string, handler: (args: any[], ret: any) => any, options?: PatchOptions): Patch;
export declare function replacePatch(object: any, property: string, handler: (args: any[]) => any, options?: PatchOptions): Patch;
export {};