/**
* Copyright (c) Cisco Systems, Inc. and its affiliates.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*
*/
/** This mixin check thay each other mixins in the prototype chain are not applied more than once to the final component class.
* Example:
* import { DedupeMixin, wasApplied } from "./DedupeMixin";
*
* const Mixin = (superclass) => {
* if (wasApplied(Mixin, superclass)) { <---- Check that mixin already applied to superclass.
return superclass;
}
class MixinClass extends superclass {
// MixinClass implementation
}
DedupeMixin(Mixin, MixinClass); <---- If mixin not applied to superclass, save it in WeakMap to check prototype chain next time.
return MixinClass;
* }
*/
export type AnyFunction = (...input: any[]) => A;
export type AnyConstructor = new (...input: any[]) => A;
export declare const wasApplied: (mixin: AnyFunction, superClass: AnyConstructor) => boolean;
export declare const DedupeMixin: (mixin: AnyFunction, superClass: AnyConstructor) => void;