Skip to content

Commit 9d05e5b

Browse files
committed
fix(typescript): do not permit unknown keys on instance
fixes #31
1 parent 3e0da09 commit 9d05e5b

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

src/index.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ type Options = {
22
[key: string]: unknown;
33
};
44

5-
type ApiExtension = { [key: string]: any };
5+
type ApiExtension = { [key: string]: unknown };
66
type TestPlugin = (
77
instance: Base,
88
options: Options
@@ -46,7 +46,7 @@ export class Base {
4646
);
4747
};
4848

49-
return BaseWithPlugins as typeof BaseWithPlugins &
49+
return BaseWithPlugins as typeof this & { plugins: any[] } &
5050
Constructor<UnionToIntersection<ReturnTypeOf<T1> & ReturnTypeOf<T2>>>;
5151
}
5252

@@ -57,7 +57,7 @@ export class Base {
5757
}
5858
};
5959

60-
return BaseWitDefaults;
60+
return BaseWitDefaults as typeof this;
6161
}
6262

6363
constructor(options: Options = {}) {
@@ -72,4 +72,4 @@ export class Base {
7272
}
7373

7474
options: Options;
75-
}
75+
}

0 commit comments

Comments
 (0)