UNPKG

legacy-extends

Version:

Helper to extend a class including defining super_ and superConstruct (optional) on the derived class. Compatible with Node.js inherits and handles es6 classes using Reflect API

12 lines (11 loc) 386 B
export type Klass = new (...args: unknown[]) => unknown; export interface KlassHelper { super_: typeof Function.prototype; superConstruct: () => Klass; } export interface Options { ensureProperties?: unknown[]; } declare function extendLegacy(child_: unknown, parent_: unknown, options?: Options): void; declare const _default: typeof extendLegacy; export default _default;