Skip to content

Commit 71cd285

Browse files
build(release): index.js & index.d.ts for 1.1.1
[skip ci]
1 parent d72ce11 commit 71cd285

File tree

2 files changed

+21
-34
lines changed

2 files changed

+21
-34
lines changed

index.d.ts

Lines changed: 11 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -15,36 +15,19 @@ declare type AnyFunction = (...args: any) => any;
1515
declare type ReturnTypeOf<T extends AnyFunction | AnyFunction[]> = T extends AnyFunction ? ReturnType<T> : T extends AnyFunction[] ? UnionToIntersection<ReturnType<T[number]>> : never;
1616
export declare class Base {
1717
static plugins: TestPlugin[];
18-
static plugin<T extends TestPlugin | TestPlugin[]>(plugin: T): {
19-
new (options?: Options): {
20-
options: Options;
18+
static plugin<S extends Constructor<any> & {
19+
plugins: any[];
20+
}, T extends TestPlugin | TestPlugin[]>(this: S, plugin: T): {
21+
new (...args: any[]): {
22+
[x: string]: any;
2123
};
22-
plugins: TestPlugin[];
23-
plugin<T_1 extends TestPlugin | TestPlugin[]>(plugin: T): any & Constructor<ReturnTypeOf<T>>;
24-
defaults(defaults: Options): {
25-
new (options?: Options): {
26-
options: Options;
27-
};
28-
plugins: TestPlugin[];
29-
plugin<T_1 extends TestPlugin | TestPlugin[]>(plugin: T): any & Constructor<ReturnTypeOf<T>>;
30-
defaults(defaults: Options): any;
24+
plugins: any[];
25+
} & S & Constructor<ReturnTypeOf<T>>;
26+
static defaults<S extends Constructor<any>>(this: S, defaults: Options): {
27+
new (...args: any[]): {
28+
[x: string]: any;
3129
};
32-
} & Constructor<ReturnTypeOf<T>>;
33-
static defaults(defaults: Options): {
34-
new (options?: Options): {
35-
options: Options;
36-
};
37-
plugins: TestPlugin[];
38-
plugin<T extends TestPlugin | TestPlugin[]>(plugin: T): {
39-
new (options?: Options): {
40-
options: Options;
41-
};
42-
plugins: TestPlugin[];
43-
plugin<T extends TestPlugin | TestPlugin[]>(plugin: T): any & Constructor<ReturnTypeOf<T>>;
44-
defaults(defaults: Options): any;
45-
} & Constructor<ReturnTypeOf<T>>;
46-
defaults(defaults: Options): any;
47-
};
30+
} & S;
4831
constructor(options?: Options);
4932
options: Options;
5033
}

index.js

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -40,14 +40,18 @@ var Base = /** @class */ (function () {
4040
return BaseWithPlugins;
4141
};
4242
Base.defaults = function (defaults) {
43-
return /** @class */ (function (_super) {
44-
__extends(OctokitWithDefaults, _super);
45-
function OctokitWithDefaults(options) {
46-
if (options === void 0) { options = {}; }
47-
return _super.call(this, Object.assign({}, defaults, options)) || this;
43+
var OctokitWithDefaults = /** @class */ (function (_super) {
44+
__extends(class_2, _super);
45+
function class_2() {
46+
var args = [];
47+
for (var _i = 0; _i < arguments.length; _i++) {
48+
args[_i] = arguments[_i];
49+
}
50+
return _super.call(this, Object.assign({}, defaults, args[0] || {})) || this;
4851
}
49-
return OctokitWithDefaults;
52+
return class_2;
5053
}(this));
54+
return OctokitWithDefaults;
5155
};
5256
Base.plugins = [];
5357
return Base;

0 commit comments

Comments
 (0)