-
Notifications
You must be signed in to change notification settings - Fork 1
/
index.d.ts
53 lines (41 loc) · 1.08 KB
/
index.d.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
import { FastifyPluginCallback } from 'fastify';
import { IDocumentSession, IDocumentStore, IStoreAuthOptions } from 'ravendb'
type IOptions = {
/**
* Specific name for the DocumentStore instance
*/
name?: string;
/**
* RavenDB server URL
*/
url: string;
/**
* Database name
*/
databaseName: string;
/**
* Authentication options (i.e. certificate and password)
*/
authOptions?: IStoreAuthOptions;
/**
* A function to extract the target collection from an object literal entity
*/
findCollectionNameForObjectLiteral?: (entity: object) => string;
}
type IRouteOptions = {
autoSession?: boolean | string | string[];
}
declare const plugin: FastifyPluginCallback<IOptions>;
declare module 'fastify' {
export interface FastifyInstance {
rvn: IDocumentStore & Record<string, IDocumentStore>;
}
export interface FastifyRequest {
rvn?: IDocumentSession & Record<string, IDocumentSession>;
}
export interface RouteShorthandOptions {
rvn?: IRouteOptions;
}
}
export { plugin, IOptions, IRouteOptions };
export default plugin;