@raclettejs/types 0.0.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,4 @@
1
+ import { Connection } from "mongoose";
2
+ import { DefaultEventsMap, Socket } from "socket.io";
3
+ export type MongooseConnection = Connection;
4
+ export type SocketIO = Socket<DefaultEventsMap, DefaultEventsMap, DefaultEventsMap, any>;
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,4 @@
1
+ import { Connection } from "mongoose";
2
+ import { DefaultEventsMap, Socket } from "socket.io";
3
+ export type MongooseConnection = Connection;
4
+ export type SocketIO = Socket<DefaultEventsMap, DefaultEventsMap, DefaultEventsMap, any>;
@@ -0,0 +1,26 @@
1
+ import "fastify";
2
+ import { MongooseConnection, SocketIO } from "./dependencies";
3
+ import { preHandlerHookHandler } from "fastify";
4
+ declare module "fastify" {
5
+ interface FastifyInstance {
6
+ db: MongooseConnection;
7
+ authenticate: preHandlerHookHandler;
8
+ wss: SocketIO;
9
+ eventbus: any;
10
+ redis: any;
11
+ http: any;
12
+ taskManager: any;
13
+ }
14
+ interface FastifyRequest {
15
+ db: MongooseConnection;
16
+ user: any;
17
+ requestParams: any;
18
+ }
19
+ interface RouteOptions {
20
+ skipHeaderValidation?: boolean;
21
+ }
22
+ interface FastifyContextConfig {
23
+ type?: string;
24
+ broadcast?: string[] | boolean;
25
+ }
26
+ }
@@ -0,0 +1 @@
1
+ import "fastify";
@@ -0,0 +1,28 @@
1
+ import "fastify";
2
+ import { MongooseConnection, SocketIO } from "./dependencies";
3
+ import type { RedisService, HttpService, TaskManager, ClientPayloadRequestData, User } from "@raclettejs/raclette-core";
4
+ import { FastifyReply } from "fastify";
5
+ declare module "fastify" {
6
+ interface FastifyInstance {
7
+ db: MongooseConnection;
8
+ authenticate: (req: FastifyRequest, res: FastifyReply) => Promise<void>;
9
+ wss: SocketIO;
10
+ eventbus: any;
11
+ redis: RedisService;
12
+ http: HttpService;
13
+ taskManager: TaskManager;
14
+ }
15
+ interface FastifyRequest {
16
+ db: MongooseConnection;
17
+ user: User;
18
+ requestParams: ClientPayloadRequestData;
19
+ }
20
+ interface RouteOptions {
21
+ skipHeaderValidation?: boolean;
22
+ }
23
+ interface FastifyContextConfig {
24
+ type?: string;
25
+ broadcast?: string[] | boolean;
26
+ }
27
+ }
28
+ export {};
@@ -0,0 +1,2 @@
1
+ import "./fastify";
2
+ export * from "@raclettejs/core";
package/dist/index.js ADDED
@@ -0,0 +1,4 @@
1
+ // Import all extensions
2
+ import "./fastify";
3
+ // Re-export your core types
4
+ export * from "@raclettejs/raclette-core";
package/dist/index.ts ADDED
@@ -0,0 +1,2 @@
1
+ import "./fastify";
2
+ export * from "@raclettejs/raclette-core";
package/package.json ADDED
@@ -0,0 +1,29 @@
1
+ {
2
+ "name": "@raclettejs/types",
3
+ "version": "0.0.1",
4
+ "description": "Type definitions for the raclette framework",
5
+ "types": "dist/index.d.ts",
6
+ "repository": "https://gitlab.com/raclettejs/types",
7
+ "author": "Pacifico Digital Explorations GmbH <info@raclettejs.com>",
8
+ "license": "MIT",
9
+ "scripts": {
10
+ "build": "tsc || true",
11
+ "prepublishOnly": "yarn build"
12
+ },
13
+ "files": [
14
+ "dist"
15
+ ],
16
+ "dependencies": {
17
+ "@types/node": "*",
18
+ "fastify": "^5.4",
19
+ "mongoose": "^8.16.3",
20
+ "socket.io": "^4.7.5",
21
+ "typescript": "^5.8.3"
22
+ },
23
+ "peerDependencies": {
24
+ "@raclettejs/core": "*"
25
+ },
26
+ "devDependencies": {
27
+ "@raclettejs/core": "^0.0.1"
28
+ }
29
+ }