mirror of
https://github.com/zhigang1992/DefinitelyTyped.git
synced 2026-05-12 19:59:02 +08:00
Merge pull request #24502 from garfty/master
Glue: Moved typings to types folder
This commit is contained in:
35
glue/index.d.ts
vendored
35
glue/index.d.ts
vendored
@@ -1,35 +0,0 @@
|
||||
// Type definitions for glue
|
||||
// Project: https://github.com/hapijs/glue
|
||||
// Definitions by: Gareth Parker
|
||||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
||||
// TypeScript Version: 2.7
|
||||
|
||||
declare module "glue" {
|
||||
|
||||
import { Server, ServerOptions } from "hapi";
|
||||
|
||||
export interface Options {
|
||||
relativeTo: string;
|
||||
preConnections?: (Server:Server, next:(err:any)=>void ) => void;
|
||||
preRegister?: (Server:Server, next:(err:any)=>void ) => void;
|
||||
}
|
||||
|
||||
interface Plugin {
|
||||
plugin: string | {
|
||||
register:string;
|
||||
options?:any;
|
||||
};
|
||||
options?: any;
|
||||
routes?: any
|
||||
}
|
||||
|
||||
interface Manifest {
|
||||
server: ServerOptions;
|
||||
register?: {
|
||||
plugins: Array<Plugin>
|
||||
}
|
||||
}
|
||||
|
||||
export function compose(manifest: Manifest, options?: Options): Server;
|
||||
|
||||
}
|
||||
@@ -15,6 +15,6 @@ const manifest: Glue.Manifest = {
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
Glue.compose(manifest);
|
||||
Glue.compose(manifest);
|
||||
31
types/glue/index.d.ts
vendored
Normal file
31
types/glue/index.d.ts
vendored
Normal file
@@ -0,0 +1,31 @@
|
||||
// Type definitions for glue 5.0
|
||||
// Project: https://github.com/hapijs/glue
|
||||
// Definitions by: Gareth Parker <https://github.com/garfty>
|
||||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
||||
// TypeScript Version: 2.4
|
||||
|
||||
import { Server, ServerOptions } from "hapi";
|
||||
|
||||
export interface Options {
|
||||
relativeTo: string;
|
||||
preConnections?: (Server: Server, next: (err: any) => void) => void;
|
||||
preRegister?: (Server: Server, next: (err: any) => void) => void;
|
||||
}
|
||||
|
||||
export interface Plugin {
|
||||
plugin: string | {
|
||||
register: string;
|
||||
options?: any;
|
||||
};
|
||||
options?: any;
|
||||
routes?: any;
|
||||
}
|
||||
|
||||
export interface Manifest {
|
||||
server: ServerOptions;
|
||||
register?: {
|
||||
plugins: Plugin[]
|
||||
};
|
||||
}
|
||||
|
||||
export function compose(manifest: Manifest, options?: Options): Server;
|
||||
@@ -21,6 +21,6 @@
|
||||
},
|
||||
"files": [
|
||||
"index.d.ts",
|
||||
"hapi-glue-test.ts"
|
||||
"glue-tests.ts"
|
||||
]
|
||||
}
|
||||
Reference in New Issue
Block a user