declare var declare: DojoJS.Declare; declare global { namespace DojoJS { type InheritedMethod = HitchMethod>; /** * dojo/_base/declare() returns a constructor `C`. `new C()` returns an Object with the following * methods, in addition to the methods and properties specified via the arguments passed to declare(). */ interface DojoClassObject { declaredClass: string; /** * Calls a super method. * * This method is used inside method of classes produced with * declare() to call a super method (next in the chain). It is * used for manually controlled chaining. Consider using the regular * chaining, because it is faster. Use "this.inherited()" only in * complex cases. * * This method cannot me called from automatically chained * constructors including the case of a special (legacy) * constructor chaining. It cannot be called from chained methods. * * If "this.inherited()" cannot find the next-in-chain method, it * does nothing and returns "undefined". The last method in chain * can be a default method implemented in Object, which will be * called last. * * If "name" is specified, it is assumed that the method that * received "args" is the parent method for this call. It is looked * up in the chain list and if it is found the next-in-chain method * is called. If it is not found, the first-in-chain method is * called. * * If "name" is not specified, it will be derived from the calling * method (using a methoid property "nom"). */ inherited(args: IArguments): U; inherited(args: IArguments, newArgs: any[]): U; inherited(args: IArguments, get: true): Function | void; inherited>(method: T, args: IArguments, newArgs?: Parameters>): ReturnType>; inherited>(method: T, args: IArguments, get: true): Hitched; /** Same as {@link inherited}, but always does not have debugging */ __inherited: DojoClassObject['inherited']; /** * Returns a super method. * * This method is a convenience method for "this.inherited()". * It uses the same algorithm but instead of executing a super * method, it returns it, or "undefined" if not found. */ getInherited(args: IArguments): Function | void; getInherited>(method: T, args: IArguments): Hitched; /** * Checks the inheritance chain to see if it is inherited from this class. * * This method is used with instances of classes produced with * declare() to determine of they support a certain interface or * not. It models "instanceof" operator. */ isInstanceOf(cls: any): boolean; } interface DojoClass { new (...args: Args): T & DojoClassObject; prototype: T; /** * Adds all properties and methods of source to constructor's * prototype, making them available to all instances created with * constructor. This method is specific to constructors created with * declare(). * * Adds source properties to the constructor's prototype. It can * override existing properties. * * This method is similar to dojo.extend function, but it is specific * to constructors produced by declare(). It is implemented * using dojo.safeMixin, and it skips a constructor property, * and properly decorates copied functions. */ extend(source: U): DojoClass; /** * Create a subclass of the declared class from a list of base classes. * * Create a constructor using a compact notation for inheritance and * prototype extension. * * Mixin ancestors provide a type of multiple inheritance. * Prototypes of mixin ancestors are copied to the new class: * changes to mixin prototypes will not affect classes to which * they have been mixed in. */ createSubclass(mixins: [DojoClass, DojoClass], props: X & ThisType): DojoClass; createSubclass(mixins: [DojoClass], props: V & ThisType): DojoClass; createSubclass(mixins: DojoClass, props: V & ThisType): DojoClass; createSubclass(mixins: [DojoClass]): DojoClass; createSubclass(mixins: DojoClass): DojoClass; createSubclass(mixins: any, props: U & ThisType): DojoClass; _meta: { bases: Constructor[]; hidden: object; chains: Record; parents: Constructor[]; ctor: Constructor; }; superclass: object; } type PropsCtorArgs = T extends { constructor: (...args: infer A) => any; } ? A : []; type VanillaClass = { new (...args: Args): Proto; prototype: Proto; }; type _DeclareSubclass = P extends DojoClass ? (T extends DojoClass ? DojoClass> : T extends VanillaClass ? DojoClass> : never) : P extends VanillaClass ? (T extends DojoClass ? DojoClass> : T extends VanillaClass ? DojoClass> : never) : T extends DojoClass ? DojoClass>> : T extends VanillaClass ? DojoClass>> : never; type DojoClassFrom = T extends [infer A extends (DojoClass | VanillaClass), infer B, ...infer Rest extends any[]] ? DojoClassFrom<[_DeclareSubclass, ...Rest]> : T extends [infer A extends DojoClass] ? A : T extends object ? DojoClass> : never; type DeclareProps = C extends any[] ? T & ThisType>> : T & ThisType; /** * Create a feature-rich constructor from compact notation. */ interface Declare {

(superClass: null, props: DeclareProps

): DojoClassFrom

;

(setGlobalName: string, superClass: null, props: DeclareProps

): DojoClassFrom

; (superClass: T): DojoClassFrom<[T, {}]>; (setGlobalName: string, superClass: T): DojoClassFrom<[T, {}]>; (superClass: T, props: DeclareProps): DojoClassFrom<[T, P]>; (setGlobalName: string, superClass: T, props: DeclareProps): DojoClassFrom<[T, P]>; (superClasses: T): DojoClassFrom<[...T, {}]>; (setGlobalName: string, superClasses: T): DojoClassFrom<[...T, {}]>; (superClasses: T, props: DeclareProps): DojoClassFrom<[...T, P]>; (setGlobalName: string, superClasses: T, props: DeclareProps): DojoClassFrom<[...T, P]>; /** * Mix in properties skipping a constructor and decorating functions * like it is done by declare(). */ safeMixin(target: A, source: B): A & B; } interface Dojo { declare: Declare; safeMixin: Declare['safeMixin']; } } } export = declare; //# sourceMappingURL=declare.d.ts.map