mirror of
https://github.com/zhigang1992/DefinitelyTyped.git
synced 2026-05-10 09:40:21 +08:00
Make Props default to never in 'moonjs'. (#27667)
* Make `Props` default to `never` in 'moonjs'. * Update test for missing props.
This commit is contained in:
committed by
Sheetal Nandi
parent
0e67e6c782
commit
aa115293b8
4
types/moonjs/index.d.ts
vendored
4
types/moonjs/index.d.ts
vendored
@@ -22,11 +22,11 @@ declare namespace Moon {
|
||||
}
|
||||
|
||||
interface MoonConstructor {
|
||||
new <Props extends string, Data, Methods>(options?: ConstructorOptions<Props, Data, Methods>): Instance<Data & Methods & Record<Props, any>>;
|
||||
new <Props extends string = never, Data = {}, Methods = {}>(options?: ConstructorOptions<Props, Data, Methods>): Instance<Data & Methods & Record<Props, any>>;
|
||||
}
|
||||
|
||||
interface MoonStatic extends MoonConstructor {
|
||||
component<Props extends string, Data, Methods>(name: string, options: ComponentOptions<Props, Data, Methods>): MoonConstructor;
|
||||
component<Props extends string = never, Data = {}, Methods = {}>(name: string, options: ComponentOptions<Props, Data, Methods>): MoonConstructor;
|
||||
config: MoonConfig;
|
||||
use(plugin: object): void;
|
||||
compile(template: string): void;
|
||||
|
||||
@@ -17,6 +17,7 @@ const count = app.get("count");
|
||||
count; // $ExpectType number
|
||||
app.get("increment")(); // $ExpectType void
|
||||
app.callMethod("increment"); // $ExpectType any
|
||||
app.get("blahblahblah"); // $ExpectError
|
||||
|
||||
app.destroy();
|
||||
|
||||
|
||||
Reference in New Issue
Block a user