diff --git a/src/declarations/stencil-public-runtime.ts b/src/declarations/stencil-public-runtime.ts index ec93403edc4..4a847fa217a 100644 --- a/src/declarations/stencil-public-runtime.ts +++ b/src/declarations/stencil-public-runtime.ts @@ -6,10 +6,6 @@ declare type CustomMethodDecorator = ( type UnionToIntersection = (U extends any ? (x: U) => void : never) extends (x: infer I) => void ? I : never; -type MixinFactory = any>( - base: TBase, -) => abstract new (...args: ConstructorParameters) => any; - export interface ComponentDecorator { (opts?: ComponentOptions): ClassDecorator; } @@ -407,15 +403,21 @@ export declare function readTask(task: RafCallback): void; */ export declare const setErrorHandler: (handler: ErrorHandler) => void; +export type MixinFactory = any>( + base: TBase, +) => abstract new (...args: ConstructorParameters) => any; + /** * Compose multiple mixin classes into a single constructor. * The resulting class has the combined instance types of all mixed-in classes. * * Example: * ``` - * const AWrap = (Base) => {class A extends Base { propA = A }; return A;} - * const BWrap = (Base) => {class B extends Base { propB = B }; return B;} - * const CWrap = (Base) => {class C extends Base { propC = C }; return C;} + * import { Mixin, MixinFactory } from '@stencil/core'; + * + * const AWrap: MixinFactory = (Base) => {class A extends Base { propA = A }; return A;} + * const BWrap: MixinFactory = (Base) => {class B extends Base { propB = B }; return B;} + * const CWrap: MixinFactory = (Base) => {class C extends Base { propC = C }; return C;} * * class X extends Mixin(AWrap, BWrap, CWrap) { * render() { return
{this.propA} {this.propB} {this.propC}
; } diff --git a/src/internal/stencil-core/index.d.ts b/src/internal/stencil-core/index.d.ts index 71ece2c6f6d..25c4c5b7e05 100644 --- a/src/internal/stencil-core/index.d.ts +++ b/src/internal/stencil-core/index.d.ts @@ -40,6 +40,7 @@ export { Listen, Method, Mixin, + MixinFactory, Prop, readTask, render,